コード例 #1
0
    void OnTriggerEnter(Collider otherCollider)
    {
        PartyGuy guy = otherCollider.GetComponent <PartyGuy> ();

        if (guy != null && guy.currentState == PartyGuy.State.Trumping)
        {
            guy.SetState(PartyGuy.State.BeingConverted);
        }
    }
コード例 #2
0
    void OnTriggerExit(Collider otherCollider)
    {
        PartyGuy guy = otherCollider.GetComponent <PartyGuy> ();

        if (guy != null)
        {
            //When he is not fully converted yet, go back to Trumping
            if (guy.currentState == PartyGuy.State.BeingConverted)
            {
                guy.SetState(PartyGuy.State.Trumping);
            }
        }
    }