void Start() { targetpos = GetComponent <DestinationSetter>(); healthBar.SetMaxHealth(health); healthBar.gameObject.SetActive(false); EnemyList.Add(this); }
public PlayerMovementManager(Player player) { _player = player; _mover = new Mover(_player, _player.DefaultMovementSpeed); _destinationSetter = new DestinationSetter(_player.transform, _mover); _inputProcessor = new InputProcessor(); _playerDashMonitor = new PlayerDashMonitor(); }
private void Start() { for (int i = 0; i < numberOfEntitiesToSpawn; ++i) { GameObject currentInstantiate = Instantiate(prefabToSpawn); DestinationSetter currentDestinationSetter = currentInstantiate.GetComponent <DestinationSetter>(); currentDestinationSetter.destinationA = destinationA; currentDestinationSetter.destinationB = destinationB; currentDestinationSetter.Init(); } }