Ejemplo n.º 1
0
 public void Release()
 {
     mUIPortMenuButton_Top   = null;
     mUIPortMenuButton_Down  = null;
     mUIPortMenuButton_Left  = null;
     mUIPortMenuButton_Right = null;
 }
        private void OnPortMenuButtonClickEventListener(UIPortMenuButton calledObject)
        {
            bool flag         = -1 < Array.IndexOf <UIPortMenuButton>(this.mUIPortMenuButtons_Current, calledObject);
            bool isSelectable = calledObject.IsSelectable;
            bool flag2        = this.mStateManager.CurrentState == UserInterfacePortMenuManager.State.MainMenu || this.mStateManager.CurrentState == UserInterfacePortMenuManager.State.SubMenu;
            bool flag3        = this.IsControllable();

            if (flag2 && flag && isSelectable && flag3)
            {
                this.mStateManager.PushState(UserInterfacePortMenuManager.State.CallingNextScene);
                this.ChangeFocusButton(calledObject);
                Tween tween = calledObject.GenerateTweenClick();
                TweenSettingsExtensions.OnComplete <Tween>(tween, delegate
                {
                    bool flag4 = this.mUIPortMenuButton_Current is UIPortMenuButton.CompositeMenu;
                    if (this.mStateManager.CurrentState == UserInterfacePortMenuManager.State.SubMenu && !flag4)
                    {
                        this.mUIPortMenuAnimation.Initialize(calledObject);
                        this.mUIPortMenuAnimation.PlayCollectSubAnimation();
                    }
                    else
                    {
                        this.OnSelectedScene(calledObject.GetScene());
                    }
                });
            }
        }
Ejemplo n.º 3
0
 private void OnDestroy()
 {
     UserInterfacePortManager.ReleaseUtils.Release(ref mAudioClip_MainMenuOnMouse);
     UserInterfacePortManager.ReleaseUtils.Release(ref mTexture_Shaft);
     UserInterfacePortManager.ReleaseUtils.Release(ref mPanelThis);
     mButtonManager              = null;
     mUIPortMenuButton_Sally     = null;
     mUIPortMenuButton_Engage    = null;
     mUIPortMenuButton_Organize  = null;
     mUIPortMenuButton_Remodel   = null;
     mUIPortMenuButton_Arsenal   = null;
     mUIPortMenuButton_Duty      = null;
     mUIPortMenuButton_Repair    = null;
     mUIPortMenuButton_Supply    = null;
     mUIPortMenuButton_Record    = null;
     mUIPortMenuButton_Album     = null;
     mUIPortMenuButton_Item      = null;
     mUIPortMenuButton_Option    = null;
     mUIPortMenuButton_Interior  = null;
     mUIPortMenuButton_Save      = null;
     mUIPortMenuAnimation        = null;
     mUIPortMenuButtons_MainMenu = null;
     mUIPortMenuButtons_SubMenu  = null;
     mUIPortMenuButtons_Current  = null;
     mUIPortMenuButton_Current   = null;
     mStateManager  = null;
     mKeyController = null;
     mPortManager   = null;
 }
Ejemplo n.º 4
0
        private void OnPortMenuButtonClickEventListener(UIPortMenuButton calledObject)
        {
            bool flag         = -1 < Array.IndexOf(mUIPortMenuButtons_Current, calledObject);
            bool isSelectable = calledObject.IsSelectable;
            bool flag2        = mStateManager.CurrentState == State.MainMenu || mStateManager.CurrentState == State.SubMenu;
            bool flag3        = IsControllable();

            if (flag2 && flag && isSelectable && flag3)
            {
                mStateManager.PushState(State.CallingNextScene);
                ChangeFocusButton(calledObject);
                Tween t = calledObject.GenerateTweenClick();
                t.OnComplete(delegate
                {
                    bool flag4 = mUIPortMenuButton_Current is UIPortMenuButton.CompositeMenu;
                    if (mStateManager.CurrentState == State.SubMenu && !flag4)
                    {
                        mUIPortMenuAnimation.Initialize(calledObject);
                        mUIPortMenuAnimation.PlayCollectSubAnimation();
                    }
                    else
                    {
                        OnSelectedScene(calledObject.GetScene());
                    }
                });
            }
        }
Ejemplo n.º 5
0
 private void ChangeFocusButton(UIPortMenuButton targetButton)
 {
     if (mUIPortMenuButton_Current != null)
     {
         DOTween.Kill(mUIPortMenuButton_Current);
         Sequence s  = DOTween.Sequence().SetId(mUIPortMenuButton_Current).SetId(mUIPortMenuButton_Current);
         Tween    t  = mUIPortMenuButton_Current.GenerateTweenRemoveHover().SetId(mUIPortMenuButton_Current).SetId(mUIPortMenuButton_Current);
         Tween    t2 = mUIPortMenuButton_Current.GenerateTweenRemoveFocus().SetId(mUIPortMenuButton_Current).SetId(mUIPortMenuButton_Current);
         s.Join(t);
         s.Join(t2);
         mUIPortMenuButton_Current.RemoveHover();
     }
     mUIPortMenuButton_Current = targetButton;
     if (mUIPortMenuButton_Current != null)
     {
         DOTween.Kill(mUIPortMenuButton_Current);
         Sequence s2 = DOTween.Sequence().SetId(mUIPortMenuButton_Current).SetId(mUIPortMenuButton_Current);
         Tween    t3 = mUIPortMenuButton_Current.GenerateTweenHoverScale().SetId(mUIPortMenuButton_Current);
         Tween    t4 = mUIPortMenuButton_Current.GenerateTweenFocus().SetId(mUIPortMenuButton_Current);
         s2.Join(t3);
         s2.Join(t4);
         SoundUtils.PlaySE(mAudioClip_MainMenuOnMouse);
         mUIPortMenuButton_Current.Hover();
     }
 }
 public void Initialize(PortManager portManager, DeckModel deckModel)
 {
     this.mPortManager = portManager;
     this.mDeckModel   = deckModel;
     this.mUIPortMenuButton_Sally.ChangeState(UIPortMenuCenterButton.State.MainMenu);
     this.mUIPortMenuAnimation.Initialize(null);
     if (this.mUIPortMenuButton_Current != null)
     {
         this.mUIPortMenuButton_Current.GenerateTweenRemoveHover();
         this.mUIPortMenuButton_Current.RemoveHover();
         this.mUIPortMenuButton_Current = null;
     }
     this.mUIPortMenuButtons_MainMenu = this.GeneratePortMenuMain();
     this.mUIPortMenuButtons_SubMenu  = this.GeneratePortMenuSub();
     this.mTexture_Shaft.get_transform().set_localScale(Vector3.get_zero());
     UIPortMenuButton[] array = this.mUIPortMenuButtons_SubMenu;
     for (int i = 0; i < array.Length; i++)
     {
         UIPortMenuButton uIPortMenuButton = array[i];
         bool             selectable       = this.IsValidSelectable(this.mPortManager, this.mDeckModel, uIPortMenuButton);
         Vector3          localPosition    = uIPortMenuButton.get_transform().get_localPosition();
         uIPortMenuButton.get_transform().set_localPosition(this.mUIPortMenuButton_Sally.get_transform().get_localPosition());
         uIPortMenuButton.Initialize(selectable);
         uIPortMenuButton.get_gameObject().SetActive(false);
         uIPortMenuButton.alpha = 0f;
     }
     UIPortMenuButton[] array2 = this.mUIPortMenuButtons_MainMenu;
     for (int j = 0; j < array2.Length; j++)
     {
         UIPortMenuButton uIPortMenuButton2 = array2[j];
         bool             selectable2       = this.IsValidSelectable(this.mPortManager, this.mDeckModel, uIPortMenuButton2);
         Vector3          localPosition2    = uIPortMenuButton2.get_transform().get_localPosition();
         uIPortMenuButton2.get_transform().set_localPosition(this.mUIPortMenuButton_Sally.get_transform().get_localPosition());
         uIPortMenuButton2.get_transform().set_localScale(Vector3.get_zero());
         uIPortMenuButton2.Initialize(selectable2);
         uIPortMenuButton2.get_gameObject().SetActive(false);
         uIPortMenuButton2.alpha = 0f;
     }
     this.mUIPortMenuAnimation.SetOnFinishedCollectAnimationListener(new Action(this.OnFinishedCollectAnimationListener));
     UIPortMenuButton[] array3 = this.mUIPortMenuButtons_MainMenu;
     for (int k = 0; k < array3.Length; k++)
     {
         UIPortMenuButton uIPortMenuButton3 = array3[k];
         bool             selectable3       = this.IsValidSelectable(this.mPortManager, this.mDeckModel, uIPortMenuButton3);
         uIPortMenuButton3.Initialize(selectable3);
     }
     UIPortMenuButton[] array4 = this.mUIPortMenuButtons_SubMenu;
     for (int l = 0; l < array4.Length; l++)
     {
         UIPortMenuButton uIPortMenuButton4 = array4[l];
         bool             selectable4       = this.IsValidSelectable(this.mPortManager, this.mDeckModel, uIPortMenuButton4);
         uIPortMenuButton4.Initialize(selectable4);
     }
     this.mStateManager          = new UserInterfacePortMenuManager.StateManager <UserInterfacePortMenuManager.State>(UserInterfacePortMenuManager.State.None);
     this.mStateManager.OnPush   = new Action <UserInterfacePortMenuManager.State>(this.OnPushState);
     this.mStateManager.OnPop    = new Action <UserInterfacePortMenuManager.State>(this.OnPopState);
     this.mStateManager.OnResume = new Action <UserInterfacePortMenuManager.State>(this.OnResumeState);
 }
 private bool IsValidSelectable(PortManager portManager, DeckModel deckModel, UIPortMenuButton portMenuButton)
 {
     Generics.Scene scene = portMenuButton.GetScene();
     if (scene != Generics.Scene.Marriage)
     {
         return(SingletonMonoBehaviour <AppInformation> .Instance.IsValidMoveToScene(portMenuButton.GetScene()));
     }
     return(portManager.IsValidMarriage(deckModel.GetFlagShip().MemId));
 }
Ejemplo n.º 8
0
 public void Initialize(UIPortMenuButton targetMenuButton)
 {
     if (mTargetMenuButton != null)
     {
         NGUITools.AdjustDepth(mTargetMenuButton.gameObject, -10);
         mTargetMenuButton = null;
     }
     mTargetMenuButton = targetMenuButton;
 }
 public void Initialize(UIPortMenuButton targetMenuButton)
 {
     if (this.mTargetMenuButton != null)
     {
         NGUITools.AdjustDepth(this.mTargetMenuButton.get_gameObject(), -10);
         this.mTargetMenuButton = null;
     }
     this.mTargetMenuButton = targetMenuButton;
 }
Ejemplo n.º 10
0
 public void Initialize(PortManager portManager, DeckModel deckModel)
 {
     mPortManager = portManager;
     mDeckModel   = deckModel;
     mUIPortMenuButton_Sally.ChangeState(UIPortMenuCenterButton.State.MainMenu);
     mUIPortMenuAnimation.Initialize(null);
     if (mUIPortMenuButton_Current != null)
     {
         mUIPortMenuButton_Current.GenerateTweenRemoveHover();
         mUIPortMenuButton_Current.RemoveHover();
         mUIPortMenuButton_Current = null;
     }
     mUIPortMenuButtons_MainMenu         = GeneratePortMenuMain();
     mUIPortMenuButtons_SubMenu          = GeneratePortMenuSub();
     mTexture_Shaft.transform.localScale = Vector3.zero;
     UIPortMenuButton[] array = mUIPortMenuButtons_SubMenu;
     foreach (UIPortMenuButton uIPortMenuButton in array)
     {
         bool    selectable    = IsValidSelectable(mPortManager, mDeckModel, uIPortMenuButton);
         Vector3 localPosition = uIPortMenuButton.transform.localPosition;
         uIPortMenuButton.transform.localPosition = mUIPortMenuButton_Sally.transform.localPosition;
         uIPortMenuButton.Initialize(selectable);
         uIPortMenuButton.gameObject.SetActive(false);
         uIPortMenuButton.alpha = 0f;
     }
     UIPortMenuButton[] array2 = mUIPortMenuButtons_MainMenu;
     foreach (UIPortMenuButton uIPortMenuButton2 in array2)
     {
         bool    selectable2    = IsValidSelectable(mPortManager, mDeckModel, uIPortMenuButton2);
         Vector3 localPosition2 = uIPortMenuButton2.transform.localPosition;
         uIPortMenuButton2.transform.localPosition = mUIPortMenuButton_Sally.transform.localPosition;
         uIPortMenuButton2.transform.localScale    = Vector3.zero;
         uIPortMenuButton2.Initialize(selectable2);
         uIPortMenuButton2.gameObject.SetActive(false);
         uIPortMenuButton2.alpha = 0f;
     }
     mUIPortMenuAnimation.SetOnFinishedCollectAnimationListener(OnFinishedCollectAnimationListener);
     UIPortMenuButton[] array3 = mUIPortMenuButtons_MainMenu;
     foreach (UIPortMenuButton uIPortMenuButton3 in array3)
     {
         bool selectable3 = IsValidSelectable(mPortManager, mDeckModel, uIPortMenuButton3);
         uIPortMenuButton3.Initialize(selectable3);
     }
     UIPortMenuButton[] array4 = mUIPortMenuButtons_SubMenu;
     foreach (UIPortMenuButton uIPortMenuButton4 in array4)
     {
         bool selectable4 = IsValidSelectable(mPortManager, mDeckModel, uIPortMenuButton4);
         uIPortMenuButton4.Initialize(selectable4);
     }
     mStateManager          = new StateManager <State>(State.None);
     mStateManager.OnPush   = OnPushState;
     mStateManager.OnPop    = OnPopState;
     mStateManager.OnResume = OnResumeState;
 }
