예제 #1
0
    static void DropResourceBoxEffect(string name, sdata.s_itemtypeInfo item, Vector3 pos)
    {
        pos    = BattleEnvironmentM.Local2WorldPos(pos);
        pos.x += 0.5f;
        pos.z  = 0;
        GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", name, EffectCamera.GetEffectPos(pos), BattleEnvironmentM.GetLifeMBornNode(true));

        EffectCamera.AddFollowList(gae.transform, pos);
        if (gae != null)
        {
            //先等待
            GameObjectActionBoxWait gaw = new GameObjectActionBoxWait(2f);
            gae.AddAction(gaw);
            //open box
            GameObjectActionOpenBox gaopen = new GameObjectActionOpenBox(2.0f, item);
            gae.AddAction(gaopen);

            Animator ani = gae.gameObject.GetComponent <Animator>();
            if (null != ani)
            {
                int nValue = (int)Random.value % 2;
                if (nValue == 0)
                {
                    nValue = 2;
                }
                ani.SetInteger("iState", nValue);
            }
        }
    }
예제 #2
0
    public override void ActionUpdate(float deltatime)
    {
        base.ActionUpdate(deltatime);
        if (SkillTarget != null && m_TimeCount <= m_CallBackTime)
        {
            Vector3 pos = SkillTarget.m_thisT.position;
            //pos.z ;
            m_target.transform.position = EffectCamera.GetEffectPos(pos, 40);
        }

        /* if (SkillTarget!=null && m_TimeCount>=m_CallBackTime && m_TimeCount< m_CallBackTime+Time.deltaTime)
         * {
         *   CombatWnd wnd = WndManager.FindDialog<CombatWnd>();
         *   if (wnd)
         *   {
         *
         *       wnd.ShowSkill9001Effect(SkillTarget.SceneID);
         *   }
         * }*/
    }
예제 #3
0
    static void DropResourceEffect(string name, ResourceType t, int num, int count, Vector3 pos)
    {
        pos    = BattleEnvironmentM.Local2WorldPos(pos);
        pos.x -= num / 2f;
        for (int i = 0; i < num; i++)
        {
            int n = (int)count / num;
            if (i == 0)
            {
                n += count - num * ((int)count / num);
            }
            pos.x += 1;            //Random.Range(0,2) == 0 ? - Random.Range(0,0.5f*num):Random.Range(0,0.5f*num);
            pos.z  = 0;
            GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", name, EffectCamera.GetEffectPos(pos), BattleEnvironmentM.GetLifeMBornNode(true));
            //EffectCamera.AddFollowList(gae.transform,pos);
            if (gae != null)
            {
                Random.seed++;
                GameObjectActionResourceDrop gaw = new GameObjectActionResourceDrop(2f, pos, pos + new Vector3(Random.Range(-1.5f, 1.5f), 0, 0));
                gae.AddAction(gaw);
                GameObjectActionResourceFlyToUI gar = new GameObjectActionResourceFlyToUI();
                gar.SetData(EffectCamera.camera, WndManager.GetNGUICamera(), n, t);
                gae.AddAction(gar);

                Animator ani = gae.gameObject.GetComponent <Animator>();
                if (null != ani)
                {
                    int nValue = (int)Random.value % 2;
                    if (nValue == 0)
                    {
                        nValue = 2;
                    }
                    ani.SetInteger("iState", nValue);
                }
            }
        }
    }
예제 #4
0
 public void GoldCoinEffect(int num, int count)
 {
     for (int i = 0; i < num; i++)
     {
         Vector3 pos = MapGrid.GetMG(m_Attr.Pos).pos;            //+new Vector3(Random.Range(1,m_Attr.Size*0.5f-2),-0.5f,1f);
         pos += new Vector3(0, 0.25f, 1.2f);
         pos  = BattleEnvironmentM.Local2WorldPos(pos);
         int n = (int)count / num;
         if (i == 0)
         {
             n += count - num * ((int)count / num);
         }
         GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", "2000041", EffectCamera.GetEffectPos(pos), BattleEnvironmentM.GetLifeMBornNode(true));
         //EffectCamera.AddFollowList(gae.transform,pos);
         if (gae != null)
         {
             GameObjectActionResourceDrop gaw = new GameObjectActionResourceDrop(2f, pos, pos + new Vector3(Random.Range(-1.5f, 1.5f), 0, 0));
             gae.AddAction(gaw);
             GameObjectActionResourceFlyToUI gar = new GameObjectActionResourceFlyToUI();
             gar.SetData(EffectCamera.camera, WndManager.GetNGUICamera(), n, ResourceType.Gold);
             gae.AddAction(gar);
             GameObject coin = U3DUtil.FindChild(gae.gameObject, "coin");
             if (coin != null)
             {
                 coin.GetComponent <ParticleSystem>().startDelay = Random.Range(1f, 1.5f);
             }
         }
     }
 }
예제 #5
0
    public void ReleaseGodSkill(MapGrid g, Vector3 pos)
    {
        m_ReleaseTimes++;
        m_targetg   = g;
        m_targetpos = pos;

        if (m_godskill.m_type == 9000)
        {
            GameObjectActionExcute gae = EffectM.LoadEffect(EffectM.sPath, "1000041_01", EffectCamera.GetEffectPos(pos), BattleEnvironmentM.GetLifeMBornNode(true));
            EffectCamera.AddFollowList(gae.transform, pos);
            //gae.gameObject.transform.localPosition = new Vector3(gae.gameObject.transform.localPosition.x,gae.gameObject.transform.localPosition.y,gae.gameObject.transform.localPosition.z-1f);
            GameObjectActionGodSkill9000 ndEffect = new GameObjectActionGodSkill9000();
            ndEffect.SetData(DoGodSkill, m_godskill.m_blackscreentime);
            //ndEffect.m_complete = DoGodSkill;
            SoundPlay.Play("apocalypse_missile_01", false, false);
            SoundPlay.JoinPlayQueue("apocalypse_missile_02", 0f);
            SoundPlay.JoinPlayQueue("apocalypse_missile_03", 0.0f);
            gae.AddAction(ndEffect);
        }
        else if (m_godskill.m_type == 9001)
        {
            //NGUIUtil.DebugLog("使命召唤表现");


            GameObjectActionExcute       gae      = EffectM.LoadEffect(EffectM.sPath, "1000051_01", EffectCamera.GetEffectPos(pos), BattleEnvironmentM.GetLifeMBornNode(true));
            GameObjectActionGodSkill9001 ndEffect = new GameObjectActionGodSkill9001();
            ndEffect.SetData(DoGodSkill, m_godskill.m_blackscreentime);
            if (m_listSkillTarget.Count > 0)
            {
                Life lifeTarget = m_listSkillTarget[0];
                ndEffect.SkillTarget = lifeTarget;
            }
            SoundPlay.Play("call_of_duty", false, false);
            gae.AddAction(ndEffect);
        }
        else if (m_godskill.m_type == 9002)
        {
            DoGodSkill();
        }
    }
예제 #6
0
 public override void ActionUpdate(float deltatime)
 {
     base.ActionUpdate(deltatime);
     m_target.transform.position = EffectCamera.GetEffectPos(Vector3.Lerp(m_start, m_end, m_TimeCount / 1));
 }