void Start() { _cameraXPosition = _width * 0.5f - _tileSize * 0.5f; _cameraZPosition = _height * 0.5f - _tileSize * 0.5f; _cameraYPosition = 10.0f; _cameraForward = new Vector3(0, -1, 0); _cameraUp = new Vector3(0, 0, 1); _camera = Camera.main; _camera.transform.position = new Vector3(_cameraXPosition, _cameraYPosition, _cameraZPosition); _camera.transform.rotation = Quaternion.LookRotation(_cameraForward, _cameraUp); _grid = new Script_Grid(); _grid.InstantiateGrid(10, 10, 0); _friendlyList = new List <Script_IEntity> (); _enemyList = new List <Script_IEntity> (); _projectileList = new List <Script_IProjectile>(); _visualEffectsList = new List <Script_IVisual> (); _damageDealer = new Script_DamageDealer(this, _grid, new Vector3Int(6, 0, 5)); _friendlyList.Add(_damageDealer); _healer = new Script_Healer(this, _grid, new Vector3Int(4, 0, 5)); _friendlyList.Add(_healer); _tank = new Script_Tank(this, _grid, new Vector3Int(5, 0, 5)); _friendlyList.Add(_tank); _tank.InitializeBehaviourTree(); _healer.InitializeBehaviourTree(); _damageDealer.InitializeBehaviourTree(); _enemySpawner = new Script_EnemySpawner(this, _grid); }
public void RemoveDps(Script_IEntity p_entity) { _friendlyList.Remove(p_entity); p_entity = null; _damageDealer = null; }