Example #1
0
    void DropToTrash()
    {
        IsTouchable = false;
        IsFree      = true;
        Game2Global.Spawning();
        //release package
        package.transform.parent = null;
        package.GetComponent <Renderer>().sortingOrder = -5;
        package.gameObject.AddComponent <Rigidbody2D>();
        package.GetComponent <Rigidbody2D>().gravityScale = 1.0f;
//		foodList.Remove(this);
        Game2Global.ReturnFlag(gda.GDAFlag);
        Game2Global.ReturnExtraToken(extraToken);
        if ((gda != null) && (gda.gameObject != null))
        {
            Destroy(gda.gameObject);
        }
        IsMoving = true;
    }
Example #2
0
 void PigEating()
 {
     IsTouchable = false;
     IsFree      = true;
     Game2Global.Spawning();
     //release package
     package.transform.parent = null;
     package.GetComponent <Renderer>().sortingOrder = -5;
     //		foodList.Remove(this);
     Game2Global.PigEating(gda.GDAFlag);
     Game2Global.ReturnFlag(gda.GDAFlag);
     Game2Global.ReturnExtraToken(extraToken);
     if ((gda != null) && (gda.gameObject != null))
     {
         Destroy(gda.gameObject);
     }
     //play package move to Position
     package.Eat();
     IsMoving = true;
 }