예제 #1
0
    public void BtnRelease_OnClickEventHandler(UIButton sender)
    {
        if (CombatScheduler.State == CSState.End)
        {
            return;
        }

        /*if (!CheckMana())
         * {
         *      ChangeBiaoqing((int)CaptionExpress.nomana);
         *      return;
         * }*/
        if (m_currentstate == GodSkillState.Click)
        {
            m_currentstate = GodSkillState.Idle;
            Building.ShowAllHp(false);
            ChangeBiaoqing((int)CaptionExpress.idle, true);
            return;
        }
        m_currentstate = GodSkillState.Click;
        Building.ShowAllHp(true);
        ChangeBiaoqing((int)CaptionExpress.click, true);
        DoClick();
#if UNITY_IPHONE || UNITY_ANDROID || UNITY_WP8 || UNITY_BLACKBERRY
        if (Input.touchCount == 1)
        {
            LastPostion = new Vector3(Input.touches[0].position.x, Input.touches[0].position.y, 0);
        }
#endif
        m_MouseDown = true;
        //gunsight.SetActive(true);
        CombatWnd cw = WndManager.FindDialog <CombatWnd>();
        if (cw != null)
        {
            cw.CancelAllFire();
            GodSkill godSkill = CmCarbon.GetGodSkill(true);
            if (godSkill.m_godskill.m_type == 9001)
            {
                cw.Show9001(true);
            }
        }
    }
예제 #2
0
    //取消船长技能
    public void CancelSelect()
    {
        if (m_currentstate == GodSkillState.Click)
        {
            UnDoClick();
            m_currentstate = GodSkillState.Idle;
            Building.ShowAllHp(false);
            ChangeBiaoqing((int)CaptionExpress.idle, true);

            CombatWnd cw = WndManager.FindDialog <CombatWnd>();
            if (cw != null)
            {
                GodSkill godSkill = CmCarbon.GetGodSkill(true);
                if (godSkill.m_godskill.m_type == 9001)
                {
                    cw.Show9001(false);
                }
            }
        }
        CheckMana();
    }
예제 #3
0
    public void ReleaseSkill(MapGrid g, Vector3 pos, Life target = null)
    {
        if (!CheckMana())
        {
            CancelSelect();
            return;
        }
        //Building.ShowAllHp(false);
        GodSkill    godSkill     = CmCarbon.GetGodSkill(true);
        int         selectTarget = godSkill.m_godskill.m_selectTarget;
        List <Life> listSelfLife = new List <Life>();

        switch (selectTarget)
        {
        case 0:    //不需要选择目标
            //NGUIUtil.DebugLog("不需要选择目标");
            break;

        case 1:    //需要己方单位目标
            //NGUIUtil.DebugLog("需要己方单位目标");
            if (target != null)

            {
                listSelfLife.Add(target);
            }
            else
            {
                Life life = SearchSelfNearestTarget(g, godSkill.Camp, 1f);
                listSelfLife.Add(life);
                if (life == null)
                {
                    //NGUIUtil.ShowTipWnd(string.Format("{0} 需要己方单位目标!",godSkill.m_godskill.m_name),1.0f);
                    return;
                }
                else
                {
                    //NGUIUtil.ShowTipWnd(string.Format("{0} 己方单位目标!", life.transform.name), 1.0f);
                }
            }

            break;

        case 2:    //需要敌方单位目标
            //NGUIUtil.DebugLog("需要敌方单位目标");
            break;

        default:
            break;
        }
        m_ReleaseSkill      = true;
        m_ReadyReleaseSkill = false;
        Vector3 vpos = MyHead.Vaule.transform.position;

        vpos.z -= 1;
        GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", "2000581", vpos, MyHead.Vaule.transform.parent);

        iseffecttime = true;
        if (gae != null)
        {
            GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(1f);
            gae.gameObject.AddComponent <SetRenderQueue>();
            ndEffect.m_complete = EffectFinish;
            gae.AddAction(ndEffect);
        }

        if (CSState.Start == CombatScheduler.State)
        {
            CombatScheduler.SetCSState(CSState.Combat);
        }
        godSkill.ListSkillTarget = listSelfLife;
        godSkill.ReleaseGodSkill(g, pos);

        int require = int.Parse(MyHead.RequireMana.text);

        SetRequireMana(godSkill.GetRequireMana());
        CmCarbon.SubGodSkillMana(true, require);
        SetCurMana(CmCarbon.GetGodSkillMana(true));
        UnDoClick();

        CancelSelect();
        //Fire.SetActive(false);
    }