protected virtual void Awake() { if (Main == null) { Main = this; } if (Cam == null) { Cam = GetComponent <Camera> (); } if (Cam == null) { GeneralActive = false; enabled = false; Debug.LogError("FlexCam: No 'camera' component found! Script disabled."); } else if (Player == gameObject) { GeneralActive = false; enabled = false; Debug.LogError("FlexCam: The camera and player GameObjects may not be identical!"); } if (Restrictor == null) { Restrictor = GetComponent <FlexCamRestrictor> (); } if (Restrictor == null) { RestrictionActive = false; } if (ActivationCurve == null) { ActivationCurve = AnimationCurve.EaseInOut(0, 0, 1, 1); } Player = PlayerObject; CameraState = GeneralActive; }
// --- Internal Basics ------------------------------------------------------------------------------------------------------------------------------- void Awake() { if (Cam != null) { return; } Cam = GetComponent <FlexCam> (); if (Cam == null) { Cam = FlexCam.Main; } if (Cam == null) { enabled = false; } }