public void SetGameCamera(CustomCameraScript newCamera, float transitionTime)
    {
        if (newCamera == null) {
            return;
        }

        _camera.ResetProjectionMatrix ();
        if (currentCamera != null) {
            currentCamera.enabled = false;
        }
        newCamera.ResetRotation ();
        currentCamera = newCamera;

        _camera.farClipPlane = currentCamera._camera.farClipPlane;
        _camera.nearClipPlane = currentCamera._camera.nearClipPlane;
        _camera.orthographic = currentCamera._camera.orthographic;

        if (transitionTime > 0f)
        {
            SmoothChange (transitionTime);
        }
        else if (currentCamera != null)
        {
            SnapToAttached ();
        }
    }
    public void setValuesFromProperties(ObjectProperties newProp, Transform newTarget)
    {
        this.customCamera = newProp.customCamera;
        this.transitionTime = newProp.transitionTime;

        float offsetHorizontal = 0.0f;
        float offsetVertical = 0.0f;
        if (newTarget.parent) {
            offsetHorizontal = newTarget.parent.eulerAngles.y;
            offsetVertical = newTarget.parent.eulerAngles.x;
        }
    }
Esempio n. 3
0
 void Awake()
 {
     instance = this;
 }