Пример #1
0
    void Awake()
    {
        if (mogoSingleBtnListCtrl != null)
        {
            foreach (var item in mogoSingleBtnListCtrl.TempSingleButtonControlList)
            {
                mogoSingleBtnListCtrl.Add(item.Key, item.Value);
            }
            mogoSingleBtnListCtrl.TempSingleButtonControlList.Clear();
            mogoSingleBtnListCtrl.SetCurrentDownButton(mogoSingleBtnListCtrl.lastSelectedId);
        }

        for (int i = 0; i < SingleButtonList.Count; ++i)
        {
            if (IsImage)
            {
                m_spDownImage.Add(SingleButtonList[i].GetComponentsInChildren<UISprite>(true)[1]);
            }
            else
            {
                if (SingleButtonList[i].GetComponentsInChildren<UILabel>(true).Length > 2)
                {
                    m_lblDown.Add(SingleButtonList[i].GetComponentsInChildren<UILabel>(true)[1]);
                }
            }
        }

        if (SingleButtonList.Count > 0)
        {
            CurrentBtn = SingleButtonList[0];			
        }

    }
Пример #2
0
    void Awake()
    {
        if (mogoSingleBtnListCtrl != null)
        {
            foreach (var item in mogoSingleBtnListCtrl.TempSingleButtonControlList)
            {
                mogoSingleBtnListCtrl.Add(item.Key, item.Value);
            }
            mogoSingleBtnListCtrl.TempSingleButtonControlList.Clear();
            mogoSingleBtnListCtrl.SetCurrentDownButton(mogoSingleBtnListCtrl.lastSelectedId);
        }

        for (int i = 0; i < SingleButtonList.Count; ++i)
        {
            if (IsImage)
            {
                m_spDownImage.Add(SingleButtonList[i].GetComponentsInChildren<UISprite>(true)[1]);
            }
            else
            {
                if (SingleButtonList[i].GetComponentsInChildren<UILabel>(true).Length > 2)
                {
                    m_lblDown.Add(SingleButtonList[i].GetComponentsInChildren<UILabel>(true)[1]);
                }
            }
        }

        if (SingleButtonList.Count > 0)
        {
            CurrentBtn = SingleButtonList[0];			
        }

    }
Пример #3
0
    public void SetCurrentDownButton(int gridId)
    {
        if (CurrentBtn == null)
        {
            if(SingleButtonList.Count > 0)
                CurrentBtn = SingleButtonList[0];
        }

        if (CurrentBtn == null)
            return;

        if (gridId < SingleButtonList.Count)
        {
            if (SingleButtonList[gridId] == CurrentBtn)
            {
                if (IsFirstTimeSetDown)
                    IsFirstTimeSetDown = false;
                else
                    return;
            }

            CurrentBtn.IsDown = false;
            CurrentBtn = SingleButtonList[gridId];
        }
    }
Пример #4
0
 void Start()
 {
     // m_currentBtn.IsDown(true);
     if (SingleButtonList.Count > 0 && CurrentBtn == null)
     {
         CurrentBtn = SingleButtonList[0];
     }
 }
Пример #5
0
 void Start()
 {
     // m_currentBtn.IsDown(true);
     if (SingleButtonList.Count > 0 && CurrentBtn == null)
     {
         CurrentBtn = SingleButtonList[0];
     }
 }
