コード例 #1
0
ファイル: Movement.cs プロジェクト: AD4MANTIS/Stealthy
    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;
    }
コード例 #2
0
 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;
 }
コード例 #3
0
    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)));
        }
    }
コード例 #4
0
    private void OnTriggerEnter(Collider other)
    {
        Player player = other.gameObject.GetComponent <Player>();

        if (player != null)
        {
            NvpEventController.Events(MyEvent.LevelFinish).TriggerEvent(player, null);
            StartCoroutine(Win());
        }
    }
コード例 #5
0
ファイル: Movement.cs プロジェクト: AD4MANTIS/Stealthy
    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;
    }
コード例 #6
0
 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;
     }
 }
コード例 #7
0
 private void OnDestroy()
 {
     NvpEventController.Events(MyEvent.PlayerDies).GameEventHandler -= GameOver;;
 }
コード例 #8
0
 private void OnDisable()
 {
     NvpEventController.Events(MyEvent.PlayerDies).GameEventHandler  += GameOver;
     NvpEventController.Events(MyEvent.LevelFinish).GameEventHandler += WinLevel;
 }
コード例 #9
0
ファイル: Player.cs プロジェクト: AD4MANTIS/Stealthy
 private void OnEnable()
 {
     NvpEventController.Events(MyEvent.OnHitByPlayer).GameEventHandler += Player_GotHit;
 }