Esempio n. 1
0
    void OnPortalStateChanged(object sender, Nights2TorchPlayer.PortalChangedEventArgs e)
    {
        if (_animator == null)
            return;

        //went through entrance portal
        if (_hasEntrancePortalParam && (e.NewState == Nights2TorchPlayer.PortalState.ThroughEntrancePortal))
        {
            _animator.SetTrigger(PassedEntrancePortalTrigger);
        }

        //went through exit portal
        if (_hasExitPortalParam && (e.NewState == Nights2TorchPlayer.PortalState.ThroughExitPortal))
        {
            _animator.SetTrigger(PassedExitPortalTrigger);
        }
    }
Esempio n. 2
0
 void Awake()
 {
     Instance = this;
 }