Пример #6
0
    void Awake()
    {
        m_instance    = this;
        m_myTransform = transform;
        FillFullNameData(m_myTransform);

        Initialize();

        for (int i = 0; i < 5; ++i)
        {
            //m_arrSkillIconGrid[i] = m_myTransform.FindChild(m_widgetToFullName["SkillIcon" + i]).GetComponentsInChildren<SkillUIIconGrid>(true)[0];
            m_arrSkillIconGrid[i]    = m_myTransform.FindChild(m_widgetToFullName["SkillIcon" + i]).gameObject.AddComponent <SkillUIIconGrid>();
            m_arrSkillIconGrid[i].ID = i;

            Mogo.Util.LoggerHelper.Debug("Run Herererererer");
        }

        for (int i = 0; i < 3; ++i)
        {
            m_arrLblSkillInfoIconName[i] = m_myTransform.FindChild(m_widgetToFullName["SkillDialogInfoIcon" + i + "Name"]).GetComponentsInChildren <UILabel>(true)[0];
            m_arrSSSkillInfoActive[i]    = m_myTransform.FindChild(m_widgetToFullName["SkillDialogInfoIcon" + i + "Active"]).GetComponentsInChildren <UISlicedSprite>(true)[0];
            m_arrSSSkillInfoLock[i]      = m_myTransform.FindChild(m_widgetToFullName["SkillDialogInfoIcon" + i + "Lock"]).GetComponentsInChildren <UISlicedSprite>(true)[0];
            m_arrSSSkillInfoFG[i]        = m_myTransform.FindChild(m_widgetToFullName["SkillDialogInfoIcon" + i + "FG"]).GetComponentsInChildren <UISlicedSprite>(true)[0];
        }

        m_lblSkillName            = m_myTransform.FindChild(m_widgetToFullName["SkillDialogInfoName"]).GetComponentsInChildren <UILabel>(true)[0];
        m_lblSkillNeedLevel       = m_myTransform.FindChild(m_widgetToFullName["SkillDialogInfoNeedLevelNum"]).GetComponentsInChildren <UILabel>(true)[0];
        m_lblSkillDescripe        = m_myTransform.FindChild(m_widgetToFullName["SkillDialogInfoDescripeText"]).GetComponentsInChildren <UILabel>(true)[0];
        m_lblSkillLearnCostGold   = m_myTransform.FindChild(m_widgetToFullName["SkillDialogInfoLearnCostGlodText"]).GetComponentsInChildren <UILabel>(true)[0];
        m_lblSkillLearnCostHorner = m_myTransform.FindChild(m_widgetToFullName["SkillDialogInfoLearnCostHornerText"]).GetComponentsInChildren <UILabel>(true)[0];
        m_lblSkillUIGold          = m_myTransform.FindChild(m_widgetToFullName["SkillDialogGoldInfoNum"]).GetComponentsInChildren <UILabel>(true)[0];
        m_lblSkillUIHorner        = m_myTransform.FindChild(m_widgetToFullName["SkillDialogHornerInfoNum"]).GetComponentsInChildren <UILabel>(true)[0];
        m_lblSkillDamageRace      = m_myTransform.FindChild(m_widgetToFullName["SkillDialogInfoDamageRaceText"]).GetComponentsInChildren <UILabel>(true)[0];
        m_lblSkillDamageRaceNum   = FindTransform("SkillDialogInfoDamageRaceNum").GetComponentsInChildren <UILabel>(true)[0];
        m_lblSkillExtraDamage     = m_myTransform.FindChild(m_widgetToFullName["SkillDialogInfoExtraDamageText"]).GetComponentsInChildren <UILabel>(true)[0];
        m_lblSkillExtraDamageNum  = FindTransform("SkillDialogInfoExtraDamageNum").GetComponentsInChildren <UILabel>(true)[0];

        m_spSwitchIcon = m_myTransform.FindChild(m_widgetToFullName["SkillIcon4Switch"]).GetComponentsInChildren <UISprite>(true)[0];

        m_learnBtn = m_myTransform.FindChild(m_widgetToFullName["SkillDialogInfoLearn"]).GetComponentsInChildren <MogoTwoStatusButton>(true)[0];

        m_goSkillInfoList = m_myTransform.FindChild(m_widgetToFullName["SkillDialogInfoIconList"]).gameObject;

        m_spRefreshCtrl = m_myTransform.FindChild(m_widgetToFullName["SkillUIRefreshCtrl"]).GetComponentsInChildren <UISprite>(true)[0];

        m_mtbWeapon0 = m_myTransform.FindChild(m_widgetToFullName["SkillDialogPageWeapon0"]).GetComponent <MogoSingleButton>();
        m_mtbWeapon1 = m_myTransform.FindChild(m_widgetToFullName["SkillDialogPageWeapon1"]).GetComponent <MogoSingleButton>();

        m_spRefreshCtrl.atlas             = MogoUIManager.Instance.GetSkillIconAtlas();
        m_lblSkillDialogInfoNeedLevelText = FindTransform("SkillDialogInfoNeedLevelText").GetComponentsInChildren <UILabel>(true)[0];
        m_lblSkillDialogInfoLearnCostText = FindTransform("SkillDialogInfoLearnCostText").GetComponentsInChildren <UILabel>(true)[0];
    }
Пример #7
0
    public void SetCurrentDownButton(MogoSingleButton btn)
    {
        if (CurrentBtn == null)
            CurrentBtn = SingleButtonList[0];

        if (CurrentBtn == null)
            return;

        if (CurrentBtn.gameObject.activeSelf || btn.name != CurrentBtn.name)
        {
            CurrentBtn.IsDown = false;
            CurrentBtn = btn;
        }
    }
Пример #8
0
    public void SetCurrentDownButton(MogoSingleButton btn)
    {
        if (CurrentBtn == null)
            CurrentBtn = SingleButtonList[0];


        if (CurrentBtn.gameObject.activeSelf || btn.name != CurrentBtn.name)
        {
            CurrentBtn.IsDown = false;
            CurrentBtn = btn;
        }
    }
