Esempio n. 1
0
 /// <summary>
 /// Set the main camera based on a given camera extension script
 /// </summary>
 /// <access>public static void</access>
 /// <param name="cameraExtension" type="CameraExtension">The camera extension script attached to the new main camera</param>
 public static void Set(CameraExtension cameraExtension)
 {
     MainCamera.Camera              = cameraExtension.Camera;
     MainCamera.Extension           = cameraExtension;
     MainCamera.Focus               = cameraExtension.GetComponent <CameraFocus>();
     MainCamera.Area                = cameraExtension.GetComponent <CameraArea>();
     MainCamera.Shake               = cameraExtension.GetComponent <CameraShake>();
     cameraExtension.gameObject.tag = mainCameraTag;
 }
Esempio n. 2
0
        /// <summary>Get CameraFocus and CameraArea components</summary>
        /// <access>public override void</access>
        public override void Initialize()
        {
            extension = GetComponent <CameraExtension>();
            focus     = GetComponent <CameraFocus>();
            area      = GetComponent <CameraArea>();
            shake     = GetComponent <CameraShake>();

            if (focus != null)
            {
                extension.Pan      = focus.BaseFocalPoint.transform.position;
                targetMovePosition = extension.Pan;
            }
        }