Ejemplo n.º 1
0
        // EXECUTABLE: ----------------------------------------------------------------------------

        public override bool InstantExecute(GameObject target, IAction[] actions, int index)
        {
            CameraMotor motor = (this.mainCameraMotor ? CameraMotor.MAIN_MOTOR : this.cameraMotor);

            if (motor != null && motor.cameraMotorType.GetType() == typeof(CameraMotorTypeAdventure))
            {
                CameraMotorTypeAdventure adventureMotor = (CameraMotorTypeAdventure)motor.cameraMotorType;
                adventureMotor.allowOrbitInput = this.allowOrbitInput;
                adventureMotor.allowZoom       = this.allowZoom;
                adventureMotor.avoidWallClip   = this.avoidWallClip;
            }

            return(!this.changeTargetOffset && !this.changePivotOffset);
        }
Ejemplo n.º 2
0
        // INITIALIZE: ----------------------------------------------------------------------------

        private void Awake()
        {
            if (this.isMainCameraMotor)
            {
                MAIN_MOTOR = this;
            }

            this.cameraMotorType.Initialize(this);
            Camera attachedCamera = GetComponent <Camera>();

            if (attachedCamera != null)
            {
                attachedCamera.enabled = false;
            }
        }
Ejemplo n.º 3
0
        // EXECUTABLE: ----------------------------------------------------------------------------

        public override bool InstantExecute(GameObject target, IAction[] actions, int index)
        {
            CameraMotor motor = (this.mainCameraMotor ? CameraMotor.MAIN_MOTOR : this.cameraMotor);

            if (motor != null && motor.cameraMotorType.GetType() == typeof(CameraMotorTypeFirstPerson))
            {
                CameraMotorTypeFirstPerson fpsMotor = (CameraMotorTypeFirstPerson)motor.cameraMotorType;
                fpsMotor.positionOffset   = this.positionOffset;
                fpsMotor.headbobPeriod    = this.period;
                fpsMotor.headbobAmount    = this.amount;
                fpsMotor.modelManipulator = this.modelManipulator;
            }

            return(true);
        }
Ejemplo n.º 4
0
        // EXECUTABLE: ----------------------------------------------------------------------------

        public override bool InstantExecute(GameObject target, IAction[] actions, int index)
        {
            CameraMotor motor = (this.mainCameraMotor ? CameraMotor.MAIN_MOTOR : this.cameraMotor);

            if (motor != null && motor.cameraMotorType.GetType() == typeof(CameraMotorTypeTarget))
            {
                CameraMotorTypeTarget targetMotor = (CameraMotorTypeTarget)motor.cameraMotorType;
                targetMotor.anchorDistance   = this.anchorDistance;
                targetMotor.horizontalOffset = this.horizontalOffset;
                targetMotor.anchor           = this.anchor;
                targetMotor.target           = this.target;
            }

            return(true);
        }
Ejemplo n.º 5
0
        // EXECUTABLE: ----------------------------------------------------------------------------

        public override bool InstantExecute(GameObject target, IAction[] actions, int index)
        {
            if (HookCamera.Instance != null)
            {
                CameraController cameraController = HookCamera.Instance.Get <CameraController>();
                if (cameraController != null)
                {
                    CameraMotor motor = null;
                    if (this.mainCameraMotor)
                    {
                        motor = CameraMotor.MAIN_MOTOR;
                    }
                    else
                    {
                        switch (this.from)
                        {
                        case CameraMotorFrom.CameraMotor:
                            motor = this.cameraMotor;
                            break;

                        case CameraMotorFrom.Variable:
                            GameObject value = this.variable.Get(target) as GameObject;
                            if (value != null)
                            {
                                motor = value.GetComponent <CameraMotor>();
                            }
                            break;
                        }
                    }

                    if (motor != null)
                    {
                        cameraController.ChangeCameraMotor(
                            motor,
                            this.transitionTime
                            );
                    }
                }
            }

            return(true);
        }
Ejemplo n.º 6
0
        // INITIALIZE: ----------------------------------------------------------------------------

        public void Initialize(CameraMotor cameraMotor)
        {
            this.cameraMotor = cameraMotor;
        }