示例#1
0
    // 播放动画
    public void PlayStageAnimation(ENSTAGE stage)
    {
        string animationName = "";

        switch (stage)
        {
        case ENSTAGE.enStage1:
            animationName = "ui-summary-00";
            break;

        case ENSTAGE.enStage2:
            animationName = "ui-summary-01";
            break;

        case ENSTAGE.enStage3:
            animationName = "ui-summary-02";
            m_tick        = true;
            break;
        }

        SetAnimationSpeed(animationName, 1.0f);
        if (null != WindowRoot)
        {
            this.WindowRoot.GetComponent <Animation>().Play(animationName);
        }


        AnimationClip clip = WindowRoot.GetComponent <Animation>().GetClip(animationName);

        MainGame.Singleton.StartCoroutine(CoroutineAnimationEnd(++m_currentCorroutineIndex, clip.length, (ENSTAGE)(stage + 1)));
    }
示例#2
0
 public override void OnInit()
 {
     base.OnInit();
     AddPropChangedNotify((int)MVCPropertyID.enBattlePropsManager, OnPropertyChanged);
     m_sprite = FindChildComponent <UISprite>("MultiKillWord");
     m_anim   = WindowRoot.GetComponent <Animation>();
 }
 // 播放 变成小图的动画
 void OnShowSmallCard(GameObject obj)
 {
     if (WindowRoot.GetComponent <Animation>().IsPlaying("UI-cardScaleMax-01"))
     {
         return;
     }
     WindowRoot.GetComponent <Animation>().Play("UI-cardScaleMax-01");
 }
示例#4
0
    public override void OnInit()
    {
        base.OnInit();
        AddPropChangedNotify((int)MVCPropertyID.enBattlePropsManager, OnPropertyChanged);

        m_labelNumber = FindChildComponent <UILabel>("ComboNumber");
        m_anim        = WindowRoot.GetComponent <Animation>();
    }
示例#5
0
 public override void OnInit()
 {
     base.OnInit();
     AddPropChangedNotify((int)MVCPropertyID.enTipMessageBox, OnPropertyChanged);
     m_anim     = WindowRoot.GetComponent <Animation>();
     m_panel    = WindowRoot.GetComponent <UIPanel>();
     m_clipTime = m_anim.GetClip("TipMessageBox").length;
 }
示例#6
0
    public override void OnInit()
    {
        base.OnInit();

        m_spriteSucc = FindChildComponent <UISprite>("qtedone");
        m_spriteFail = FindChildComponent <UISprite>("qtefailed");
        m_anim       = WindowRoot.GetComponent <Animation>();
        Reset();
    }
示例#7
0
    //拥有原地复活次数
//     public void OnOrigialFunc()
//     {
//         if (CanRetLayerResurrection())
//         {
//             if (m_resurrectionUnLimited)
//             {
//                 //有复活次数限制,显示复活剩余次数
//                 //如果复活剩余次数为0,原地复活按钮为灰
//             }
//             m_selectObj.SetActive(true);
//         }
//         else
//         {
//             UICommonMsgBoxCfg boxCfg = WindowRoot.GetComponent<UICommonMsgBoxCfg>();
//             UICommonMsgBox.GetInstance().ShowMsgBox(OnButtonOrigial, OnButtonNo, boxCfg);
//         }
//
//     }
//     public void ExecuteOrigial()
//     {
//         IResult r = BattleFactory.Singleton.CreateResult(ENResult.Relive, (int)EnMyPlayers.enChief, (int)EnMyPlayers.enChief);
//         if (r != null)
//         {
//             r.ResultExpr(null);
//             BattleFactory.Singleton.GetBattleContext().CreateResultControl().DispatchResult(r);
//         }
//         if (Team.Singleton.Deputy != null)
//         {
//             r = BattleFactory.Singleton.CreateResult(ENResult.Relive, (int)EnMyPlayers.enDeputy, (int)EnMyPlayers.enDeputy);
//             if (r != null)
//             {
//                 r.ResultExpr(null);
//                 BattleFactory.Singleton.GetBattleContext().CreateResultControl().DispatchResult(r);
//             }
//         }
//         HideWindow();
//         ++BattleArena.Singleton.ReliveCount;
//     }
//-------------------------------------------------------------
    public void OnButtonCacel(object sender, EventArgs e)
    {
        //BattleSummary.Singleton.OnFinished(false);
        //HideWindow();
        m_selectObj.SetActive(false);
        m_choiceLayerObj.SetActive(false);
        UICommonMsgBoxCfg boxCfg = WindowRoot.GetComponent <UICommonMsgBoxCfg>();

        UICommonMsgBox.GetInstance().ShowMsgBox(OnButtonYes, OnButtonNo, boxCfg);
    }
示例#8
0
    public void SetAnchors(Transform transform)
    {
        UILabel pointLable = WindowRoot.GetComponent <UILabel>();

        pointLable.rightAnchor.target  = transform;
        pointLable.leftAnchor.target   = transform;
        pointLable.bottomAnchor.target = transform;
        pointLable.topAnchor.target    = transform;

        WindowRoot.transform.parent = transform;
    }
示例#9
0
    public override void AttachEvent()
    {
        base.AttachEvent();
        AddChildMouseClickEvent("Skill1", OnButtonSkill1Clicked);
        AddChildMouseClickEvent("Skill2", OnButtonSkill2Clicked);
        AddChildMouseClickEvent("Skill3", OnButtonSkill3Clicked);
        AddChildMouseClickEvent("Skill4", OnButtonSkill4Clicked);
        AddChildMouseClickEvent("Skill5", OnButtonSkill5Clicked);
        AddChildMouseClickEvent("Skill6", OnButtonSkill6Clicked);
        AddChildMouseClickEvent("AddLevel2", OnButtonAddLevel2Clicked);
        AddChildMouseClickEvent("AddLevel3", OnButtonAddLevel3Clicked);
        AddChildMouseClickEvent("AddLevel4", OnButtonAddLevel4Clicked);
        AddChildMouseClickEvent("AddLevel5", OnButtonAddLevel5Clicked);
        AddChildMouseClickEvent("AddLevel6", OnButtonAddLevel6Clicked);
        AddChildMouseClickEvent("ActorLevelButton", OnButtOnAddActorLevel);

        AddChildMouseLongPressEvent("Skill1", OnButtonLongSkill1Clicked);
        AddChildMouseLongPressEvent("Skill2", OnButtonLongSkill2Clicked);
        AddChildMouseLongPressEvent("Skill3", OnButtonLongSkill3Clicked);
        AddChildMouseLongPressEvent("Skill4", OnButtonLongSkill4Clicked);
        AddChildMouseLongPressEvent("Skill5", OnButtonLongSkill5Clicked);
        AddChildMouseLongPressEvent("Skill6", OnButtonLongSkill6Clicked);

        AddChildMouseClickEvent("AutoAttack", OnButtonMarkAutoAttackClicked);
        AddChildMouseClickEvent("changeTarget", OnButtonChangeTargetClicked);
        AddChildMouseClickEvent("Return", OnButtonChangeSkillClicked);
        AddChildMouseClickEvent("AddComboBtn", OnButtonAddComboClicked);
        UpdateMarkState();

        JoystickWrap joystick = WindowRoot.GetComponent <JoystickWrap>();

        if (joystick != null)
        {
            if (joystick.m_axisMapping != null && joystick.m_axisMapping.Count > 0)
            {
                joystick.m_axisMapping[0].m_axisEvent += OnMoveClicked;
            }
            if (joystick.m_mapping != null)
            {
                for (int i = 0; i < joystick.m_mapping.Count; i++)
                {
                    if (joystick.m_mapping[i].m_name == "Scroll")
                    {
                        joystick.m_mapping[i].m_keyEvent += OnScrollClicked;
                    }
                    if (joystick.m_mapping[i].m_name == "SwitchActor")
                    {
                        joystick.m_mapping[i].m_keyEvent += SwitchActor;
                    }
                }
            }
        }
    }
