Esempio n. 1
0
 // Destroying the attached Behaviour will result in the game or Scene receiving OnDestroy
 private void OnDestroy()
 {
     // Nullify the singleton instance if needed
     if (Instance == this)
     {
         Instance = null;
     }
 }
Esempio n. 2
0
 public void OnEnable()
 {
     p_target              = (TDS_Camera)target;
     zForwardBoundProp     = serializedObject.FindProperty("zForwardBound");
     zBackwardBoundProp    = serializedObject.FindProperty("zBackwardBound");
     cameraOrientationProp = serializedObject.FindProperty("cameraOrientation");
     xOffsetProp           = serializedObject.FindProperty("xOffset");
     yOffsetProp           = serializedObject.FindProperty("yOffset");
     zOffsetProp           = serializedObject.FindProperty("zOffset");
     maxSpeedProp          = serializedObject.FindProperty("maxSpeed");
     doMoveOnZProp         = serializedObject.FindProperty("doMoveOnZ");
     Otarget = serializedObject.FindProperty("target");
 }
Esempio n. 3
0
 private void Awake()
 {
     // Set the instance if needed
     if (!Instance)
     {
         Instance = this;
     }
     else
     {
         TDS_CustomDebug.CustomDebugLog("There is already a camera instance in this scene ! Destroys CameraBehaviour script", "Lucas");
         Destroy(this);
         return;
     }
 }
Esempio n. 4
0
    // Awake is called when the script instance is being loaded
    private void Awake()
    {
        // Set the singleton instance if null
        if (!Instance)
        {
            Instance = this;
        }
        else
        {
            Destroy(this);
            return;
        }

        // Debug warning is missing bound(s)
        if (!topBound || !leftBound || !rightBound || !bottomBound)
        {
            Debug.LogWarning($"Missing bound(s) for the Camera \"{name}\"");
        }

        // Calculate aspect
        SetCameraAspect();
    }
Esempio n. 5
0
 private void OnDestroy()
 {
     // Nullifies the instance
     Instance = null;
 }