Пример #1
0
    public override void Start()
    {
        base.Start();
        if (m_type == ResourceType.Wood)
        {
            SoundPlay.Play("battle_wood_pick", false, false);
        }
        else if (m_type == ResourceType.Gold)
        {
            SoundPlay.Play("gold", false, false);
        }

        //m_fShowEffectCounter = 0.4f;
        Vector3       pos = Vector3.zero;
        CombatInfoWnd Wnd = WndManager.FindDialog <CombatInfoWnd>();

        if (Wnd != null)
        {
            pos = m_uicamera.WorldToViewportPoint(Wnd.GetResourcePos(m_type).position);
        }
        pos.z = 20;//Mathf.Abs(m_target.transform.position.z - m_gameCamera.transform.position.z) * 0.5f;
        pos   = m_gameCamera.ViewportToWorldPoint(pos);
        m_end = m_gameCamera.transform.InverseTransformPoint(pos);
        m_target.transform.parent = m_gameCamera.transform;
        m_start = m_target.transform.localPosition;
        m_target.transform.localScale = Vector3.one;
        EffectCamera.RemoveFollowList(m_target.transform);
    }
Пример #2
0
    void JoinCombat()
    {
        MainCameraM.s_Instance.EnableDrag(true);
        WndManager.DestoryDialog <SelectSoldierwnd>();

        CombatInfoWnd wndInfo = WndManager.GetDialog <CombatInfoWnd>();

        if (wndInfo != null)
        {
            wndInfo.SetWndMode(CombatInfoMode.combat);
        }

        CombatWnd wnd = WndManager.GetDialog <CombatWnd>();

        if (wnd != null)
        {
            wnd.InitSoldierUI();
        }

        if (m_SelectedBlackScienceCaptainID != 0)       //黑科技设置
        {
            CmCarbon.AddGodSkill(true, m_SelectedBlackScienceCaptainID, ConfigM.GetInitMana());

            GodSkillWnd gsw = WndManager.GetDialog <GodSkillWnd>();
            if (gsw != null)
            {
                gsw.SetCurMana(CmCarbon.GetGodSkillMana(true));
                gsw.SetRequireMana(CmCarbon.GetGodSkill(true).GetRequireMana());
            }
        }

        CombatScheduler.SetCSState(CSState.Combat);
    }
Пример #3
0
 public override void Finish()
 {
     base.Finish();
     if (m_type == ResourceType.Gold)
     {
         //SoundPlay.Play("gold", false, false);
         CombatInfoWnd Wnd = WndManager.FindDialog <CombatInfoWnd>();
         if (Wnd != null)
         {
             Wnd.SetCombatGold(m_count, true);
             Wnd.SetCombatGold(-m_count, false);
         }
     }
     else if (m_type == ResourceType.Wood)
     {
         //SoundPlay.Play("battle_wood_pick", false, false);
         CombatInfoWnd Wnd = WndManager.FindDialog <CombatInfoWnd>();
         if (Wnd != null)
         {
             Wnd.SetCombatWood(m_count, true);
             Wnd.SetCombatWood(-m_count, false);
         }
     }
     else if (m_type == ResourceType.Box)
     {
         //SoundPlay.Play("battle_wood_pick", false, false);
         CombatInfoWnd Wnd = WndManager.FindDialog <CombatInfoWnd>();
         if (Wnd != null)
         {
             Wnd.SetCombatItem();
         }
     }
     GameObject.Destroy(m_target);
 }
Пример #4
0
    public void FlyToUI()
    {
        m_fShowEffectCounter = 0.6f;
        Vector3       pos = Vector3.zero;
        CombatInfoWnd Wnd = WndManager.FindDialog <CombatInfoWnd>();

        if (Wnd != null)
        {
            if (m_type == ResourceType.Gold)
            {
                pos = m_uicamera.WorldToViewportPoint(Wnd.GetResourcePos(m_type).position);
            }
            else if (m_type == ResourceType.Wood)
            {
                pos = m_uicamera.WorldToViewportPoint(Wnd.GetResourcePos(m_type).position);
            }
        }
        pos.z -= m_gameCamera.transform.position.z / 2;


        pos = m_gameCamera.ViewportToWorldPoint(pos);
        //str += "," + pos;
        pos = m_gameCamera.transform.InverseTransformPoint(pos);
        //pos.y -= 0.5f;
        transform.parent = m_gameCamera.transform;
        //	Debug.Log(str);
        gameObject.transform.DOMove(pos, 1f);
        //Debug.DrawLine(transform.position,pos);
    }
