示例#1
0
        private UIFilledSprite m_fsInfoBillboardAnger; // 怒气条

        public PlayerHead(uint id,
                          Transform trans, Action <PlayerHead, uint, Transform, EntityParent> OnFinished, EntityParent self,
                          bool showBlood, HeadBloodColor bloodColor = HeadBloodColor.Red,
                          bool showAnger = false)
        {
            AssetCacheMgr.GetUIInstance("InfoBillboard.prefab", (prefab, guid, go) =>
            {
                m_billboard      = (GameObject)go;
                m_billboard.name = id.ToString();

                m_goBillboardBlood = m_billboard.transform.FindChild("InfoBillboardBlood").gameObject;
                m_goBillboardAnger = m_billboard.transform.FindChild("InfoBillboardAnger").gameObject;
                ShowBillboardBlood(showBlood);
                SetBillboardBloodColor(bloodColor);
                ShowBillboardAnger(showAnger);

                blood                  = m_billboard.transform.FindChild("InfoBillboardBlood/InfoBillboardBloodFG").GetComponentInChildren <UIFilledSprite>();
                name                   = m_billboard.transform.FindChild("InfoBillboardName").GetComponentInChildren <UILabel>();
                tong                   = m_billboard.transform.FindChild("InfoBillboardTong").GetComponentInChildren <UILabel>();
                testInfo               = m_billboard.transform.FindChild("InfoBillboardTestInfo").GetComponentsInChildren <UILabel>(true)[0];
                bar                    = m_billboard.transform.FindChild("InfoBillboardBlood/InfoBillboardBloodFG").GetComponentInChildren <UIFilledSprite>();
                bg                     = m_billboard.transform.FindChild("InfoBillboardBlood/InfoBillboardBloodBG0").GetComponentInChildren <UISprite>();
                m_bloodAnim            = m_billboard.transform.FindChild("InfoBillboardBlood").GetComponentsInChildren <MogoBloodAnim>(true)[0];
                m_fsInfoBillboardAnger = m_billboard.transform.FindChild("InfoBillboardAnger/InfoBillboardAngerFG").GetComponentInChildren <UIFilledSprite>();

                OnFinished(this, id, trans, self);
            });
        }
示例#2
0
        private UIFilledSprite m_fsInfoBillboardAnger; // 怒气条

        public PlayerHead(uint id,            
            Transform trans ,Action<PlayerHead, uint,Transform,EntityParent> OnFinished,EntityParent self,
            bool showBlood, HeadBloodColor bloodColor = HeadBloodColor.Red,
            bool showAnger = false)
        {           
            AssetCacheMgr.GetUIInstance("InfoBillboard.prefab", (prefab, guid, go) =>
            {
                m_billboard = (GameObject)go;
                m_billboard.name = id.ToString();              

                m_goBillboardBlood = m_billboard.transform.FindChild("InfoBillboardBlood").gameObject;
                m_goBillboardAnger = m_billboard.transform.FindChild("InfoBillboardAnger").gameObject;
                ShowBillboardBlood(showBlood);
                SetBillboardBloodColor(bloodColor);
                ShowBillboardAnger(showAnger);

                blood = m_billboard.transform.FindChild("InfoBillboardBlood/InfoBillboardBloodFG").GetComponentInChildren<UIFilledSprite>();
                name = m_billboard.transform.FindChild("InfoBillboardName").GetComponentInChildren<UILabel>();
                tong = m_billboard.transform.FindChild("InfoBillboardTong").GetComponentInChildren<UILabel>();
                testInfo = m_billboard.transform.FindChild("InfoBillboardTestInfo").GetComponentsInChildren<UILabel>(true)[0];
                bar = m_billboard.transform.FindChild("InfoBillboardBlood/InfoBillboardBloodFG").GetComponentInChildren<UIFilledSprite>();
                bg = m_billboard.transform.FindChild("InfoBillboardBlood/InfoBillboardBloodBG0").GetComponentInChildren<UISprite>();
                m_bloodAnim = m_billboard.transform.FindChild("InfoBillboardBlood").GetComponentsInChildren<MogoBloodAnim>(true)[0];
                m_fsInfoBillboardAnger = m_billboard.transform.FindChild("InfoBillboardAnger/InfoBillboardAngerFG").GetComponentInChildren<UIFilledSprite>();

                OnFinished(this,id,trans,self);
            });
        }
