Beispiel #1
0
 public void OnEndDrag(PointerEventData eventData)
 {
     if (food == null || food.State != FoodState.Drag)
     {
         return;
     }
     food.SetEndPosition();
 }
Beispiel #2
0
    private void OnUpdate(float delta)
    {
        if (this.bStart)
        {
            if ((this.currentFrame % 3) == 0)
            {
                if (((this.goodslist == null) || (this.currentindex >= this.goodslist.Count)) || (this.currentindex < 0))
                {
                    if (this.callback != null)
                    {
                        this.callback();
                    }
                    this.bStart = false;
                    return;
                }
                string str = string.Empty;
                switch (this.goodslist[this.currentindex].type)
                {
                case FoodType.eHP:
                case FoodType.eGold:
                case FoodType.eExp:
                    str = this.goodslist[this.currentindex].childtype.ToString();
                    break;

                case FoodType.eEquip:
                {
                    LocalSave.EquipOne data = this.goodslist[this.currentindex].data as LocalSave.EquipOne;
                    str = "1010101";
                    break;
                }
                }
                object[]   args = new object[] { "Game/Food/", str };
                GameObject obj2 = GameLogic.EffectGet(Utils.GetString(args));
                obj2.transform.parent     = this.MapGoodsDrop;
                obj2.transform.position   = new Vector3(this.pos.x, 0f, this.pos.z);
                obj2.transform.localScale = Vector3.one;
                FoodBase component = obj2.GetComponent <FoodBase>();
                component.Init(this.goodslist[this.currentindex].data);
                Vector3 randomEndPosition = this.GetRandomEndPosition(this.Goldslist, this.GoldsCenter);
                component.SetEndPosition(this.pos, randomEndPosition);
                this.currentindex++;
            }
            this.currentFrame++;
        }
    }