Example #1
0
    /// <summary>
    /// 初始化
    /// </summary>
    /// <param name="reward">奖励</param>
    /// <param name="isAward">是否领取过</param>
//	public void init (TurnSpriteReward reward, bool isAward)
//	{
//		this.isAward = isAward;
//		CardSample sample = CardSampleManager.Instance.getRoleSampleBySid (reward.sid);
//		front.init (sample, null, null);
//		numLabel.text = "x" + reward.num.ToString ();
//	}

    public void init(TurnSpriteReward reward, bool isAward)
    {
        this.isAward = isAward;
        _front.clean();
        if (reward.type == "card")
        {
            CardSample sample = CardSampleManager.Instance.getRoleSampleBySid(reward.sid);
            front.gameObject.SetActive(true);
            front.init(sample, null, null);
            numLabel.text = "x" + reward.num.ToString();
        }
        else if (reward.type == "euip")
        {
            PrizeSample sample = new PrizeSample(PrizeType.PRIZE_EQUIPMENT, reward.sid, reward.num);
            _front.init(sample, true);
            numLabel.text = "x" + reward.num.ToString();
        }
        else if (reward.type == "goods")
        {
            PrizeSample sample = new PrizeSample(PrizeType.PRIZE_PROP, reward.sid, reward.num);
            _front.gameObject.SetActive(true);
            _front.init(sample, true);
            numLabel.text = "x" + reward.num.ToString();
        }
//		else if(reward.type == "starsoul") {
//
//			PrizeSample sample = new PrizeSample(PrizeType.PRIZE_STARSOUL,reward.sid,reward.num);
//			_front.init (sample);
//			numLabel.text = "x" + reward.num.ToString ();
//		}
    }
Example #2
0
 /// <summary>
 /// 拾取星魂特效
 /// </summary>
 /// <param name="nodeNames">播放特效的节点名列表</param>
 /// <param name="targetGameObj">飞行目标对象</param>
 /// <param name="callback">特效完后回调</param>
 IEnumerator playPopStoreEffect(GameObject[] nodeObjs, GameObject targetGameObj, CallBack callback)
 {
     if (nodeObjs != null)
     {
         Vector3       moveToPos = new Vector3(0, -0.1f, 0);
         GameObject    childGameObj;
         EffectManager effectManager = EffectManager.Instance;
         for (int i = 0; i < nodeObjs.Length; i++)
         {
             childGameObj = nodeObjs[i];
             if (childGameObj == null)
             {
                 continue;
             }
             GameObject flyItem = NGUITools.AddChild(flyContentPoint, flyItemPrefab) as GameObject;
             FlyCtrl    flyCtrl = flyItem.GetComponent <FlyCtrl>();
             GoodsView  view    = childGameObj.GetComponent <GoodsView> ();
             effectManager.CreateEffect(childGameObj.transform, "Effect/UiEffect/SummonBeast2");
             flyCtrl.gameObject.transform.position = childGameObj.transform.position;
             flyCtrl.gameObject.SetActive(true);
             flyCtrl.Initialize(view.gameObject, moveToPos, targetGameObj);
             flyCtrl.overCallBack = (callTargetGameObj) => {
                 if (callTargetGameObj.transform.childCount == 0)
                 {
                     effectManager.CreateEffect(callTargetGameObj.transform, "Effect/UiEffect/WeakFlare");
                 }
             };
             GameObject.Destroy(childGameObj);
             view.clean();
         }
         yield return(new WaitForSeconds(1.4f));
     }
     if (callback != null)
     {
         callback();
         callback = null;
     }
 }