示例#1
0
文件: Peak.cs 项目: YRDA/DShalike
 void OnTriggerEnter2D(Collider2D obj)
 {
     // Si colisiono con lava, agua, personaje o SuperBloque
     if (obj.gameObject.name == "PuenteA(Clone)" || obj.gameObject.name == "Lava_inf(Clone)" || obj.gameObject.name == "Lava_sup(Clone)" || obj.gameObject.name == "Agua_inf(Clone)" || obj.gameObject.name == "Agua_sup(Clone)" || obj.gameObject.name == "Shalike" || obj.gameObject.name == "SuperBlock")
     {
         Destroy(this.gameObject); // Autodestruyo el objeto
     }
     else
     {
         if (obj.tag == "Block") // es un bloque?
         {
             palaman.AddBlocks(obj.name);
             Destroy(obj.gameObject);  // destruyo el otro objeto
             Destroy(this.gameObject); // Autodestruyo el objeto
         }
     }
 }