Ejemplo n.º 1
0
        void ShowPickupItem(object obj)
        {
            float animTime = 0.3f;
            float waitTime = 0.3f;

            if (PickUpItem.Count > 0)
            {
                SoundManager.Instance.PlaySoundEffect("Sound_UIEff_AppraisalFields");
                int showItem = PickUpItem[0];
                PickUpItem.RemoveAt(0);
                SingleRewardItem_V3 newItem = CreatObjectToNGUI.InstantiateObj(SingleRewardItemPrefab, PickupItemTransform).GetComponent <SingleRewardItem_V3>();
                DoForTime.DoFunForTime(0.3f, ShowPickupEffect, null);
                newItem.Init(showItem, 1);
                if (PickupItemObjList.Count >= 3)
                {
                    var removeObj = PickupItemObjList[2];
                    Destroy(removeObj);
                    PickupItemObjList.RemoveAt(2);
                }
                for (int i = 0; i < PickupItemObjList.Count; i++)
                {
                    Vector3 fromPosition = new Vector3(0, 32 * i, 0);
                    Vector3 toPosition   = new Vector3(0, 32 + 32 * i, 0);
                    TweenPosition.Begin(PickupItemObjList[i], animTime, fromPosition, toPosition);
                }
                PickupItemObjList.Insert(0, newItem.gameObject);
                Vector3 newItemFromPos = new Vector3(-138, 0, 0);
                Vector3 newItemToPos   = new Vector3(0, 0, 0);
                TweenPosition.Begin(newItem.gameObject, animTime, newItemFromPos, newItemToPos, PlayGetItemSound);
                DoForTime.DoFunForTime(waitTime, ShowPickupItem, null);
            }
        }
Ejemplo n.º 2
0
        //void ShowGradEffect(object obj)
        //{
        //    CreatObjectToNGUI.InstantiateObj(GradEffectPreafb,CreatGradEffectTransform);
        //    DoForTime.DoFunForTime(1,ShowGetRewardItem,null);
        //}

        void ShowGetRewardItem(object obj)
        {
            SingleRewardItem_V3 getRewardItem = CreatObjectToNGUI.InstantiateObj(SingleRewardItemPrefab, RewardItemTransform).GetComponent <SingleRewardItem_V3>();

            getRewardItem.Init(this.rewardData.RewardItem, this.rewardData.RewardItemNum);
            Vector3 fromScale = new Vector3(2, 2, 2);
            Vector3 toScale   = new Vector3(1, 1, 1);

            TweenScale.Begin(getRewardItem.gameObject, 0.3f, fromScale, toScale, ShowGetRewardEffect);
        }
Ejemplo n.º 3
0
        void WithoutAnimShow()
        {
            SingleRewardItem_V3 getRewardItem = CreatObjectToNGUI.InstantiateObj(SingleRewardItemPrefab, RewardItemTransform).GetComponent <SingleRewardItem_V3>();

            getRewardItem.Init(this.rewardData.RewardItem, this.rewardData.RewardItemNum);
            for (int i = 0; i < 3; i++)
            {
                if (PickUpItem.Count >= i + 1)
                {
                    SingleRewardItem_V3 pickUpItemObj = CreatObjectToNGUI.InstantiateObj(SingleRewardItemPrefab, PickupItemTransform).GetComponent <SingleRewardItem_V3>();
                    pickUpItemObj.Init(PickUpItem[i], 1);
                    pickUpItemObj.transform.localPosition = new Vector3(0, 32 * i, 0);
                }
            }
        }