Exemple #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);
            }
        }
    }
Exemple #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();
    }
Exemple #3
0
    public override void WndStart()
    {
        base.WndStart();
        MyHead.BtnRelease.gameObject.SetActive(true);
        ChangeBiaoqing((int)CaptionExpress.idle, true);
        m_currentstate = GodSkillState.Idle;
        if (MyHead.BtnRelease)
        {
            MyHead.BtnRelease.OnPressDownEventHandler += BtnRelease_OnClickEventHandler;
        }

        m_captioninfo        = BlackScienceDC.GetCaption(CmCarbon.GetCaptainID(true));
        MyHead.lblLevel.text = m_captioninfo.m_level1.ToString();
        NGUIUtil.Set2DSprite(MyHead.m_BiaoQingParent, "Textures/role/", m_captioninfo.m_captionid.ToString());

        UISprite[] starSprites = U3DUtil.GetComponentsInChildren <UISprite>(MyHead.StarListParent);

        //NGUIUtil.SetStarLevelNum (starSprites,m_captioninfo.m_star);
        for (int i = 0; i < starSprites.Length; i++)
        {
            if (i >= m_captioninfo.m_star)
            {
                starSprites[i].gameObject.SetActive(false);
            }
        }
        UIGrid grid = MyHead.StarListParent.GetComponent <UIGrid>();

        grid.Reposition();
        if (m_captioninfo.GetGodSkillInfo().m_power2 > 0)
        {
            MyHead.LblDestroyPts.text = m_captioninfo.GetGodSkillInfo().m_power2.ToString();
        }
        else
        {
            MyHead.LblDestroyPts.transform.parent.gameObject.SetActive(false);
        }
    }