Exemplo n.º 1
0
 void OnCollisionEnter(Collision other) //碰撞一次
 {
     if (other.collider.CompareTag("Wall"))
     {
         if (open && wall != other.transform) //已经冷却且撞到的墙不是刚才的墙
         {
             open = false;
             wall = other.transform;
             dm.AddWall(other.transform);
             Invoke("ColdOpen", 0.2f);
             //PlayerEffect(other.transform); //获取碰撞物体位置播放特效
             am.PlayOpen();
         }
         else
         {
             am.PlayOpend();
         }
     }
     else
     {
         am.PlayOpend();
     }
     DisableObj();
 }