void OnTriggerEnter()
 {
     if (InSceneLevelSwitcher.Get())
     {
         InSceneLevelSwitcher.Get().SetIndex(m_Index);
     }
 }
Beispiel #2
0
    void OnTriggerEnter(Collider a_Collider)
    {
        ControlledCapsuleCollider controlledCapsuleCollider = a_Collider.GetComponent <ControlledCapsuleCollider>();

        if (controlledCapsuleCollider != null)
        {
            //Prevent death state to be used if the collider is no-clipping
            if (controlledCapsuleCollider.AreCollisionsActive())
            {
                Debug.Log("Death triggered by: " + transform.name);
                if (InSceneLevelSwitcher.Get())
                {
                    InSceneLevelSwitcher.Get().Respawn();
                }
            }
        }
    }