GlobalValue 추가

This commit is contained in:
NTG_Lenovo 2023-08-16 14:40:33 +09:00
parent fb7893d0f5
commit dbbb923e23
6 changed files with 50465 additions and 50457 deletions

File diff suppressed because it is too large Load Diff

View File

@ -4,7 +4,6 @@ using System.Collections.Generic;
using Sirenix.OdinInspector; using Sirenix.OdinInspector;
using UnityEngine; using UnityEngine;
using UnityEngine.AI; using UnityEngine.AI;
using UnityEngine.Serialization;
using Random = UnityEngine.Random; using Random = UnityEngine.Random;
// ReSharper disable once CheckNamespace // ReSharper disable once CheckNamespace
@ -307,14 +306,14 @@ namespace BlueWaterProject
#region IAiMover #region IAiMover
[field: Space(10f)] [field: Space(10f)]
[field: Title("Mover")] [field: Title("AiMover")]
[field: SerializeField] public MoveType MoveType { get; set; } [field: SerializeField] public MoveType MoveType { get; set; }
[field: SerializeField] public bool IsCommanded { get; set; } [field: SerializeField] public bool IsCommanded { get; set; }
public void UpdateMovement() public void UpdateMovement()
{ {
aiAnimator.SetFloat(AiController.SpeedHash, navMeshAgent.velocity.normalized.magnitude); aiAnimator.SetFloat(SpeedHash, navMeshAgent.velocity.normalized.magnitude);
if (IsCommanded || isAttacking) if (IsCommanded || isAttacking)
{ {

View File

@ -5,21 +5,6 @@ using UnityEngine;
// ReSharper disable once CheckNamespace // ReSharper disable once CheckNamespace
namespace BlueWaterProject 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] [Serializable]
public class Unit public class Unit
{ {
@ -27,7 +12,7 @@ namespace BlueWaterProject
public string unitName; public string unitName;
[Tooltip("부대의 종류")] [Tooltip("부대의 종류")]
public UnitType unitType; public GlobalValue.UnitType unitType;
[Tooltip("부대의 병력 수")] [Tooltip("부대의 병력 수")]
public int soliderCount; public int soliderCount;
@ -38,12 +23,12 @@ namespace BlueWaterProject
public Unit() public Unit()
{ {
unitName = null; unitName = null;
unitType = UnitType.NONE; unitType = GlobalValue.UnitType.NONE;
soliderCount = 0; soliderCount = 0;
soldierList = new List<AiController>(); 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.unitName = unitName;
this.unitType = unitType; this.unitType = unitType;

View File

@ -126,7 +126,7 @@ namespace BlueWaterProject
return; 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.Clear();
objectNameBuilder.Append(soliderPrefabList[(int)unit.unitType].name); objectNameBuilder.Append(soliderPrefabList[(int)unit.unitType].name);

View 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
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 1f69224fd192e8946abde7742e2fe9b5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: