Exemplo n.º 1
0
    public override void Open()
    {
        EventManager.AddUpdateListener(MTFrame.MTEvent.UpdateEventEnumType.Update, "OnUpdate", OnUpdate);

        foreach (var item in tweenObjects)
        {
            item.Stop();
        }

        contentPanel.Hide();
        gameContentPanel.Hide();
        Tips.DOFillAlpha(0, 0.5f);
        Group_Button.DOFillAlpha(1, 0.5f);
        Group_Button.transform.DOSize(Vector3.one, 0.5f).OnComplete(() =>
        {
            foreach (BaseButton button in baseButtons)
            {
                (button as MenuButton).Open();
            }
        });
    }
Exemplo n.º 2
0
    public override void InitFind()
    {
        base.InitFind();

        MenuButtonStartPos = FindTool.FindChildComponent <Transform>(transform.parent, "MenuButtonStartPos");
        Group_Button       = FindTool.FindChildComponent <CanvasGroup>(transform, "Group_Button");
        baseButtons        = Group_Button.GetComponentsInChildren <MenuButton>();
        Tips = FindTool.FindChildComponent <CanvasGroup>(transform.parent, "Tips");

        contentPanel     = FindTool.FindChildComponent <ContentPanel>(transform.parent, "ContentPanel");
        gameContentPanel = FindTool.FindChildComponent <GameContentPanel>(transform.parent, "GameContentPanel");

        contentPanel.Init(this);
        gameContentPanel.Init(this);

        Tips.DOFillAlpha(0, 0.5f);

        for (int i = 0; i < MainData.Instance.directoryPathDatas.Count; i++)
        {
            string str = MainData.Instance.directoryPathDatas[i].directoryInfo.Name;
            //如果提示这里索引超出范围,就将预设里六个按钮,被关掉的两个按钮的勾打上
            baseButtons[i].Init(str);
        }
    }
Exemplo n.º 3
0
 private void OnClick(BaseButton button)
 {
     Tips.DOFillAlpha(1, 0.5f);
     Hide();
     contentPanel.SetPanel((button as MenuButton).GetName());
 }
Exemplo n.º 4
0
 private void OnGameButtonClick(BaseButton obj)
 {
     Tips.DOFillAlpha(1, 0.5f);
     Hide();
     gameContentPanel.Open();
 }