Пример #1
0
        public void ExitMode()
        {
            key = null;
            characterSlideCollider.enabled = false;
            Vector3 enterPosition = character.getEnterPosition();
            float   x             = enterPosition.x;
            Vector3 localPosition = character.transform.localPosition;

            if (x == localPosition.x)
            {
                bool flag  = MenuCamera.gameObject.transform.localPosition == Vector3.zero && MenuCamera.orthographicSize == 1f;
                bool flag2 = InteriorCamera.gameObject.transform.localPosition == Vector3.zero && InteriorCamera.orthographicSize == 1f;
                if (flag && flag2)
                {
                    OnFinishedExitMode();
                    return;
                }
            }
            StrategyShipCharacter strategyShipCharacter = character;
            Vector3 enterPosition2 = character.getEnterPosition();

            strategyShipCharacter.moveCharacterX(enterPosition2.x, 0.5f, OnFinishedExitMode);
            Util.MoveTo(MenuCamera.gameObject, 0.5f, Vector3.zero, iTween.EaseType.easeOutQuad);
            Util.MoveTo(InteriorCamera.gameObject, 0.5f, Vector3.zero, iTween.EaseType.easeOutQuad);
            TweenScale.Begin(character.gameObject, 0.5f, new Vector3(1.1f, 1.1f, 1.1f));
            iTween.ValueTo(base.gameObject, iTween.Hash("onupdate", "CameraResetUpdate", "time", 0.5f, "from", MenuCamera.orthographicSize, "to", 1));
        }
Пример #2
0
        private IEnumerator Start()
        {
            Stopwatch stopWatch = new Stopwatch();

            stopWatch.Reset();
            stopWatch.Start();
            mStateManager          = new StateManager <State>(State.NONE);
            mStateManager.OnPush   = OnPushState;
            mStateManager.OnResume = OnResumeState;
            mStateManager.OnPop    = OnPopState;
            SingletonMonoBehaviour <UIShortCutMenu> .Instance.IsInputEnable = false;
            DOTween.Init();
            iTween.Init(base.gameObject);
            mPortManager   = new PortManager(SingletonMonoBehaviour <AppInformation> .Instance.CurrentAreaID);
            mKeyController = new KeyControl();
            mDeckModel     = mPortManager.UserInfo.GetDeck(SingletonMonoBehaviour <AppInformation> .Instance.CurrentDeckID);
            SingletonMonoBehaviour <PortObjectManager> .Instance.setNowScene(Generics.Scene.PortTop.ToString(), isLoadLevel : false);

            SingletonMonoBehaviour <PortObjectManager> .Instance.SceneObject = base.gameObject;
            mUIShipCharacter.ChangeCharacter();
            Transform transform     = mUIShipCharacter.transform;
            Vector3   enterPosition = mUIShipCharacter.getEnterPosition();

            transform.localPositionX(enterPosition.x);
            Dictionary <FurnitureKinds, FurnitureModel> furnitures = mPortManager.GetFurnitures(mDeckModel.Id);

            mUserInterfacePortInteriorManager.InitializeFurnitures(mDeckModel, furnitures);
            mUserInterfacePortInteriorManager.SetOnRequestJukeBoxEvent(OnRequestJukeBoxEvent);
            if (SingletonMonoBehaviour <UIPortFrame> .exist())
            {
                SingletonMonoBehaviour <UIPortFrame> .Instance.CircleUpdateInfo(mPortManager);

                SingletonMonoBehaviour <UIPortFrame> .Instance.UpdateHeaderInfo(mPortManager);

                SingletonMonoBehaviour <UIPortFrame> .Instance.isColliderEnabled = false;
                SingletonMonoBehaviour <UIPortFrame> .Instance.SetOnClickCircleButtoListener(OnTouchHideMenu);
            }
            mUIInteriorFurniturePreviewWaiter.SetOnBackListener(OnFinishedFurniturePreview);
            mUserInterfacePortMenuManager.SetOnSelectedSceneListener(OnSelectedSceneListener);
            mUserInterfacePortMenuManager.SetOnFirstOpendListener(OnFirstOpendListener);
            mUIPortCameraControlMode.SetOnFinishedModeListener(OnFinishedOfficeModeListener);
            mKeyController.ClearKeyAll();
            mKeyController.firstUpdate = true;
            mKeyController.IsRun       = false;
            ChangeShipDepth(ShipDepth.HigherPortFrame);
            TutorialInstantiate = TutorialCheck(OnCloseTutorialDialog);
            if (TutorialInstantiate == null)
            {
                mKeyController.IsRun = true;
            }
            else
            {
                mKeyController.IsRun = false;
            }
            stopWatch.Stop();
            for (int frame = 0; frame < stopWatch.Elapsed.Milliseconds / 60; frame++)
            {
                yield return(new WaitForEndOfFrame());
            }
            mStateManager.PushState(State.FirstOpenMenu);
        }