Пример #1
0
 public override void Enter(IslandCameraBaseState lastState, object param = null)
 {
     base.Enter(lastState, param);
     this._building = param as MonoIslandBuilding;
     if ((this._building != null) && (base._sm != null))
     {
         this._startPos  = base._sm.GetPivot();
         this._landedPos = this._building.GetLandedPos();
         this._startTime = Time.time;
         Vector3 vector    = this._landedPos - this._startPos;
         float   magnitude = vector.magnitude;
         this._totalTime      = magnitude / base._sm.GetLandedSpeedFinal(magnitude);
         this._fire_prelanded = false;
         this._startPitch     = base._sm.GetLookAtPitch();
         this._landedPitch    = this._building.GetLandedPitch();
         if ((base._sm != null) && (base._sm.GetGyroManager() != null))
         {
             base._sm.GetGyroManager().SetEnable(false);
         }
         if (Singleton <MainUIManager> .Instance != null)
         {
             MonoIslandUICanvas sceneCanvas = Singleton <MainUIManager> .Instance.SceneCanvas as MonoIslandUICanvas;
             if (sceneCanvas != null)
             {
                 sceneCanvas.TriggerFullScreenBlock(true);
             }
         }
     }
 }
Пример #2
0
        private void Start()
        {
            this._fingerUtil        = new FingerUtil();
            this._swipeState        = new IslandCameraSwipeState(this);
            this._dampingState      = new IslandCameraDampingState(this);
            this._toLandedState     = new IslandCameraToLandedState(this);
            this._toFocusState      = new IslandCameraToFocusState(this);
            this._backToLandedState = new IslandCameraBackToLandedState(this);
            this._focusingState     = new IslandCameraFocusingState(this);
            this._backToBaseState   = new IslandCameraBackToBaseState(this);
            this._dragBackState     = new IslandCameraDragBackState(this);
            this._landingState      = new IslandCameraLandingState(this);
            Dictionary <E_IslandCameraState, IslandCameraBaseState> dictionary = new Dictionary <E_IslandCameraState, IslandCameraBaseState>();

            dictionary.Add(E_IslandCameraState.Swipe, this._swipeState);
            dictionary.Add(E_IslandCameraState.Damping, this._dampingState);
            dictionary.Add(E_IslandCameraState.ToLanded, this._toLandedState);
            dictionary.Add(E_IslandCameraState.ToFocus, this._toFocusState);
            dictionary.Add(E_IslandCameraState.BackToLanded, this._backToLandedState);
            dictionary.Add(E_IslandCameraState.Focusing, this._focusingState);
            dictionary.Add(E_IslandCameraState.BackToBase, this._backToBaseState);
            dictionary.Add(E_IslandCameraState.DragBack, this._dragBackState);
            dictionary.Add(E_IslandCameraState.Landing, this._landingState);
            this._stateDict = dictionary;
            this._mpb       = new AlphaLerpMaterialPropetyBlock(this._cover.GetComponent <MeshRenderer>(), "_Color", 0f, this._grayCoverAlpha);
            this._mpb.SetAlpha(0f);
            this._currentState = null;
            this.GotoState(E_IslandCameraState.Swipe, null);
            this.SetPivot(this._cameraBasePos.position);
            this._targetPivot   = this._cameraBasePos.position;
            this._lookAtPitch   = this._cameraBasePos.eulerAngles.x;
            this._lookAtDir     = this._cameraBasePos.forward;
            this._dragBackPoint = new DragBackPoint(this._cameraBasePos.position);
        }
 public override void Exit(IslandCameraBaseState nextState)
 {
     this._building = null;
     if ((base._sm != null) && (base._sm.GetGyroManager() != null))
     {
         base._sm.GetGyroManager().SetEnable(true);
     }
 }
Пример #4
0
        public void GotoState(E_IslandCameraState newStateName, object param = null)
        {
            IslandCameraBaseState nextState = this.GetState(newStateName);

            if (this._currentState != null)
            {
                this._currentState.Exit(nextState);
            }
            nextState.Enter(this._currentState, param);
            this._currentState = nextState;
        }
Пример #5
0
        public override void Enter(IslandCameraBaseState lastState, object param = null)
        {
            base.Enter(lastState, param);
            this._dragBackPoint = param as DragBackPoint;
            this._startPos      = base._sm.GetPivot();
            this._toPos         = this._dragBackPoint._finalPos;
            this._startTime     = Time.time;
            Vector3 vector = this._toPos - this._startPos;

            this._totalTime = vector.magnitude / base._sm._dragBack_speed;
        }
Пример #6
0
 public override void Enter(IslandCameraBaseState lastState, object param = null)
 {
     base.Enter(lastState, param);
     if (param != null)
     {
         Gesture gesture = param as Gesture;
         if (gesture != null)
         {
             this.OnTouchStart(gesture);
         }
     }
 }
