Exemplo 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;
     }
 }
Exemplo 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");
 }
Exemplo 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;
     }
 }
Exemplo 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();
    }
Exemplo n.º 5
0
 private void OnDestroy()
 {
     // Nullifies the instance
     Instance = null;
 }