Ejemplo n.º 11
0
        private void OnPressKeyUp()
        {
            UIPortMenuButton uIPortMenuButton = null;

            if (mStateManager.CurrentState == State.MainMenu)
            {
                uIPortMenuButton = mUIPortMenuButton_Current.GetKeyMap().mUIPortMenuButton_Top;
            }
            else if (mStateManager.CurrentState == State.SubMenu)
            {
                uIPortMenuButton = ((!(mUIPortMenuButton_Current is UIPortMenuButton.CompositeMenu)) ? mUIPortMenuButton_Current.GetKeyMap().mUIPortMenuButton_Top : ((UIPortMenuButton.CompositeMenu)mUIPortMenuButton_Current).GetSubMenuKeyMap().mUIPortMenuButton_Top);
            }
            if (uIPortMenuButton != null && uIPortMenuButton.IsSelectable)
            {
                ChangeFocusButton(uIPortMenuButton);
            }
        }
 private void Awake()
 {
     this.mButtonManager = base.GetComponent <UIButtonManager>();
     this.mPanelThis     = base.GetComponent <UIPanel>();
     this.mButtonManager.IndexChangeAct = delegate
     {
         UIPortMenuButton uIPortMenuButton = this.mUIPortMenuButtons_Current[this.mButtonManager.nowForcusIndex];
         bool             isSelectable     = this.mUIPortMenuButtons_Current[this.mButtonManager.nowForcusIndex].IsSelectable;
         bool             flag             = this.mStateManager.CurrentState == UserInterfacePortMenuManager.State.MainMenu || this.mStateManager.CurrentState == UserInterfacePortMenuManager.State.SubMenu;
         bool             flag2            = this.mUIPortMenuButton_Current != null && this.mUIPortMenuButton_Current.Equals(uIPortMenuButton);
         bool             flag3            = this.IsControllable();
         if (flag && isSelectable && !flag2 && flag3)
         {
             this.ChangeFocusButton(uIPortMenuButton);
         }
     };
     this.mAudioClip_MainMenuOnMouse = SoundFile.LoadSE(SEFIleInfos.MainMenuOnMouse);
 }
Ejemplo n.º 13
0
 private void Awake()
 {
     mButtonManager = GetComponent <UIButtonManager>();
     mPanelThis     = GetComponent <UIPanel>();
     mButtonManager.IndexChangeAct = delegate
     {
         UIPortMenuButton uIPortMenuButton = mUIPortMenuButtons_Current[mButtonManager.nowForcusIndex];
         bool             isSelectable     = mUIPortMenuButtons_Current[mButtonManager.nowForcusIndex].IsSelectable;
         bool             flag             = mStateManager.CurrentState == State.MainMenu || mStateManager.CurrentState == State.SubMenu;
         bool             flag2            = mUIPortMenuButton_Current != null && mUIPortMenuButton_Current.Equals(uIPortMenuButton);
         bool             flag3            = IsControllable();
         if (flag && isSelectable && !flag2 && flag3)
         {
             ChangeFocusButton(uIPortMenuButton);
         }
     };
     mAudioClip_MainMenuOnMouse = SoundFile.LoadSE(SEFIleInfos.MainMenuOnMouse);
 }
        private void OnPressKeyUp()
        {
            UIPortMenuButton uIPortMenuButton = null;

            if (this.mStateManager.CurrentState == UserInterfacePortMenuManager.State.MainMenu)
            {
                uIPortMenuButton = this.mUIPortMenuButton_Current.GetKeyMap().mUIPortMenuButton_Top;
            }
            else if (this.mStateManager.CurrentState == UserInterfacePortMenuManager.State.SubMenu)
            {
                if (this.mUIPortMenuButton_Current is UIPortMenuButton.CompositeMenu)
                {
                    uIPortMenuButton = ((UIPortMenuButton.CompositeMenu) this.mUIPortMenuButton_Current).GetSubMenuKeyMap().mUIPortMenuButton_Top;
                }
                else
                {
                    uIPortMenuButton = this.mUIPortMenuButton_Current.GetKeyMap().mUIPortMenuButton_Top;
                }
            }
            if (uIPortMenuButton != null && uIPortMenuButton.IsSelectable)
            {
                this.ChangeFocusButton(uIPortMenuButton);
            }
        }
