/// <summary> /// Funzione che inizializza il platform Manager /// </summary> /// <param name="_uiGameplay"></param> public void Init(UI_GameplayManager _uiGameplay) { if (!PlatformContainer) { return; } platforms = new List <IPlatform>(); launchingPlatforms = new List <LaunchingPlatform>(); launchingPlatformsInUse = new List <LaunchingPlatform>(); uiGameplay = _uiGameplay; for (int i = 0; i < PlatformContainer.childCount; i++) { IPlatform _current = PlatformContainer.GetChild(i).GetComponent <IPlatform>(); if (_current != null) { _current.Init(); if (_current is LaunchingPlatform) { launchingPlatforms.Add(_current as LaunchingPlatform); } else { platforms.Add(_current); } } } OnParasite += HandleOnParasite; OnParasiteEnd += HandleOnParasiteEnd; SetCanMove(true); }
public override void Init() { sfxCtrl = GetComponentInChildren <GeneralSoundController>(); platfromColldier = GetComponent <BoxCollider>(); anim = GetComponentInChildren <Animator>(); meshRenderer = GetComponentInChildren <MeshRenderer>(); rangeCollider = GetComponentInChildren <SphereCollider>(); toleranceCtrl = GetComponent <EnemyToleranceController>(); rotationBehaviour = GetComponent <Rotation>(); graphics = GetComponentInChildren <IGraphic>(); if (toleranceCtrl != null) { toleranceCtrl.Init(); } SetObjectState(true); graphics.ChangeTexture(TextureType.Default); Parasite += HandleParasite; LevelManager.OnPlayerDeath += HandleOnPlayerDeath; idleCommandsCtrl.Init(); parasiteCommandCtrl.Init(); idleCommandsCtrl.ToggleButton(false); parasiteCommandCtrl.ToggleButton(false); prevRotation = 90; transform.rotation = Quaternion.Euler(new Vector3(0, 0, prevRotation)); }
private void OnDisable() { if (player != null) { player.OnPlayerMaxHealth -= HandlePlayerMaxHealth; } Parasite -= HandleParasite; LevelManager.OnPlayerDeath -= HandleOnPlayerDeath; }
private void OnDisable() { OnParasite -= HandleOnParasite; OnParasiteEnd -= HandleOnParasiteEnd; }