Beispiel #1
0
    public override void padGot()
    {
        Transform child_trans = pad.transform.Find("Prop_magnet_child(Clone)");

        if (child_trans == null)
        {
            Instantiate(child, pad.transform);
        }
        else
        {
            Prop_magnet_child ctrl = child_trans.gameObject.GetComponent <Prop_magnet_child>();
            ctrl.resetLiveTime();
        }
        Destroy(gameObject);
        base.padGot();
    }
 //商品磁铁
 private void event_item_magnet()
 {
     if (Input.GetButton("Use Prop"))
     {
         ShopItem item = (ShopItem)shopController.shopItems[2];
         if (item.soldout && !isMagnetUsed)
         {
             Transform child_trans = pad.transform.Find("Prop_magnet_child(Clone)");
             if (child_trans == null)
             {
                 Instantiate(magnet_child, pad.transform);
             }
             else
             {
                 Prop_magnet_child ctrl = child_trans.gameObject.GetComponent <Prop_magnet_child>();
                 ctrl.resetLiveTime();
             }
             isMagnetUsed = true;
         }
     }
 }