Пример #5
0
 void SetEffect()
 {
     if (m_type == ResourceType.Gold)
     {
         CombatInfoWnd Wnd = WndManager.FindDialog <CombatInfoWnd>();
         if (Wnd != null)
         {
             Transform parent           = Wnd.GetResourcePos(m_type);
             GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", "2000301", parent.position, parent);
             if (gae != null)
             {
                 GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(0.5f);
                 gae.AddAction(ndEffect);
             }
         }
     }
     else if (m_type == ResourceType.Wood)
     {
         CombatInfoWnd Wnd = WndManager.FindDialog <CombatInfoWnd>();
         if (Wnd != null)
         {
             Transform parent           = Wnd.GetResourcePos(m_type);
             GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", "2000311", parent.position, parent);
             if (gae != null)
             {
                 GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(0.5f);
                 gae.AddAction(ndEffect);
             }
         }
     }
 }
Пример #6
0
    void HideMoneyEffect()
    {
        CombatInfoWnd wnd = WndManager.FindDialog <CombatInfoWnd>();

        if (wnd)
        {
            wnd.HideMoneyEffect();
        }
    }
Пример #7
0
    void SetEffect()
    {
        CombatInfoWnd Wnd = WndManager.FindDialog <CombatInfoWnd>();

        if (Wnd != null)
        {
            Wnd.PlayResourceAni(m_type);
        }

        /* if (m_type == ResourceType.Gold)
         * {
         *   CombatInfoWnd Wnd = WndManager.FindDialog<CombatInfoWnd>();
         *   if (Wnd != null)
         *   {
         *       Transform parent = Wnd.GetResourcePos(m_type);
         *       GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", "2000301", parent.position, parent);
         *       if (gae != null)
         *       {
         *           GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(0.5f);
         *           gae.AddAction(ndEffect);
         *       }
         *   }
         * }
         * else if (m_type == ResourceType.Wood)
         * {
         *   CombatInfoWnd Wnd = WndManager.FindDialog<CombatInfoWnd>();
         *   if (Wnd != null)
         *   {
         *       Transform parent = Wnd.GetResourcePos(m_type);
         *       GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", "2000311", parent.position, parent);
         *       if (gae != null)
         *       {
         *           GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(0.5f);
         *           gae.AddAction(ndEffect);
         *       }
         *   }
         *
         * }
         * else if (m_type == ResourceType.Box)
         * {
         *   CombatInfoWnd Wnd = WndManager.FindDialog<CombatInfoWnd>();
         *   if (Wnd != null)
         *   {
         *       Transform parent = Wnd.GetResourcePos(m_type);
         *       GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", "2000481", parent.position, parent);
         *       if (gae != null)
         *       {
         *           GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(0.5f);
         *           gae.AddAction(ndEffect);
         *       }
         *   }
         *
         * }*/
        //分支
        //Destroy();
    }
