Ejemplo n.º 1
0
    /// <summary>
    /// 碎片飞入碎片商店特效
    /// </summary>
    /// <param name="sourceObj">源目标点</param>
    /// <param name="targetTransform">飞向的目标点节点</param>
    IEnumerator playExChangeShopEffect(Transform sourceTrans, GameObject targetObj, int debrisNumber, CallBack callback)
    {
        Vector3    moveToPos = Vector3.zero;
        GameObject flyItem   = NGUITools.AddChild(flyContentPoint, flyItemPrefab) as GameObject;
        //flyItem.SetActive(true);
        FlyCtrl flyCtrl = flyItem.GetComponent <FlyCtrl>();

        flyCtrl.gameObject.transform.position = targetObj.transform.position + new Vector3(0, 0.3f, 0);
        flyCtrl.Initialize(debrisIconPrefab, moveToPos, targetObj);
        //flyCtrl.overCallBack = (callTargetGameObj) =>
        //{
        //    debrisGetDesc.SetActive(true);
        //    debrisGetText.text = "[FF0000]" + "+";
        //    TweenLabelNumber tln = TweenLabelNumber.Begin(debrisGetValue.gameObject, 0.1f, debrisNumber);
        //    //EventDelegate.Add(tln.onFinished, () =>
        //    //{
        //    //    StartCoroutine(Utils.DelayRun(() =>
        //    //    {
        //    //        debrisGetDesc.SetActive(false);
        //    //        debrisGetValue.text = "0";
        //    //    }, 0.6f));
        //    //}, true);
        //};
        debrisGetDesc.SetActive(false);
        debrisGetValue.text = "0";
        playEffect(debrisNumber);
        yield break;
    }
Ejemplo n.º 2
0
    /// <summary>
    /// 抽取星魂放入猎魂库特效
    /// </summary>
    /// <param name="sourceObj">源目标点</param>
    /// <param name="targetTransform">飞向的目标点节点</param>
    /// <param name="debrisNumber">碎片</param>
    /// <param name="callback">特效完后回调</param>
    IEnumerator playPopHuntStoreEffect(Transform sourceTrans, GameObject[] targetObjs, int debrisNumber, CallBack callback)
    {
        if (targetObjs != null)
        {
            Vector3       moveToPos = Vector3.zero;
            GameObject    targetGameObj;
            EffectManager effectManager = EffectManager.Instance;
            yield return(new WaitForSeconds(0.2f));

            for (int i = 0; i < targetObjs.Length; i++)
            {
                targetGameObj = targetObjs[i];
                if (targetGameObj == null)
                {
                    continue;
                }
                GameObject flyItem = NGUITools.AddChild(flyContentPoint, flyItemPrefab) as GameObject;
                flyItem.SetActive(true);
                FlyCtrl   flyCtrl = flyItem.GetComponent <FlyCtrl>();
                GoodsView view    = targetGameObj.GetComponent <GoodsView> ();
                flyCtrl.gameObject.transform.position = sourceTrans.transform.position;
                flyCtrl.Initialize(view.gameObject, moveToPos, targetGameObj);
                flyCtrl.overCallBack = (callTargetGameObj) => {
                    if (callTargetGameObj != null)
                    {
                        callTargetGameObj.SetActive(true);
                    }
                };
            }
            yield return(new WaitForSeconds(0.3f));

            if (debrisNumber > 0)
            {
                StartCoroutine(playExChangeShopEffect(nebulaHuntEffectPoint.transform, buttonExChangeShop.gameObject, debrisNumber, () => {
                }));
            }
            yield return(new WaitForSeconds(0.3f));

            updateNebulaEffectUI();
            yield return(new WaitForSeconds(0.8f));
        }
        if (callback != null)
        {
            callback();
            callback = null;
        }
        yield break;
    }
Ejemplo n.º 3
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;
     }
 }