示例#3
0
    public override void CallWhenLoadResources()
    {
        m_instance = this;
        ID = MFUIManager.MFUIID.BattleMainUI;
        MFUIManager.GetSingleton().RegisterUI(ID, m_myGameObject);
        FillFullNameData(m_myTransform);

        m_goMainUIBottom = m_myTransform.FindChild(m_widgetToFullName["Bottom"]).gameObject;
        m_goMainUIBottomLeft = m_myTransform.FindChild(m_widgetToFullName["BottomLeft"]).gameObject;
        m_goMainUIBottomRight = m_myTransform.FindChild(m_widgetToFullName["BottomRight"]).gameObject;
        m_goMainUITop = m_myTransform.FindChild("Top").gameObject;
        m_goMainUITopLeft = m_myTransform.FindChild(m_widgetToFullName["TopLeft"]).gameObject;
        m_goMainUITopRight = m_myTransform.FindChild(m_widgetToFullName["TopRight"]).gameObject;
        m_goController = m_myTransform.FindChild("BottomLeft/Controller").gameObject;
        m_goController.AddComponent<ControlStick>();

        // 设置各部分控件的Camera
        Camera camera = GameObject.Find("Camera").GetComponentsInChildren<Camera>(true)[0];
        m_goMainUIBottom.GetComponentsInChildren<UIAnchor>(true)[0].uiCamera = camera;
        m_goMainUIBottomLeft.GetComponentsInChildren<UIAnchor>(true)[0].uiCamera = camera;
        m_goMainUIBottomRight.GetComponentsInChildren<UIAnchor>(true)[0].uiCamera = camera;
        m_goMainUITop.GetComponentsInChildren<UIAnchor>(true)[0].uiCamera = camera;
        m_goMainUITopLeft.GetComponentsInChildren<UIAnchor>(true)[0].uiCamera = camera;
        m_goMainUITopRight.GetComponentsInChildren<UIAnchor>(true)[0].uiCamera = camera;
        m_goController.GetComponentsInChildren<ControlStick>(true)[0].RelatedCamera = camera;

        m_myTransform.FindChild(m_widgetToFullName["MainUIBG"]).gameObject.AddComponent<TouchControll>();

        m_fsNormalAttackCD = m_myTransform.FindChild(m_widgetToFullName["NormalAttackCD"]).GetComponentsInChildren<UIFilledSprite>(true)[0];

        m_goSelfAttack = m_myTransform.FindChild(m_widgetToFullName["SelfAttack"]).gameObject;
        m_goCancelManaged = m_myTransform.FindChild(m_widgetToFullName["CancelManagedBtn"]).gameObject;

        m_lblPlayerBlood = m_myTransform.FindChild(m_widgetToFullName["MainUIPlayerBloodText"]).GetComponentsInChildren<UILabel>(true)[0];
        m_fsPlayerBloodFG = m_myTransform.FindChild(m_widgetToFullName["MainUIPlayerBloodFG"]).GetComponentInChildren<UIFilledSprite>() as UIFilledSprite;
        m_ssPlayerHead = m_myTransform.FindChild(m_widgetToFullName["MainUIPlayerHead"]).GetComponentsInChildren<UISlicedSprite>(true)[0];
        m_fsPlayerAnger = m_myTransform.FindChild(m_widgetToFullName["MainUIPlayerAngerFG"]).GetComponentInChildren<UIFilledSprite>() as UIFilledSprite;
        m_fsPlayerExp = m_myTransform.FindChild(m_widgetToFullName["MainUIPlayerExpFG"]).GetComponentInChildren<UIFilledSprite>() as UIFilledSprite;
        m_fsAffectCD = m_myTransform.FindChild(m_widgetToFullName["AffectCD"]).GetComponentInChildren<UIFilledSprite>() as UIFilledSprite;
        m_fsAffectCD.color = new Color(0.5f, 0.5f, 0.5f);
        m_fsOutputCD = m_myTransform.FindChild(m_widgetToFullName["OutputCD"]).GetComponentInChildren<UIFilledSprite>() as UIFilledSprite;
        m_fsOutputCD.color = new Color(0.5f, 0.5f, 0.5f);
        m_fsMoveCD = m_myTransform.FindChild(m_widgetToFullName["MoveCD"]).GetComponentInChildren<UIFilledSprite>() as UIFilledSprite;
        m_fsMoveCD.color = new Color(0.5f, 0.5f, 0.5f);
        m_fsSpriteSkillCD = FindTransform("MainUISpriteSkillBtnCD").GetComponentsInChildren<UIFilledSprite>(true)[0];
        m_fsSpriteSkillCD.color = new Color(0.5f, 0.5f, 0.5f);
        m_hpBottleCD = m_myTransform.FindChild(m_widgetToFullName["HpCD"]).GetComponentInChildren<UIFilledSprite>() as UIFilledSprite;
        //m_hpBottleCD.atlas = MogoUIManager.Instance.GetSkillIconAtlas();
        m_fsSpecialCD = m_myTransform.FindChild(m_widgetToFullName["SpecialCD"]).GetComponentInChildren<UIFilledSprite>() as UIFilledSprite;
        m_fsNormalTargetBlood = m_myTransform.FindChild(m_widgetToFullName["NormalTargetBloodFG"]).GetComponentsInChildren<UIFilledSprite>(true)[0];
        //m_fsBossTargetBlood = m_myTransform.FindChild(m_widgetToFullName["BossTargetBloodFG"]).GetComponentsInChildren<UIFilledSprite>(true)[0];

        m_member1 = m_myTransform.FindChild(m_widgetToFullName["TeamMember1"]).gameObject;
        m_member2 = m_myTransform.FindChild(m_widgetToFullName["TeamMember2"]).gameObject;
        m_member3 = m_myTransform.FindChild(m_widgetToFullName["TeamMember3"]).gameObject;

        m_member1Image = m_myTransform.FindChild(m_widgetToFullName["TeamMember1LevelBG"]).GetComponentsInChildren<UISprite>(true)[0];
        m_member2Image = m_myTransform.FindChild(m_widgetToFullName["TeamMember2LevelBG"]).GetComponentsInChildren<UISprite>(true)[0];
        m_member3Image = m_myTransform.FindChild(m_widgetToFullName["TeamMember3LevelBG"]).GetComponentsInChildren<UISprite>(true)[0];

        m_fsMember1Blood = m_myTransform.FindChild(m_widgetToFullName["TeamMember1BloodFG"]).GetComponentsInChildren<UIFilledSprite>(true)[0];
        m_fsMember2Blood = m_myTransform.FindChild(m_widgetToFullName["TeamMember2BloodFG"]).GetComponentsInChildren<UIFilledSprite>(true)[0];
        m_fsMember3Blood = m_myTransform.FindChild(m_widgetToFullName["TeamMember3BloodFG"]).GetComponentsInChildren<UIFilledSprite>(true)[0];

        m_lblSelfAttack = m_myTransform.FindChild(m_widgetToFullName["SelfAttackText"]).GetComponentsInChildren<UILabel>(true)[0];
        m_spSelfAttack = m_myTransform.FindChild(m_widgetToFullName["SelfAttackSprite"]).GetComponentsInChildren<UISprite>(true)[0];

        //m_comboAttack = m_myTransform.FindChild(m_widgetToFullName["ComboAttack"]).GetComponentsInChildren<ComboAttack>(true)[0];
        m_comboAttack = m_myTransform.FindChild(m_widgetToFullName["ComboAttack"]).gameObject.AddComponent<ComboAttack>();


        m_bloodAnim = m_fsPlayerBloodFG.transform.parent.GetComponentsInChildren<MogoBloodAnim>(true)[0];
        m_bossBloodAnim0 = m_myTransform.FindChild(m_widgetToFullName["BossTargetBlood"]).GetComponentsInChildren<MogoBloodAnim>(true)[0];
        m_smallBossBloodAnim0 = m_myTransform.FindChild(m_widgetToFullName["SmallBossTargetBlood"]).GetComponentsInChildren<MogoBloodAnim>(true)[0];

        for (int i = 0; i < 5; ++i)
        {
            //////Mogo.Util.LoggerHelper.Debug(i + " !!!!!!!!!!!!!!!!!!!!!!!!!!!!");
            m_fsBossTargetBloodList[i] = m_myTransform.FindChild(m_widgetToFullName["BossTargetBloodFG" + i]).GetComponentsInChildren<UIFilledSprite>(true)[0];
            m_fsSmallBossTargetBloodList[i] = m_myTransform.FindChild(m_widgetToFullName["SmallBossTargetBloodFG" + i]).GetComponentsInChildren<UIFilledSprite>(true)[0];
        }

        // 左上角玩家信息Pos
        m_goMainUIPlayerInfo = FindTransform("MainUIPlayerInfo").gameObject;
        m_vecMainUIPlayerInfoPosDefault = FindTransform("MainUIPlayerInfoPosDefault").transform.localPosition;
        m_vecMainUIPlayerInfoPosPVP = FindTransform("MainUIPlayerInfoPosPVP").transform.localPosition;

        // 占塔贡献榜
        m_goOccupyTowerRank = FindTransform("OccupyTowerRank").gameObject;
        m_lblOccupyTowerRankTitle = FindTransform("OccupyTowerRankTitle").GetComponentsInChildren<UILabel>(true)[0];
        m_listOccupyTowerRank.Clear();
        for (int rank = 1; rank <= MAX_OCCUPY_TOWER_RANK; rank++)
        {
            UILabel rankLabel = FindTransform(string.Format("OccupyTowerRank{0}", rank)).GetComponentsInChildren<UILabel>(true)[0];
            m_listOccupyTowerRank.Add(rankLabel);
        }

        // 占塔战斗信息
        m_goOccupyTowerNotice = FindTransform("OccupyTowerNotice").gameObject;
        m_lblOccupyTowerNoticeCountDownNum = FindTransform("OccupyTowerNoticeCountDownNum").GetComponentsInChildren<UILabel>(true)[0];
        m_spOccupyTowerNoticeEnemyBloodFG = FindTransform("OccupyTowerNoticeEnemyBloodFG").GetComponentsInChildren<UISprite>(true)[0];
        m_spOccupyTowerNoticeOwnBloodFG = FindTransform("OccupyTowerNoticeOwnBloodFG").GetComponentsInChildren<UISprite>(true)[0];
        m_spOccupyTowerNoticeEnemyBloodAnim = FindTransform("OccupyTowerNoticeEnemyBloodAnim").GetComponentsInChildren<UISprite>(true)[0];
        m_spOccupyTowerNoticeOwnBloodAnim = FindTransform("OccupyTowerNoticeOwnBloodAnim").GetComponentsInChildren<UISprite>(true)[0];
        m_lblOccupyTowerNoticeEnemyBloodNum = FindTransform("OccupyTowerNoticeEnemyBloodNum").GetComponentsInChildren<UILabel>(true)[0];
        m_lblOccupyTowerNoticeOwnBloodNum = FindTransform("OccupyTowerNoticeOwnBloodNum").GetComponentsInChildren<UILabel>(true)[0];
        m_lblOccupyTowerNoticeEnemyScore = FindTransform("OccupyTowerNoticeEnemyScore").GetComponentsInChildren<UILabel>(true)[0];
        m_lblOccupyTowerNoticeOwnScore = FindTransform("OccupyTowerNoticeOwnScore").GetComponentsInChildren<UILabel>(true)[0];
        m_occupyTowerNoticeEnemyBloodAnim = FindTransform("OccupyTowerNoticeEnemyBlood").GetComponentsInChildren<MogoBloodAnim>(true)[0];
        m_occupyTowerNoticeOwnBloodAnim = FindTransform("OccupyTowerNoticeOwnBlood").GetComponentsInChildren<MogoBloodAnim>(true)[0];

        m_lblContributeRankText = m_myTransform.FindChild(m_widgetToFullName["CurrentRankText"]).GetComponentsInChildren<UILabel>(true)[0];
        m_lblFirstRank = m_myTransform.FindChild(m_widgetToFullName["FirstRank"]).GetComponentsInChildren<UILabel>(true)[0];
        m_lblSecRank = m_myTransform.FindChild(m_widgetToFullName["SecondRank"]).GetComponentsInChildren<UILabel>(true)[0];
        m_lblTriRank = m_myTransform.FindChild(m_widgetToFullName["TriRank"]).GetComponentsInChildren<UILabel>(true)[0];
        m_lblComboAttackNum = m_myTransform.FindChild(m_widgetToFullName["ComboAttackNum"]).GetComponentsInChildren<UILabel>(true)[0];
        m_lblDamageNum = m_myTransform.FindChild(m_widgetToFullName["DamageNum"]).GetComponentsInChildren<UILabel>(true)[0];

        m_lblInstanceCountDown = m_myTransform.FindChild(m_widgetToFullName["InstanceCountDown"]).GetComponentsInChildren<UILabel>(true)[0];

        m_goAutoFight = m_myTransform.FindChild(m_widgetToFullName["AutoFightBtn"]).gameObject;
        m_goAutoFightText = m_myTransform.FindChild(m_widgetToFullName["AutoFightBtnText"]).gameObject;

        m_goNormalAttackBtn = m_myTransform.FindChild(m_widgetToFullName["NormalAttack"]).gameObject;
        m_spNormalAttackFG = m_goNormalAttackBtn.transform.FindChild("NormalAttackBGUp").GetComponent<UISprite>();
        m_spNormalAttackBG = m_goNormalAttackBtn.transform.FindChild("NormalAttackBGDown").GetComponent<UISprite>();
        m_goSkill0Btn = m_myTransform.FindChild(m_widgetToFullName["Move"]).gameObject;
        m_goSkill1Btn = m_myTransform.FindChild(m_widgetToFullName["Affect"]).gameObject;
        m_goSkill2Btn = m_myTransform.FindChild(m_widgetToFullName["Output"]).gameObject;
        m_goSkill2Btn.AddComponent<MogoDebugWidget>();

        m_goBottle = m_myTransform.FindChild(m_widgetToFullName["MainUIItem"]).gameObject;
        m_goSpriteSkillBtn = FindTransform("MainUISpriteSkillBtn").gameObject;
        m_goCommunityBtn = m_myTransform.FindChild(m_widgetToFullName["Community"]).gameObject;

        UILabel lblText = m_goAutoFightText.transform.GetComponentsInChildren<UILabel>(true)[0];
        if (LanguageData.dataMap.ContainsKey(180000))
        {
            lblText.text = LanguageData.dataMap[180000].content;
        }

        m_goAutoFightStateText = m_myTransform.FindChild(m_widgetToFullName["AutoFightStateText"]).gameObject;
        m_goAutoFightStateText.SetActive(false);

        // 角色经验条(Bottom)
        m_goMainUIPlayerExpList = m_myTransform.FindChild(m_widgetToFullName["MainUIPlayerExpList"]).gameObject;
        m_goGOMainUIPlayerExpListFG = m_myTransform.FindChild(m_widgetToFullName["GOMainUIPlayerExpListFG"]).gameObject;
        m_lblMainUIPlayerExpListNum = m_myTransform.FindChild(m_widgetToFullName["MainUIPlayerExpListNum"]).GetComponentsInChildren<UILabel>(true)[0];
        m_goMainUIPlayerExpList.SetActive(true);
        AddPlayerExpFG();

        // 试炼之塔提示信息
        m_goGOClimbTowerCurrent = m_myTransform.FindChild(m_widgetToFullName["GOClimbTowerCurrent"]).gameObject;
        m_spClimbTowerCurrentNum1 = m_myTransform.FindChild(m_widgetToFullName["ClimbTowerCurrentNum1"]).GetComponentsInChildren<UISprite>(true)[0];
        m_spClimbTowerCurrentNum2 = m_myTransform.FindChild(m_widgetToFullName["ClimbTowerCurrentNum2"]).GetComponentsInChildren<UISprite>(true)[0];
        m_spClimbTowerCurrentNum3 = m_myTransform.FindChild(m_widgetToFullName["ClimbTowerCurrentNum3"]).GetComponentsInChildren<UISprite>(true)[0];

        // 左上角倒计时
        m_goTheCountDown1 = FindTransform("TheCountDown1").gameObject;
        m_goTheCountDown2 = FindTransform("TDCountDown").gameObject;

        m_lblTheCountDown1Num = FindTransform("TheCountDown1Num").GetComponentsInChildren<UILabel>(true)[0];
        m_lblTheCountDown2Num = FindTransform("TDCountDown").GetComponentsInChildren<UILabel>(true)[0];

        m_CDPosClimbTower = FindTransform("CDPosClimbTower").transform.localPosition;

        m_goDiamondProtectBtn = m_myTransform.FindChild(m_widgetToFullName["DiamondProtectBtn"]).gameObject;
        m_goBuildingProtectBtn = m_myTransform.FindChild(m_widgetToFullName["BuildingProtectBtn"]).gameObject;       

        // 精灵技能施放
        m_goMainUISpriteSkill = FindTransform("MainUISpriteSkill").gameObject;
        LoadFingerTailUI();

        Initialize();

        MFUIGameObjectPool.GetSingleton().NotRegisterGameObjectList(ID);
        m_myGameObject.SetActive(false);

        if (MogoWorld.thePlayer != null)
        {
            MogoWorld.thePlayer.UpdateSkillToManager();
        }

        #region 塔防血条

        go_tdNotice = m_myTransform.FindChild(m_widgetToFullName["TDNotice"]).gameObject;
        go_tdTip = m_myTransform.FindChild(m_widgetToFullName["TDTip"]).gameObject;
        sp_tdBlood = m_myTransform.FindChild(m_widgetToFullName["TDBloodFG"]).gameObject.GetComponentsInChildren<UISprite>(true)[0];
        lbl_tdWave = m_myTransform.FindChild(m_widgetToFullName["TDWaveText"]).gameObject.GetComponentsInChildren<UILabel>(true)[0];
        lbl_tdTip = m_myTransform.FindChild(m_widgetToFullName["TDTipText"]).gameObject.GetComponentsInChildren<UILabel>(true)[0];
    
        #endregion
    }