示例#10
0
    public Coroutine StartCoroutine(IEnumerator routine)
    {
        if (WindowRoot == null)
        {
            return(null);
        }
        DelegateCoroutine mono = WindowRoot.GetComponent <DelegateCoroutine>();

        if (mono == null)
        {
            mono = WindowRoot.AddComponent <DelegateCoroutine>();
        }
        return(mono.StartCoroutine(routine));
    }
示例#11
0
    public void Update(int skillId)
    {
        CSItem card = CardBag.Singleton.m_cardForDetail;

        if (card == null)
        {
            return;
        }

        SkillInfo skillInfo = GameTable.SkillTableAsset.Lookup(skillId);

        if (null == skillInfo)
        {
            return;
        }
        IconInfomation iconInfo = GameTable.IconInfoTableAsset.Lookup(skillInfo.Icon);

        WindowRoot.GetComponent <UITexture>().mainTexture = PoolManager.Singleton.LoadIcon <Texture>(iconInfo.dirName);


        // 身上是否有此技能

        m_lock.SetActive(!card.HaveSkill(skillId));


        int frameIconId = 0;

        // 是否是 切入技
        if (card.IsSwitchSkill(skillId))
        {
            frameIconId = (int)ENWorldParamIndex.enCardDetailSpecilSkillFrame;
        }
        else
        {
            frameIconId = (int)ENWorldParamIndex.enCardDetailSkillFrame;
        }

        WorldParamInfo worldInfo = GameTable.WorldParamTableAsset.Lookup(frameIconId);

        if (worldInfo != null)
        {
            iconInfo            = GameTable.IconInfoTableAsset.Lookup(worldInfo.IntTypeValue);
            m_frame.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(iconInfo.dirName);
        }

        m_param.m_id = skillId;
    }
示例#12
0
    public override void OnUpdate()
    {
        Actor actor = ActorManager.Singleton.Lookup(m_sobId);

        if (actor == null || actor.CenterPart == null)
        {
            HideWindow();
            return;
        }

        float zoomInScale = Map.Singleton.m_zoomInScale;
        float LBPosx      = SM.RandomRoomLevel.Singleton.mLBPos.x;
        float LBPosz      = SM.RandomRoomLevel.Singleton.mLBPos.z;

        WindowRoot.GetComponent <UILabel>().leftAnchor.absolute   = (int)((actor.CenterPart.transform.position.x - LBPosx) * zoomInScale) * 2;
        WindowRoot.GetComponent <UILabel>().bottomAnchor.absolute = (int)((actor.CenterPart.transform.position.z - LBPosz) * zoomInScale) * 2;
    }
示例#13
0
    // 自动翻滚 [8/3/2015 tgame]
    public void OnScrollClicked(JoystickWrap.JoystickKeyMapping k)
    {
        Vector3      f        = m_mainPlayer.MainObj.transform.forward;
        JoystickWrap joystick = WindowRoot.GetComponent <JoystickWrap>();

        if (joystick.m_axisMapping != null && joystick.m_axisMapping.Count > 0)
        {
            JoystickWrap.JoystickAxisMapping axis = joystick.m_axisMapping[0];
            if (axis.GetVector3D().sqrMagnitude > 0.01f)
            {
                f = axis.GetVector3D() * 5.0f;
            }
        }

        f = m_mainPlayer.MainPos + f * 3.0f;
        m_mainPlayer.CurrentCmd = new MainPlayer.Cmd(f, Player.ENCmdType.enRoll);
    }
示例#14
0
    public override void OnInit()
    {
        base.OnInit();

        AddPropChangedNotify((int)MVCPropertyID.enBattlePropsManager, OnPropertyChanged);
        mEventScript = WindowRoot.GetComponent("UIControlRealTimeEvent") as UIControlRealTimeEvent;
        UIRoot root = GameObject.FindObjectOfType <UIRoot>();

        if (null != root)
        {
            float    s      = (float)root.activeHeight / Screen.height;
            int      height = Mathf.CeilToInt(Screen.height * s);
            int      width  = Mathf.CeilToInt(Screen.width * s);
            UIWidget widget = WindowRoot.GetComponent <UIWidget>();
            UISprite sprite = widget as UISprite;
            sprite.width  = width;
            sprite.height = height;
        }
    }
