GlobalValue 추가
This commit is contained in:
parent
fb7893d0f5
commit
dbbb923e23
File diff suppressed because it is too large
Load Diff
@ -4,7 +4,6 @@ using System.Collections.Generic;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEngine;
|
||||
using UnityEngine.AI;
|
||||
using UnityEngine.Serialization;
|
||||
using Random = UnityEngine.Random;
|
||||
|
||||
// ReSharper disable once CheckNamespace
|
||||
@ -307,14 +306,14 @@ namespace BlueWaterProject
|
||||
#region IAiMover
|
||||
|
||||
[field: Space(10f)]
|
||||
[field: Title("Mover")]
|
||||
[field: Title("AiMover")]
|
||||
[field: SerializeField] public MoveType MoveType { get; set; }
|
||||
|
||||
[field: SerializeField] public bool IsCommanded { get; set; }
|
||||
|
||||
public void UpdateMovement()
|
||||
{
|
||||
aiAnimator.SetFloat(AiController.SpeedHash, navMeshAgent.velocity.normalized.magnitude);
|
||||
aiAnimator.SetFloat(SpeedHash, navMeshAgent.velocity.normalized.magnitude);
|
||||
|
||||
if (IsCommanded || isAttacking)
|
||||
{
|
||||
|
@ -5,21 +5,6 @@ using UnityEngine;
|
||||
// ReSharper disable once CheckNamespace
|
||||
namespace BlueWaterProject
|
||||
{
|
||||
public enum UnitType
|
||||
{
|
||||
ARCHER_E = 0,
|
||||
SPEAR_KNIGHT_E,
|
||||
SPEARMAN_E,
|
||||
SWORD_KNIGHT_E,
|
||||
SWORDMAN_E,
|
||||
ARCHER_P,
|
||||
AXEMAN_P,
|
||||
SPEARMAN_P,
|
||||
SWORD_KNIGHT_P,
|
||||
SWORDMAN_P,
|
||||
NONE
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class Unit
|
||||
{
|
||||
@ -27,7 +12,7 @@ namespace BlueWaterProject
|
||||
public string unitName;
|
||||
|
||||
[Tooltip("부대의 종류")]
|
||||
public UnitType unitType;
|
||||
public GlobalValue.UnitType unitType;
|
||||
|
||||
[Tooltip("부대의 병력 수")]
|
||||
public int soliderCount;
|
||||
@ -38,12 +23,12 @@ namespace BlueWaterProject
|
||||
public Unit()
|
||||
{
|
||||
unitName = null;
|
||||
unitType = UnitType.NONE;
|
||||
unitType = GlobalValue.UnitType.NONE;
|
||||
soliderCount = 0;
|
||||
soldierList = new List<AiController>();
|
||||
}
|
||||
|
||||
public Unit(string unitName, UnitType unitType, int soliderCount, List<AiController> soldierList)
|
||||
public Unit(string unitName, GlobalValue.UnitType unitType, int soliderCount, List<AiController> soldierList)
|
||||
{
|
||||
this.unitName = unitName;
|
||||
this.unitType = unitType;
|
||||
|
@ -126,7 +126,7 @@ namespace BlueWaterProject
|
||||
return;
|
||||
}
|
||||
|
||||
var soldierObject = Instantiate(soliderPrefabList[(int)unit.unitType], spawnPosition, Quaternion.identity, unitController.transform).GetComponent<AiController>();
|
||||
var soldierObject = Instantiate(soliderPrefabList[(int)unit.unitType - 1], spawnPosition, Quaternion.identity, unitController.transform).GetComponent<AiController>();
|
||||
|
||||
objectNameBuilder.Clear();
|
||||
objectNameBuilder.Append(soliderPrefabList[(int)unit.unitType].name);
|
||||
|
17
BlueWater/Assets/02.Scripts/Utility/GlobalValue.cs
Normal file
17
BlueWater/Assets/02.Scripts/Utility/GlobalValue.cs
Normal file
@ -0,0 +1,17 @@
|
||||
public class GlobalValue
|
||||
{
|
||||
public enum UnitType
|
||||
{
|
||||
NONE = 0,
|
||||
ARCHER_E,
|
||||
SPEAR_KNIGHT_E,
|
||||
SPEARMAN_E,
|
||||
SWORD_KNIGHT_E,
|
||||
SWORDMAN_E,
|
||||
ARCHER_P,
|
||||
AXEMAN_P,
|
||||
SPEARMAN_P,
|
||||
SWORD_KNIGHT_P,
|
||||
SWORDMAN_P
|
||||
}
|
||||
}
|
11
BlueWater/Assets/02.Scripts/Utility/GlobalValue.cs.meta
Normal file
11
BlueWater/Assets/02.Scripts/Utility/GlobalValue.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1f69224fd192e8946abde7742e2fe9b5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Reference in New Issue
Block a user