示例#1
0
    void OnCollisionEnter2D(Collision2D col)
    {
        ColorOrb co = (ColorOrb)col.gameObject.GetComponent <ColorOrb>();

        if (co)
        {
            mainGame.EatColorOrb(co);
        }
    }
示例#2
0
 public void EatColorOrb(ColorOrb co)
 {
     for (int i = 0; i < backgrounds.Length; i++)
     {
         if (i == selectedBG)
         {
             backgrounds[i].sortingOrder = -99;
         }
         else
         {
             backgrounds[i].sortingOrder = -50;
         }
     }
     answerSet[selectedBG].GetComponent <SpriteRenderer>().color = ColorOrb.colors[co.nColor];
     co.StartCoroutine(co.ColorAnimation());
     //spawnOneColorOrb(co.nColor);
 }