private void LeaveBox() { boxCollider.enabled = true; NvpEventController.Events(MyEvent.LeaveBox).TriggerEvent(this, null); currentKiste.Interact(gameObject, new BoxInteractEventArgs(transform.position.y * transform.localScale.y, false)); transform.localScale /= boxSmall; currentKiste = null; }
private void OnDisable() { NvpEventController.Events(MyEvent.PlayerSeesEnemy).GameEventHandler -= SoundManager_PlayerSeesEnemy; NvpEventController.Events(MyEvent.EnemySeesPlayer).GameEventHandler -= SoundManager_EnemySeesPlayer; NvpEventController.Events(MyEvent.PlayerDies).GameEventHandler -= SoundManager_PlayerDies; NvpEventController.Events(MyEvent.HideInBox).GameEventHandler -= Play_HideInBox; NvpEventController.Events(MyEvent.LeaveBox).GameEventHandler -= Play_LeaveBox;; NvpEventController.Events(MyEvent.EnemyLostPlayer).GameEventHandler -= Play_LostPlayer; }
private void OnTriggerEnter(Collider other) { Player player = other.gameObject.GetComponent <Player>(); if (player != null) { NvpEventController.Events(MyEvent.OnHitByPlayer).TriggerEvent(this, new EnemyHitEventArgs(this, !movement.state.HasFlag(EnemyMovement.EnemyState.SeesPlayer))); } }
private void OnTriggerEnter(Collider other) { Player player = other.gameObject.GetComponent <Player>(); if (player != null) { NvpEventController.Events(MyEvent.LevelFinish).TriggerEvent(player, null); StartCoroutine(Win()); } }
private void GoInBox(Kiste kiste) { boxCollider.enabled = false; NvpEventController.Events(MyEvent.HideInBox).TriggerEvent(this, null); currentKiste = kiste; kiste.Interact(gameObject, new BoxInteractEventArgs(transform.position.y * transform.localScale.y, true)); transform.localScale *= boxSmall; transform.position = kiste.gameObject.transform.position; }
private void Awake() { if (Instance) { Debug.LogError("More than one Singleton Object"); } else { Instance = this; scene = (Scenes)SceneManager.GetActiveScene().buildIndex; NvpEventController.Events(MyEvent.PlayerDies).GameEventHandler += GameOver; NvpEventController.Events(MyEvent.LevelFinish).GameEventHandler += WinLevel; } }
private void OnDestroy() { NvpEventController.Events(MyEvent.PlayerDies).GameEventHandler -= GameOver;; }
private void OnDisable() { NvpEventController.Events(MyEvent.PlayerDies).GameEventHandler += GameOver; NvpEventController.Events(MyEvent.LevelFinish).GameEventHandler += WinLevel; }
private void OnEnable() { NvpEventController.Events(MyEvent.OnHitByPlayer).GameEventHandler += Player_GotHit; }