void OnTriggerExit2D(Collider2D cell)
 {
     if (cell.gameObject.name.Equals("France1(Clone)") || cell.gameObject.name.Equals("France2(Clone)"))
     {
         LogicPartController.GetInstance().IsTriggerWall = false;
     }
 }
 void Awake()
 {
     if (instance)
     {
         GGDebug.LogError("======================================Constructor twice!!!===================================");
     }
     instance = this;
     Application.targetFrameRate = 60;
 }
 void OnTriggerEnter2D(Collider2D cell)
 {
     if (cell.gameObject.name.Equals("WallUnit(Clone)"))
     {
         GGDebug.Log("---蛇:-----开始碰撞-------");
         GGDebug.Log(cell.gameObject.name);
         SnakeManage.GetInstance().DelSnakeUnit();
         Destroy(gameObject);
     }
     if (cell.gameObject.name.Equals("France1(Clone)") || cell.gameObject.name.Equals("France2(Clone)"))
     {
         LogicPartController.GetInstance().IsTriggerWall = true;
     }
 }
Esempio n. 4
0
 //销毁一个节点
 public void DelSnakeUnit()
 {
     GGDebug.Log("销毁蛇!!" + mSnakeList.Count);
     if (mSnakeList.Count > 0)
     {
         mSnakeList.RemoveAt(0);
         SetLifeNumText();
     }
     else
     {
         GGDebug.Log("Stop!!!!");
         LogicPartController.GetInstance().isPause = true;
     }
 }