Пример #9
0
    public void SetCurrentDownButton(int gridId)
    {
        if (CurrentBtn == null)
        {
            if(SingleButtonList.Count > 0)
                CurrentBtn = SingleButtonList[0];
        }

        if (gridId < SingleButtonList.Count)
        {
            if (SingleButtonList[gridId] == CurrentBtn)
            {
                if (IsFirstTimeSetDown)
                    IsFirstTimeSetDown = false;
                else
                    return;
            }

            CurrentBtn.IsDown = false;
            CurrentBtn = SingleButtonList[gridId];
        }
    }
Пример #10
0
    public override void OnInspectorGUI()
    {
        EditorGUIUtility.LookLikeControls(80f);
        mMogoButton = target as MogoSingleButton;

        EditorGUILayout.Space();

        GUILayout.BeginHorizontal();
        var isImage = EditorGUILayout.Toggle("isImage", mMogoButton.isImage, GUILayout.Width(250f));

        if (isImage != mMogoButton.isImage)
        {
            RegisterUndo(); mMogoButton.isImage = isImage;
        }
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        var BGDown = EditorGUILayout.ObjectField("BGDown", mMogoButton.BGDown, typeof(GameObject)) as GameObject;

        if (BGDown != mMogoButton.BGDown)
        {
            RegisterUndo(); mMogoButton.BGDown = BGDown;
        }
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        var BGUp = EditorGUILayout.ObjectField("BGUp", mMogoButton.BGUp, typeof(GameObject)) as GameObject;

        if (BGUp != mMogoButton.BGUp)
        {
            RegisterUndo(); mMogoButton.BGUp = BGUp;
        }
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        var TextFG = EditorGUILayout.ObjectField("TextFG", mMogoButton.TextFG, typeof(GameObject)) as GameObject;

        if (TextFG != mMogoButton.TextFG)
        {
            RegisterUndo(); mMogoButton.TextFG = TextFG;
        }
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        var m_lblName = EditorGUILayout.ObjectField("m_lblName", mMogoButton.m_lblName, typeof(UILabel)) as UILabel;

        if (m_lblName != mMogoButton.m_lblName)
        {
            RegisterUndo(); mMogoButton.m_lblName = m_lblName;
        }
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        var buttonType = (ButtonClickSoundType)EditorGUILayout.EnumPopup("buttonType", mMogoButton.buttonType, GUILayout.Width(170f));

        if (buttonType != mMogoButton.buttonType)
        {
            RegisterUndo(); mMogoButton.buttonType = buttonType;
        }
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        GUILayout.Label("一秒变样式", GUILayout.Width(75f));
        //if (GUILayout.Button("A横上选中", GUILayout.Width(100f)))
        //    ExportScenesManager.SetUIASingleButton(mMogoButton.gameObject, true);
        //if (GUILayout.Button("A横上普通", GUILayout.Width(100f)))
        //    ExportScenesManager.SetUIASingleButton(mMogoButton.gameObject, false);
        //GUILayout.EndHorizontal();

        //GUILayout.BeginHorizontal();
        //GUILayout.Label("", GUILayout.Width(75f));
        //if (GUILayout.Button("B竖左选中", GUILayout.Width(100f)))
        //    ExportScenesManager.SetUIBSingleButton(mMogoButton.gameObject, true);
        //if (GUILayout.Button("B竖左普通", GUILayout.Width(100f)))
        //    ExportScenesManager.SetUIBSingleButton(mMogoButton.gameObject, false);
        //GUILayout.EndHorizontal();

        //GUILayout.BeginHorizontal();
        //GUILayout.Label("", GUILayout.Width(75f));
        //if (GUILayout.Button("C横左选中", GUILayout.Width(100f)))
        //    ExportScenesManager.SetUICSingleButton(mMogoButton.gameObject, true);
        //if (GUILayout.Button("C横左普通", GUILayout.Width(100f)))
        //    ExportScenesManager.SetUICSingleButton(mMogoButton.gameObject, false);
        //GUILayout.EndHorizontal();

        //GUILayout.BeginHorizontal();
        //GUILayout.Label("", GUILayout.Width(75f));
        //if (GUILayout.Button("D子页签选中", GUILayout.Width(120f)))
        //    ExportScenesManager.SetUIDSingleButton(mMogoButton.gameObject, true);
        //if (GUILayout.Button("D子页签普通", GUILayout.Width(120f)))
        //    ExportScenesManager.SetUIDSingleButton(mMogoButton.gameObject, false);
        GUILayout.EndHorizontal();
    }
Пример #11
0
    void Awake()
    {
        m_instance = this;
        m_myTransform = transform;
        FillFullNameData(m_myTransform);       

        Initialize();

        for (int i = 0; i < 5; ++i)
        {
            //m_arrSkillIconGrid[i] = m_myTransform.FindChild(m_widgetToFullName["SkillIcon" + i]).GetComponentsInChildren<SkillUIIconGrid>(true)[0];
            m_arrSkillIconGrid[i] = m_myTransform.FindChild(m_widgetToFullName["SkillIcon" + i]).gameObject.AddComponent<SkillUIIconGrid>();
            m_arrSkillIconGrid[i].ID = i;

            Mogo.Util.LoggerHelper.Debug("Run Herererererer");
        }

        for (int i = 0; i < 3; ++i)
        {
            m_arrLblSkillInfoIconName[i] = m_myTransform.FindChild(m_widgetToFullName["SkillDialogInfoIcon" + i + "Name"]).GetComponentsInChildren<UILabel>(true)[0];
            m_arrSSSkillInfoActive[i] = m_myTransform.FindChild(m_widgetToFullName["SkillDialogInfoIcon" + i + "Active"]).GetComponentsInChildren<UISlicedSprite>(true)[0];
            m_arrSSSkillInfoLock[i] = m_myTransform.FindChild(m_widgetToFullName["SkillDialogInfoIcon" + i + "Lock"]).GetComponentsInChildren<UISlicedSprite>(true)[0];
            m_arrSSSkillInfoFG[i] = m_myTransform.FindChild(m_widgetToFullName["SkillDialogInfoIcon" + i + "FG"]).GetComponentsInChildren<UISlicedSprite>(true)[0];
        }

        m_lblSkillName = m_myTransform.FindChild(m_widgetToFullName["SkillDialogInfoName"]).GetComponentsInChildren<UILabel>(true)[0];
        m_lblSkillNeedLevel = m_myTransform.FindChild(m_widgetToFullName["SkillDialogInfoNeedLevelNum"]).GetComponentsInChildren<UILabel>(true)[0];
        m_lblSkillDescripe = m_myTransform.FindChild(m_widgetToFullName["SkillDialogInfoDescripeText"]).GetComponentsInChildren<UILabel>(true)[0];
        m_lblSkillLearnCostGold = m_myTransform.FindChild(m_widgetToFullName["SkillDialogInfoLearnCostGlodText"]).GetComponentsInChildren<UILabel>(true)[0];
        m_lblSkillLearnCostHorner = m_myTransform.FindChild(m_widgetToFullName["SkillDialogInfoLearnCostHornerText"]).GetComponentsInChildren<UILabel>(true)[0];
        m_lblSkillUIGold = m_myTransform.FindChild(m_widgetToFullName["SkillDialogGoldInfoNum"]).GetComponentsInChildren<UILabel>(true)[0];
        m_lblSkillUIHorner = m_myTransform.FindChild(m_widgetToFullName["SkillDialogHornerInfoNum"]).GetComponentsInChildren<UILabel>(true)[0];
        m_lblSkillDamageRace = m_myTransform.FindChild(m_widgetToFullName["SkillDialogInfoDamageRaceText"]).GetComponentsInChildren<UILabel>(true)[0];
        m_lblSkillDamageRaceNum = FindTransform("SkillDialogInfoDamageRaceNum").GetComponentsInChildren<UILabel>(true)[0];
        m_lblSkillExtraDamage = m_myTransform.FindChild(m_widgetToFullName["SkillDialogInfoExtraDamageText"]).GetComponentsInChildren<UILabel>(true)[0];
        m_lblSkillExtraDamageNum = FindTransform("SkillDialogInfoExtraDamageNum").GetComponentsInChildren<UILabel>(true)[0];

        m_spSwitchIcon = m_myTransform.FindChild(m_widgetToFullName["SkillIcon4Switch"]).GetComponentsInChildren<UISprite>(true)[0];

        m_learnBtn = m_myTransform.FindChild(m_widgetToFullName["SkillDialogInfoLearn"]).GetComponentsInChildren<MogoTwoStatusButton>(true)[0];

        m_goSkillInfoList = m_myTransform.FindChild(m_widgetToFullName["SkillDialogInfoIconList"]).gameObject;

        m_spRefreshCtrl = m_myTransform.FindChild(m_widgetToFullName["SkillUIRefreshCtrl"]).GetComponentsInChildren<UISprite>(true)[0];

        m_mtbWeapon0 = m_myTransform.FindChild(m_widgetToFullName["SkillDialogPageWeapon0"]).GetComponent<MogoSingleButton>();
        m_mtbWeapon1 = m_myTransform.FindChild(m_widgetToFullName["SkillDialogPageWeapon1"]).GetComponent<MogoSingleButton>();

        m_spRefreshCtrl.atlas = MogoUIManager.Instance.GetSkillIconAtlas();
        m_lblSkillDialogInfoNeedLevelText = FindTransform("SkillDialogInfoNeedLevelText").GetComponentsInChildren<UILabel>(true)[0];
        m_lblSkillDialogInfoLearnCostText = FindTransform("SkillDialogInfoLearnCostText").GetComponentsInChildren<UILabel>(true)[0];
    }