示例#15
0
    void UpdateInfo()
    {
        FloorInfo info = GameTable.FloorInfoTableAsset.LookUp(StageMenu.Singleton.m_curFloorId);

        if (null == info)
        {
            Debug.Log("UIBattleSummary UpdateInfo FloorInfo info==null BattleSu mmary.Singleton.m_floorId=" + StageMenu.Singleton.m_curFloorId);
            return;
        }
        m_floorName.text = info.m_name;


        m_maxCombo.text    = BattleSummary.Singleton.m_maxComboCount.ToString();
        m_reliveCount.text = BattleSummary.Singleton.m_reliveCount.ToString();
        m_bossKilled.text  = BattleSummary.Singleton.m_killBossCount.ToString();
        m_elapsedTime.text = BattleSummary.Singleton.GetPassStageTime();


        int killedBossScore  = BattleSummary.Singleton.GetKilledBossScore();
        int elapsedTimeScore = BattleSummary.Singleton.GetElapsedTimeScore();
        int maxComboScore    = BattleSummary.Singleton.GetMaxComboScore();
        int reliveCountScore = BattleSummary.Singleton.GetReliveScore();
        int totalScore       = killedBossScore + elapsedTimeScore + maxComboScore + reliveCountScore;

        //Debug.Log("killedBossScore:" + killedBossScore + ",elapsedTimeScore:" + elapsedTimeScore + ",maxComboScore:" + maxComboScore + ",reliveCountScore:" + reliveCountScore + ",reliveCountScore:" + reliveCountScore);

        m_bossKilledScore.text  = killedBossScore.ToString();
        m_elapsedTimeScore.text = elapsedTimeScore.ToString();
        m_maxComboScore.text    = maxComboScore.ToString();
        m_reliveCountScore.text = reliveCountScore.ToString();

        m_totalScore.text = totalScore.ToString();
        string strRank = BattleSummary.Singleton.GetRank(totalScore, StageMenu.Singleton.m_curFloorId);


        BattleSummary.Singleton.m_curRank = strRank;
        UILabel rank = FindChildComponent <UILabel>(strRank);

        if (rank != null)
        {
            rank.gameObject.SetActive(true);
        }

        m_coinMultiply.text = BattleSummary.Singleton.GetMoneyParam().ToString();
        m_coin.text         = BattleSummary.Singleton.GetBaseMoney().ToString();
        m_exp.text          = BattleSummary.Singleton.GetBaseExp().ToString();
        m_expMultiply.text  = BattleSummary.Singleton.GetExpParam().ToString();

        SetAnimationSpeed("ui-battlevictory-00", 1.0f);
        AnimationClip clip = WindowRoot.GetComponent <Animation>().GetClip("ui-battlevictory-00");

        // 当 第一段动画播完后 没有任何操作则 播放第二段动画
        MainGame.Singleton.StartCoroutine(CoroutineAnimationEnd(++m_currentCorroutineIndex, clip.length, ENSTAGE.enStage1));


        foreach (UITexture item in m_itemList)
        {
            GameObject.Destroy(item.gameObject);
        }
        m_itemList.Clear();

        PlayerAttrInfo playerAttrInfo = GameTable.playerAttrTableAsset.LookUp(User.Singleton.GetLevel());

        if (null == playerAttrInfo)
        {
            return;
        }

        int needExp = playerAttrInfo.m_needExp;
        int exp     = User.Singleton.GetExp();

        m_expDetail.text = exp.ToString() + "/" + needExp.ToString();

        m_expPercent.text = exp * 100 / needExp + "%";
    }
示例#16
0
 public override void OnInit()
 {
     base.OnInit();
     AddPropChangedNotify((int)MVCPropertyID.enSceneManager, OnPropertyChanged);
     mEventScript = WindowRoot.GetComponent("UIControlRealTimeEvent") as UIControlRealTimeEvent;
 }
