Beispiel #1
0
 //成功调用
 public void OnTriggerEnter2D(Collider2D col)
 {
     if (col.tag == "Player")
     {
         Instantiate(effectOfEat, this.transform.position, Quaternion.identity);
         Instantiate(musicOfEat, this.transform.position, Quaternion.identity);
         propUI.AddProp(PropType.Rope);
         Destroy(this.gameObject);
     }
 }
Beispiel #2
0
 void OnTriggerEnter2D(Collider2D col)
 {
     if (isInit == false && col.tag == "Player")
     {
         scriPropUI.AddProp(PropType.Skelon);
         Instantiate(effectOfEat, this.transform.position, Quaternion.identity);
         Instantiate(musicOfEat, this.transform.position, Quaternion.identity);
         Destroy(this.gameObject);
     }
     else if (isInit == true && isHitted == false && col.tag == "Haze")
     {
         isHitted = true;
         roVelo   = new Vector3(0, 0, 0);
         Animator anim = this.GetComponent <Animator>();
         target      = col.GetComponent <HazeControl>();
         transTarget = col.GetComponent <Transform>();
         StartCoroutine("AttackSucc");
     }
 }
Beispiel #3
0
 public void OnTriggerEnter2D(Collider2D col)
 {
     //处在跑道上
     if (isRelease == false && col.tag == "Player")
     {
         Debug.Log("添加保护jfasasdfasf");
         Instantiate(effectOfEat, this.transform.position, Quaternion.identity);
         Instantiate(musicOfEat, this.transform.position, Quaternion.identity);
         propUI.AddProp(PropType.Protected);
         Destroy(this.gameObject);
     }
     else if (isRelease == true)//已经是释放的道具
     {
         switch (col.tag)
         {
         case "Cell":
             Destroy(col.gameObject);
             break;
         }
     }
 }