コード例 #1
0
    void OnTriggerExit(Collider other)
    {
        if (other.tag.Contains("'Door'"))
        {
            canFlip = false;
        }
        if (other.tag.Contains("'Back'"))
        {
            flipType = doors.Back;
        }
        if (other.tag.Contains("'Ice'"))
        {
            isSliding = false;
        }

        if (other.tag.Contains("'Tele"))
        {
            teleLoc = Vector3.zero;
        }
        if (other.tag.Contains("'Switch'"))
        {
            toggleLink = null;
        }
        if (other.tag.Contains("'Water'"))
        {
            isSwimming = false;
        }
    }
コード例 #2
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        Key key = collision.GetComponent <Key>();

        if (key != null)
        {
            addKey(key.GetKeyType());
            Destroy(key.gameObject);
        }

        doors Doors = collision.GetComponent <doors>();

        if (Doors != null)
        {
            if (Doors.GetKeyType() == Key.KeyType.None)
            {
                Doors.OpenDoor();
            }
            else if (hasKey(Doors.GetKeyType()))
            {
                removeKey(Doors.GetKeyType());
                Doors.OpenDoor();
            }
        }
    }
コード例 #3
0
ファイル: Program.cs プロジェクト: Annushka34/CSharp
 public Door(doors door)
 {
     d = door;
 }