Пример #7
0
 public override void Exit(IslandCameraBaseState nextState)
 {
     this._building = null;
     if (Singleton <MainUIManager> .Instance != null)
     {
         MonoIslandUICanvas sceneCanvas = Singleton <MainUIManager> .Instance.SceneCanvas as MonoIslandUICanvas;
         if (sceneCanvas != null)
         {
             sceneCanvas.TriggerFullScreenBlock(false);
         }
     }
 }
 public override void Enter(IslandCameraBaseState lastState, object param = null)
 {
     base.Enter(lastState, param);
     this._building = param as MonoIslandBuilding;
     if (this._building != null)
     {
         this._startPos   = this._building.GetFocusPos();
         this._finalPos   = this._building.GetLandedPos();
         this._startPitch = this._building.GetFocusPitch();
         this._finalPitch = base._sm.GetCameraBasePos().eulerAngles.x;
         this._startTime  = Time.time;
         Vector3 vector2 = this._finalPos - this._startPos;
         this._totalTime = vector2.magnitude / base._sm._backto_landed_speed;
     }
 }
Пример #9
0
 public override void Enter(IslandCameraBaseState lastState, object param = null)
 {
     base.Enter(lastState, param);
     this._building = param as MonoIslandBuilding;
     if (this._building != null)
     {
         this._startPos   = this._building.GetLandedPos();
         this._focusPos   = this._building.GetFocusPos();
         this._startPitch = base._sm.GetLookAtPitch();
         this._focusPitch = this._building.GetFocusPitch();
         this._startTime  = Time.time;
         Vector3 vector = this._focusPos - this._startPos;
         this._totalTime     = vector.magnitude / base._sm._to_focus_speed;
         this._fire_prefocus = false;
         (Singleton <MainUIManager> .Instance.SceneCanvas as MonoIslandUICanvas).TriggerFullScreenBlock(true);
     }
 }
Пример #10
0
        public override void Enter(IslandCameraBaseState lastState, object param = null)
        {
            base.Enter(lastState, param);
            this._startPos   = base._sm.GetPivot();
            this._finalPos   = base._sm.GetCameraBasePos().position;
            this._startPitch = base._sm.GetLookAtPitch();
            this._finalPitch = base._sm.GetCameraBasePos().eulerAngles.x;
            this._startTime  = Time.time;
            Vector3 vector2   = this._finalPos - this._startPos;
            float   magnitude = vector2.magnitude;

            this._totalTime = magnitude / base._sm.GetBackToBaseSpeed(magnitude);
            base._sm.TriggerCover(E_AlphaLerpDir.ToLittle);
            this._building = param as MonoIslandBuilding;
            if (this._building != null)
            {
                this._building.TriggerHighLight(E_AlphaLerpDir.ToLittle);
            }
        }
Пример #11
0
 public override void Exit(IslandCameraBaseState nextState)
 {
     if (this._building != null)
     {
         this._building.SetRenderQueue(E_IslandRenderQueue.Back);
     }
     if (Singleton <MainUIManager> .Instance != null)
     {
         MonoIslandUICanvas sceneCanvas = Singleton <MainUIManager> .Instance.SceneCanvas as MonoIslandUICanvas;
         if (sceneCanvas != null)
         {
             sceneCanvas.SetBuildingEffect(this._building, true);
         }
     }
     this._building = null;
     if ((base._sm != null) && (base._sm.GetGyroManager() != null))
     {
         base._sm.GetGyroManager().SetEnable(true);
     }
 }
Пример #12
0
 public override void Exit(IslandCameraBaseState nextState)
 {
     this._selectObj   = null;
     this._fingerIndex = -2;
 }
Пример #13
0
 public override void Exit(IslandCameraBaseState nextState)
 {
 }
Пример #14
0
 public virtual void Enter(IslandCameraBaseState lastState, object param = null)
 {
 }
Пример #15
0
 public override void Enter(IslandCameraBaseState lastState, object param = null)
 {
     base.Enter(lastState, param);
     this._building = param as MonoIslandBuilding;
     (Singleton <MainUIManager> .Instance.SceneCanvas as MonoIslandUICanvas).TriggerFullScreenBlock(false);
 }
Пример #16
0
 public override void Exit(IslandCameraBaseState nextState)
 {
     this._building = null;
 }
Пример #17
0
 public override void Enter(IslandCameraBaseState lastState, object param = null)
 {
     base.Enter(lastState, param);
 }
Пример #18
0
 public override void Exit(IslandCameraBaseState nextState)
 {
     (Singleton <MainUIManager> .Instance.SceneCanvas as MonoIslandUICanvas).TriggerFullScreenBlock(false);
 }
Пример #19
0
 public virtual void Exit(IslandCameraBaseState nextState)
 {
 }