示例#17
0
    override public void OnUpdate()
    {
        float now = Time.time;

        if (BattleArena.Singleton.Combo.TotalComboNumber == 0 && now - m_showStartTime > ComboNumberShowDuration)
        {
            if (WindowRoot.activeSelf)
            {
                HideWindow();
            }
            m_tick                   = false;
            m_lastCount              = 0;
            m_notChangeSpeedIndex    = 0;
            m_curNotChangeSpeedIndex = 0;
            m_curDamageModify        = 0;
            m_modifyNum.gameObject.SetActive(false);
            m_percent.gameObject.SetActive(false);
            return;
        }
        if (m_lastCount > m_count)
        {
            if (m_isNotify)
            {
                m_lastCount = 0;
            }
            else
            {
                return;
            }
        }
        else
        {
            m_isNotify = false;
        }

        if (this.WindowRoot.GetComponent <Animation>().isPlaying)
        {
            return;
        }

        if (m_lastCount == 2)
        {
            m_comboNum.cachedTransform.localPosition     = m_localPos;
            m_comboBackNum.cachedTransform.localPosition = m_localPos;
        }
        else if (m_lastCount == 10 || m_lastCount == 100 || m_lastCount == 1000 || m_lastCount == 10000)
        {
            Vector3 temp = m_comboNum.cachedTransform.localPosition;
            temp.x -= ComboNumberOffset;
            m_comboNum.cachedTransform.localPosition     = temp;
            m_comboBackNum.cachedTransform.localPosition = temp;
        }

        //if (m_count == m_lastCount + 1)
        {
            if (m_comboScaleTime == 0)
            {
                WorldParamInfo info = GameTable.WorldParamTableAsset.Lookup((int)ENWorldParamIndex.enComboScaleTime);
                if (info != null)
                {
                    m_comboScaleTime = info.FloatTypeValue;
                }
            }
            if (now - m_lastTime <= m_comboScaleTime)
            {
                if (m_strNumber == "ComboHitSize")
                {
                    m_strNumber = "ComboHitSize2";
                }
                else if (m_strNumber == "ComboHitSize2")
                {
                    m_strNumber = "ComboHitSize3";
                }
                else if (m_strNumber == "ComboHitSize3")
                {
                    m_strNumber = "ComboHitSize3";
                }
            }
        }

        if (m_lastCount >= 2)
        {
            ShowWindow();

            m_comboBackNum.text = m_lastCount.ToString();
            m_comboNum.text     = m_lastCount.ToString();
            m_lastTime          = Time.time;
            //WindowRoot.animation.Stop();
            WindowRoot.GetComponent <Animation>().Play(m_strNumber, PlayMode.StopSameLayer);

            m_modifyNum.gameObject.SetActive(false);
            m_percent.gameObject.SetActive(false);
            if (BattleArena.Singleton.Combo.DamageModifyList.ContainsKey(m_lastCount))
            {
                float modify = BattleArena.Singleton.Combo.DamageModifyList[m_lastCount];
                if (modify != 0)
                {
                    m_modifyNum.text = modify.ToString();
                    m_modifyNum.gameObject.SetActive(true);
                    m_percent.gameObject.SetActive(true);
                    if (modify != m_curDamageModify)
                    {
                        m_curDamageModify = modify;
                        m_modifyNum.gameObject.GetComponent <Animation>().Play("comboDamageincreaseNumberPop", PlayMode.StopSameLayer);
                    }
                }
            }
        }
        // 同一时间 许多COMBO时 则不重置速度
        if (m_curNotChangeSpeedIndex < m_notChangeSpeedIndex)
        {
            m_curNotChangeSpeedIndex++;
        }
        else
        {// 重置正常速率
            m_comboAnimationSpeed = 1f;
            AnimationState state = this.WindowRoot.GetComponent <Animation>()["ComboHitSize"];
            state.speed = m_comboAnimationSpeed;
            state       = this.WindowRoot.GetComponent <Animation>()["ComboHitSize3"];
            state.speed = m_comboAnimationSpeed;
            state       = this.WindowRoot.GetComponent <Animation>()["ComboHitSize2"];
            state.speed = m_comboAnimationSpeed;
        }
        m_lastCount++;
    }