메인 씬 병합
This commit is contained in:
parent
98a205d804
commit
ad7da74ed4
File diff suppressed because it is too large
Load Diff
BIN
BlueWater/Assets/01.Scenes/02.Main/NavMesh-FirstMap.asset
Normal file
BIN
BlueWater/Assets/01.Scenes/02.Main/NavMesh-FirstMap.asset
Normal file
Binary file not shown.
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e7c7d6f5a0b2b8747b46ea19b5b42628
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 23800000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
BIN
BlueWater/Assets/01.Scenes/02.Main/NavMesh-NavmeshSurface.asset
Normal file
BIN
BlueWater/Assets/01.Scenes/02.Main/NavMesh-NavmeshSurface.asset
Normal file
Binary file not shown.
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b95744d58e531dc43ac8d0171a731a82
|
||||
guid: d8b416c0c70775b4c9a4b765f97e3ab9
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 23800000
|
BIN
BlueWater/Assets/01.Scenes/02.Main/NavMesh-SecondMap.asset
Normal file
BIN
BlueWater/Assets/01.Scenes/02.Main/NavMesh-SecondMap.asset
Normal file
Binary file not shown.
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ed36e1064a49b084bac46d5debdc1de3
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 23800000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Binary file not shown.
@ -74,7 +74,7 @@ namespace BlueWaterProject
|
||||
[PropertyOrder(-9)]
|
||||
[HorizontalGroup("Split", 0.5f)]
|
||||
[GUIColor("GetCreateUnitButtonColor")]
|
||||
[EnableIf("@DataManager.Inst.GetUnitSoKey(unit.Idx) != null")]
|
||||
[EnableIf("@DataManager.Inst.GetEnemyUnitSoKey(unit.Idx) != null || DataManager.Inst.GetUnitSoKey(unit.Idx) != null")]
|
||||
[Button("유닛 생성")]
|
||||
public void CreateUnit()
|
||||
{
|
||||
|
@ -65,6 +65,7 @@ namespace BlueWaterProject
|
||||
|
||||
private const int MATRICES_CAPACITY = 9;
|
||||
private const int CHARACTER_PREFAB_CAPACITY = 10;
|
||||
private const int ANIMATOR_CONTROLLER_PREFAB_CAPACITY = 6;
|
||||
private const int PLAYER_UNIT_CAPACITY = 50;
|
||||
|
||||
#endregion
|
||||
@ -120,13 +121,22 @@ namespace BlueWaterProject
|
||||
/// 프리팹 초기화 함수
|
||||
/// </summary>
|
||||
[GUIColor(0, 1, 0)]
|
||||
[ShowIf("@BaseCharacterPrefab == null || UnitPrefab == null || ArrowPrefab == null")]
|
||||
[ShowIf("@BaseCharacterPrefab == null || UnitPrefab == null || ArrowPrefab == null || AIAnimatorControllerList.Count != ANIMATOR_CONTROLLER_PREFAB_CAPACITY")]
|
||||
[Button("프리팹 초기화")]
|
||||
private void InitCharacterPrefabList()
|
||||
{
|
||||
UnitPrefab = Utils.LoadPrefabFromFolder("Assets/05.Prefabs/Character", "Unit");
|
||||
BaseCharacterPrefab = Utils.LoadPrefabFromFolder("Assets/05.Prefabs/Character", "BaseCharacter");
|
||||
ArrowPrefab = Utils.LoadPrefabFromFolder("Assets/05.Prefabs", "Arrow_01");
|
||||
AIAnimatorControllerList = new List<AnimatorController>(ANIMATOR_CONTROLLER_PREFAB_CAPACITY)
|
||||
{
|
||||
Utils.LoadAnimatorControllerFromFolder("Assets/07.Animation", "Archer"),
|
||||
Utils.LoadAnimatorControllerFromFolder("Assets/07.Animation", "Axeman"),
|
||||
Utils.LoadAnimatorControllerFromFolder("Assets/07.Animation", "SpearKnight"),
|
||||
Utils.LoadAnimatorControllerFromFolder("Assets/07.Animation", "Spearman"),
|
||||
Utils.LoadAnimatorControllerFromFolder("Assets/07.Animation", "SwordKnight"),
|
||||
Utils.LoadAnimatorControllerFromFolder("Assets/07.Animation", "Swordman")
|
||||
};
|
||||
|
||||
characterPrefabList = new List<GameObject>(CHARACTER_PREFAB_CAPACITY)
|
||||
{
|
||||
@ -289,8 +299,8 @@ namespace BlueWaterProject
|
||||
/// </summary>
|
||||
public void CreateUnitInEditor(UnitController unitController)
|
||||
{
|
||||
var unit = DataManager.Inst.GetUnitSoKey(unitController.unit.Idx);
|
||||
|
||||
var unit = DataManager.Inst.GetUnitSoKey(unitController.unit.Idx) ?? DataManager.Inst.GetEnemyUnitSoKey(unitController.unit.Idx);
|
||||
|
||||
SetPlayerUnits();
|
||||
|
||||
unitController.unit = new Unit(unit);
|
||||
|
35
BlueWater/Assets/02.Scripts/Data/So/EnemyUnitDataSo.asset
Normal file
35
BlueWater/Assets/02.Scripts/Data/So/EnemyUnitDataSo.asset
Normal file
@ -0,0 +1,35 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 3cfd6c9178f4c2a48a79549b238ac772, type: 3}
|
||||
m_Name: EnemyUnitDataSo
|
||||
m_EditorClassIdentifier:
|
||||
unitDataList:
|
||||
- <Idx>k__BackingField: unit_archer_e_001
|
||||
<CaptainStatIdx>k__BackingField: ai_stat_captain_e_001
|
||||
<SailorStatIdx>k__BackingField: ai_stat_sailor_e_001
|
||||
<UnitName>k__BackingField: EnemyArcher001
|
||||
<UnitType>k__BackingField: 0
|
||||
<SailorCount>k__BackingField: 5
|
||||
<AttackerType>k__BackingField: -1
|
||||
<OffenseType>k__BackingField: -1
|
||||
<DefenseType>k__BackingField: -1
|
||||
<UnitList>k__BackingField: []
|
||||
- <Idx>k__BackingField: unit_sword_knight_e_001
|
||||
<CaptainStatIdx>k__BackingField: ai_stat_captain_e_004
|
||||
<SailorStatIdx>k__BackingField: ai_stat_sailor_e_004
|
||||
<UnitName>k__BackingField: EnemySwordKnight001
|
||||
<UnitType>k__BackingField: 3
|
||||
<SailorCount>k__BackingField: 3
|
||||
<AttackerType>k__BackingField: -1
|
||||
<OffenseType>k__BackingField: -1
|
||||
<DefenseType>k__BackingField: -1
|
||||
<UnitList>k__BackingField: []
|
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d363ca1023ab0754489bda2d69d79564
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -16,6 +16,9 @@ public class DataManager : Singleton<DataManager>
|
||||
[field: SerializeField] public UnitDataSo UnitDataSo { get; private set; }
|
||||
private Dictionary<string, Unit> unitDictionary;
|
||||
|
||||
[field: SerializeField] public UnitDataSo EnemyUnitDataSo { get; private set; }
|
||||
private Dictionary<string, Unit> enemyUnitDictionary;
|
||||
|
||||
[field: SerializeField] public CardDataSo CardDataSo { get; private set; }
|
||||
private Dictionary<string, Card> cardDictionary;
|
||||
|
||||
@ -71,11 +74,13 @@ public class DataManager : Singleton<DataManager>
|
||||
public AiView GetAiViewDictionaryKey(string idx) => aiViewDictionary[idx] != null ? aiViewDictionary[idx] : null;
|
||||
public AiStat GetAiStatDictionaryKey(string idx) => aiStatDictionary[idx] != null ? aiStatDictionary[idx] : null;
|
||||
public Unit GetUnitDictionaryKey(string idx) => unitDictionary[idx] != null ? unitDictionary[idx] : null;
|
||||
public Unit GetEnemyUnitDictionaryKey(string idx) => enemyUnitDictionary[idx] != null ? enemyUnitDictionary[idx] : null;
|
||||
public Card GetCardDictionaryKey(string idx) => cardDictionary[idx] != null ? cardDictionary[idx] : null;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
public AiView GetAiViewSoKey(string idx) => AiViewDataSo.aiViewDataList.Find(item => item.Idx == idx);
|
||||
public AiStat GetAiStatSoKey(string idx) => AiStatDataSo.aiStatDataList.Find(item => item.Idx == idx);
|
||||
public Unit GetUnitSoKey(string idx) => UnitDataSo.unitDataList.Find(item => item.Idx == idx);
|
||||
public Unit GetEnemyUnitSoKey(string idx) => EnemyUnitDataSo.unitDataList.Find(item => item.Idx == idx);
|
||||
#endif
|
||||
}
|
@ -39,23 +39,31 @@ namespace BlueWaterProject
|
||||
HouseList = new List<Transform>(5);
|
||||
|
||||
var houses = transform.Find("Houses");
|
||||
foreach (Transform house in houses)
|
||||
{
|
||||
if (!house.CompareTag("House") || !house.gameObject.activeSelf) continue;
|
||||
|
||||
var houseInfo = house.GetComponent<HouseInfo>();
|
||||
houseInfo.IslandInfo = this;
|
||||
HouseList.Add(houseInfo.transform);
|
||||
if (houses)
|
||||
{
|
||||
foreach (Transform house in houses)
|
||||
{
|
||||
if (!house.CompareTag("House") || !house.gameObject.activeSelf) continue;
|
||||
|
||||
var houseInfo = house.GetComponent<HouseInfo>();
|
||||
houseInfo.IslandInfo = this;
|
||||
HouseList.Add(houseInfo.transform);
|
||||
}
|
||||
}
|
||||
|
||||
UnitList = new List<UnitController>(20);
|
||||
|
||||
var units = transform.Find("Units");
|
||||
foreach (Transform unit in units)
|
||||
|
||||
if (units)
|
||||
{
|
||||
if (!unit.CompareTag("Unit") || !unit.gameObject.activeSelf) continue;
|
||||
foreach (Transform unit in units)
|
||||
{
|
||||
if (!unit.CompareTag("Unit") || !unit.gameObject.activeSelf) continue;
|
||||
|
||||
UnitList.Add(unit.GetComponent<UnitController>());
|
||||
UnitList.Add(unit.GetComponent<UnitController>());
|
||||
}
|
||||
}
|
||||
|
||||
EnemyList = new List<Transform>(UnitList.Capacity * 16);
|
||||
|
@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Animations;
|
||||
using UnityEngine;
|
||||
using UnityEngine.AI;
|
||||
using UnityEngine.Assertions;
|
||||
@ -121,6 +122,13 @@ namespace BlueWaterProject
|
||||
var prefab = AssetDatabase.LoadAssetAtPath<GameObject>(fullPath);
|
||||
return prefab;
|
||||
}
|
||||
|
||||
public static AnimatorController LoadAnimatorControllerFromFolder(string folderPath, string name)
|
||||
{
|
||||
var fullPath = System.IO.Path.Combine(folderPath, name + ".controller");
|
||||
var prefab = AssetDatabase.LoadAssetAtPath<AnimatorController>(fullPath);
|
||||
return prefab;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user