+ Layer Boids, Boid로 분리 + Fish의 로직을 Boids(군집) 알고리즘으로 변경 + 군집에 이펙트를 통해 낚시 가시성 추가 + 테스트용 군집 애니메이션 추가 + Epic Toon EX 에셋의 스크립트 수정 버전 ㄴ ParticleWeapon(Layer 선택, UnityEvent Hit 델리게이트 기능 추가) 사용 + Cannon의 x축 회전 고정 + Cannon이 공격한 Layer에 따른 기능 변경 + DataManager에 PlayerInventory 추가 ㄴ 초창기에 사용한 코딩 삭제 + 초창기에 사용했던 스크립트들 일부 정리
144 lines
5.0 KiB
C#
144 lines
5.0 KiB
C#
// using System.Collections.Generic;
|
|
// using Cinemachine;
|
|
// using Sirenix.OdinInspector;
|
|
// using UnityEngine;
|
|
//
|
|
// // ReSharper disable once CheckNamespace
|
|
// namespace BlueWaterProject
|
|
// {
|
|
// public class IslandInfo : MonoBehaviour
|
|
// {
|
|
// #region Property and variable
|
|
//
|
|
// [field: SerializeField] public string IslandName { get; private set; }
|
|
//
|
|
// [field: SerializeField] public List<Transform> HouseList { get; private set; }
|
|
//
|
|
// [field: SerializeField] public List<Transform> TowerList { get; private set; }
|
|
//
|
|
// [field: SerializeField] public List<EnemyUnit> UnitList { get; private set; }
|
|
//
|
|
// [field: SerializeField] public List<Transform> EnemyList { get; private set; }
|
|
//
|
|
// [field: SerializeField] public List<Transform> ExceptHouseList { get; private set; }
|
|
//
|
|
// [field: SerializeField] public List<Transform> TargetAllList { get; private set; }
|
|
//
|
|
// [field: SerializeField] public CinemachineFreeLook IslandCam { get; private set; }
|
|
//
|
|
// #endregion
|
|
//
|
|
// #region Unity built-in Function
|
|
//
|
|
// private void Awake()
|
|
// {
|
|
// InitIslandInfo();
|
|
// }
|
|
//
|
|
// #endregion
|
|
//
|
|
// #region Custom function
|
|
//
|
|
// [GUIColor(0, 1, 0)]
|
|
// [Button("섬 정보 추출")]
|
|
// private void InitIslandInfo()
|
|
// {
|
|
// HouseList = new List<Transform>(5);
|
|
// var houses = transform.Find("Houses");
|
|
// if (houses && houses.gameObject.activeSelf)
|
|
// {
|
|
// foreach (Transform house in houses)
|
|
// {
|
|
// // if (!house.CompareTag("House") || !house.gameObject.activeSelf) continue;
|
|
// //
|
|
// // var houseInfo = house.GetComponent<HouseInfo>();
|
|
// // houseInfo.SetIslandInfo(this);
|
|
// // HouseList.Add(houseInfo.transform);
|
|
// }
|
|
// }
|
|
//
|
|
// TowerList = new List<Transform>(20);
|
|
// var towers = transform.Find("Towers");
|
|
// if (towers && towers.gameObject.activeSelf)
|
|
// {
|
|
// foreach (Transform tower in towers)
|
|
// {
|
|
// if (!tower.CompareTag("Tower") || !tower.gameObject.activeSelf) continue;
|
|
//
|
|
// var towerAi = tower.GetComponent<TowerAi>();
|
|
// towerAi.SetDefendingIslandInfo(this);
|
|
// TowerList.Add(towerAi.transform);
|
|
// }
|
|
// }
|
|
//
|
|
// UnitList = new List<EnemyUnit>(20);
|
|
// EnemyList = new List<Transform>(UnitList.Capacity * 16);
|
|
// var units = transform.Find("Units");
|
|
// if (units && units.gameObject.activeSelf)
|
|
// {
|
|
// foreach (Transform unit in units)
|
|
// {
|
|
// if (!unit.CompareTag("Unit") || !unit.gameObject.activeSelf) continue;
|
|
//
|
|
// UnitList.Add(unit.GetComponent<EnemyUnit>());
|
|
// }
|
|
//
|
|
// foreach (var unit in UnitList)
|
|
// {
|
|
// foreach (Transform enemy in unit.transform)
|
|
// {
|
|
// if (!enemy.gameObject.activeSelf) continue;
|
|
//
|
|
// var combatAi = enemy.GetComponent<CombatAi>();
|
|
// combatAi.SetDefendingIslandInfo(this);
|
|
// EnemyList.Add(enemy);
|
|
// }
|
|
// }
|
|
// }
|
|
//
|
|
// ExceptHouseList = new List<Transform>(TowerList.Capacity + EnemyList.Capacity);
|
|
// foreach (var enemy in EnemyList)
|
|
// {
|
|
// ExceptHouseList.Add(enemy);
|
|
// }
|
|
//
|
|
// foreach (var tower in TowerList)
|
|
// {
|
|
// ExceptHouseList.Add(tower);
|
|
// }
|
|
//
|
|
// TargetAllList = new List<Transform>(HouseList.Capacity + TowerList.Capacity + EnemyList.Capacity);
|
|
// foreach (var enemy in EnemyList)
|
|
// {
|
|
// TargetAllList.Add(enemy);
|
|
// }
|
|
//
|
|
// foreach (var house in HouseList)
|
|
// {
|
|
// TargetAllList.Add(house);
|
|
// }
|
|
//
|
|
// foreach (var tower in TowerList)
|
|
// {
|
|
// TargetAllList.Add(tower);
|
|
// }
|
|
//
|
|
// IslandCam = transform.Find("IslandCam").GetComponent<CinemachineFreeLook>();
|
|
// }
|
|
//
|
|
// public void RemoveListElement(List<Transform> list, Transform element)
|
|
// {
|
|
// if (list.Contains(element))
|
|
// {
|
|
// list.Remove(element);
|
|
// }
|
|
//
|
|
// if (TargetAllList.Contains(element))
|
|
// {
|
|
// TargetAllList.Remove(element);
|
|
// }
|
|
// }
|
|
//
|
|
// #endregion
|
|
// }
|
|
// } |