Пример #8
0
    public override void BuildUI()
    {
        Life.Environment = LifeEnvironment.Combat;
        CombatScheduler.SetCSState(CSState.Ready);

        if (BattleEnvironmentM.GetBattleEnvironmentMode() == BattleEnvironmentMode.CombatPVE)
        {
            if (StageDC.GetPveMode() == PVEMode.Attack)
            {
                WndManager.GetDialog <SelectSoldierwnd>();
                BattleEnvironmentM.BuildScene();
            }
            else
            {
                BattleEnvironmentM.BuildScene();
                WndManager.GetDialog <CombatWnd>();
                CombatInfoWnd wnd = WndManager.GetDialog <CombatInfoWnd>();
                if (wnd != null)
                {
                    wnd.SetWndMode(CombatInfoMode.combat);
                }
                if (CmCarbon.GetGodSkill(StageDC.GetPveMode() == PVEMode.Attack) != null)
                {
                    //船长技能设置
                    GodSkillWnd gsw = WndManager.GetDialog <GodSkillWnd>();
                    if (gsw != null)
                    {
                        gsw.SetCurMana(CmCarbon.GetGodSkillMana(true));
                        gsw.SetRequireMana(CmCarbon.GetGodSkill(true).GetRequireMana());
                    }
                }
                //
            }
        }
        else
        {
            WndManager.GetDialog <CombatWnd>();
            WndManager.GetDialog <CombatCountDownWnd>();
            CombatInfoWnd wnd = WndManager.GetDialog <CombatInfoWnd>();
            if (wnd != null)
            {
                wnd.SetWndMode(CombatInfoMode.view);
            }
            BattleEnvironmentM.BuildScene();
        }
        BattleEnvironmentM.AddFireSoldierCompent();

        Screen.sleepTimeout    = SleepTimeout.NeverSleep;//prevent  phone from going to sleep
        m_oldUserInfo.Level    = UserDC.GetLevel();
        m_oldUserInfo.Physical = UserDC.GetPhysical();
    }
Пример #9
0
    /// <summary>
    /// 服务端通知战斗结果信息
    /// </summary>
    void ShowCombatEnd(int nErrorCode)
    {
        CombatInfoWnd wndCombatInfo = WndManager.GetDialog <CombatInfoWnd>();

        wndCombatInfo.HidePauseButton();
        bool win = false;

        CheckLevelUp(0);


        win = StageDC.GetStageResult().win;
        PlayCombatEndAnimation(win);
        BSC.AntiAllRegisterHooks();

        ShipBomb(win);
    }
Пример #10
0
 public void Back(UIButton sender)
 {
     BSC.AntiAllRegisterHooks();
     if (BattleEnvironmentM.GetBattleEnvironmentMode() == BattleEnvironmentMode.CombatPVE)
     {
         SceneM.Load(ViewStageScene.GetSceneName(), false, null, false);
     }
     else
     {
         WndManager.DestoryDialog <SelectSoldierwnd>();
         WndManager.DestoryDialog <CombatWnd>();
         CombatInfoWnd wnd = WndManager.GetDialog <CombatInfoWnd>();
         if (wnd != null)
         {
             wnd.SetWndMode(CombatInfoMode.view);
         }
         WndManager.GetDialog <CombatCountDownWnd>();
         MainCameraM.s_Instance.EnableDrag(true);
     }
 }
Пример #11
0
    public override void BeforeDead()
    {
        int loss = CmCarbon.DefenderInfo.Coin - CmCarbon.GetWinGold();

        CmCarbon.SetAddWinGold(loss);
        CombatInfoWnd Wnd = WndManager.FindDialog <CombatInfoWnd>();

        if (Wnd != null)
        {
            Wnd.SetCombatGold(loss, true);
            Wnd.SetCombatGold(-loss, false);
        }
        GameObjectActionExcute gae = m_thisT.gameObject.AddComponent <GameObjectActionExcute>();

        for (int i = 0; i < 4; i++)
        {
            GameObjectActionWait gaw = new GameObjectActionWait(0.5f);
            gaw.m_complete = BombCall;
            gae.AddAction(gaw);
        }
        base.BeforeDead();
    }
Пример #12
0
    void Destroy()
    {
        if (m_type == ResourceType.Gold)
        {
            //SoundPlay.Play("gold", false, false);
            CombatInfoWnd Wnd = WndManager.FindDialog <CombatInfoWnd>();
            if (Wnd != null)
            {
                Wnd.SetCombatGold(m_count, true);
                Wnd.SetCombatGold(-m_count, false);
            }
        }
        else if (m_type == ResourceType.Wood)
        {
//            SoundPlay.Play("battle_wood_pick", false, false);
            CombatInfoWnd Wnd = WndManager.FindDialog <CombatInfoWnd>();
            if (Wnd != null)
            {
                Wnd.SetCombatWood(m_count, true);
                Wnd.SetCombatWood(-m_count, false);
            }
        }
        Destroy(gameObject);
    }