示例#1
0
 void OnCollisionExit(Collision col)
 {
     if (col.gameObject.tag == "Slime")
     {
         CollidedWithSlime = false;
         curSlimeSide      = SlimeSide.None;
     }
 }
示例#2
0
    void OnCollisionStay(Collision col)
    {
        if (col.gameObject.tag == "Slime")
        {
            Slime = col.gameObject;

            if (Slime.transform.position.x > Player.Instance.Center.x)
            {
                curSlimeSide = SlimeSide.Right;
            }
            else if (Slime.transform.position.x < Player.Instance.Center.x)
            {
                curSlimeSide = SlimeSide.Left;
            }

            CollidedWithSlime = true;
        }
    }