Ejemplo n.º 15
0
        private IEnumerator OnPushFirstOpenMainCoroutine()
        {
            mUIPortMenuButtons_Current = mUIPortMenuButtons_MainMenu;
            mUIPortMenuButton_Current  = mUIPortMenuButton_Sally;
            mButtonManager.UpdateButtons(mUIPortMenuButtons_Current);
            mUIPortMenuButtons_MainMenu.ForEach(delegate(UIPortMenuButton targetObject)
            {
                if (!targetObject.Equals(this.mUIPortMenuButton_Sally) && !targetObject.Equals(this.mUIPortMenuButton_Engage))
                {
                    targetObject.gameObject.SetActive(true);
                }
            });
            if (mUIPortMenuButton_Engage.IsSelectable)
            {
                mUIPortMenuButton_Engage.transform.localPosition = mUIPortMenuButton_Engage.GetDefaultLocalPosition();
                mUIPortMenuButton_Engage.gameObject.SetActive(true);
                mUIPortMenuButton_Engage.alpha = 1f;
            }
            else
            {
                mUIPortMenuButton_Engage.gameObject.SetActive(false);
                mUIPortMenuButton_Engage.alpha = 0f;
            }
            yield return(new WaitForEndOfFrame());

            Sequence shaftSequence = DOTween.Sequence().SetId(this);

            shaftSequence.OnPlay(delegate
            {
                this.mTexture_Shaft.transform.localScale = Vector3.zero;
                this.mUIPortMenuButton_Sally.alpha       = 1f;
            });
            Tween shaftIn = mTexture_Shaft.transform.DOScale(new Vector3(1f, 1f), 0.6f).SetId(this);

            shaftSequence.Append(shaftIn);
            Sequence sallyIn = DOTween.Sequence().SetId(this);

            sallyIn.OnPlay(delegate
            {
                this.mUIPortMenuButton_Sally.transform.localScale = Vector3.zero;
                this.mUIPortMenuButton_Sally.gameObject.SetActive(true);
            });
            sallyIn.Append(mUIPortMenuButton_Sally.transform.DOScale(new Vector3(1.1f, 1.1f), 0.1f).SetId(this));

            var showOthers = DOTween.Sequence().SetId(this);

            mUIPortMenuButtons_MainMenu.ForEach(delegate(UIPortMenuButton targetObject)
            {
                var _003COnPushFirstOpenMainCoroutine_003Ec__IteratorAE = this;
                if (!targetObject.Equals(this.mUIPortMenuButton_Sally) && !targetObject.Equals(this.mUIPortMenuButton_Engage))
                {
                    Vector3 defaultLocalPosition = targetObject.GetDefaultLocalPosition();
                    Tween t = targetObject.transform.DOLocalMove(defaultLocalPosition, 0.25f).SetId(this);
                    t.OnPlay(delegate
                    {
                        targetObject.alpha = 1f;
                    });
                    showOthers.Join(t);
                }
            });
            Sequence mainSequence = DOTween.Sequence().SetId(this);

            mainSequence.Join(shaftSequence);
            mainSequence.Join(sallyIn);
            mainSequence.OnComplete(delegate
            {
                Sequence s = DOTween.Sequence().SetId(this);
                s.AppendInterval(0.3f);
                s.Append(showOthers);
                this.mUIPortMenuButtons_MainMenu.ForEach(delegate(UIPortMenuButton targetObject)
                {
                    if (!targetObject.Equals(this.mUIPortMenuButton_Current))
                    {
                        targetObject.GenerateTweenRemoveHover();
                        targetObject.RemoveHover();
                    }
                });
                if (this.mOnFirstOpendListener != null)
                {
                    this.mOnFirstOpendListener();
                }
            });
            mStateManager.PopState();
            mStateManager.PushState(State.MainMenu);
            mUIPortMenuButton_Sally.GenerateTweenFocus();
            YieldInstruction mainSequenceInstruction = mainSequence.WaitForCompletion();

            yield return(new WaitForEndOfFrame());

            yield return(mainSequenceInstruction);
        }
Ejemplo n.º 16
0
 private void OnDestroy()
 {
     mAnim_MennuCollect = null;
     mOnFinishedCollectAnimationListener = null;
     mTargetMenuButton = null;
 }