private void OnEnable() { if (Instance == null) { Instance = this; } }
void Start() { if (actionFX == null) { Debug.LogWarning("FixedDamagerAction '" + name + "' has no action FX attached."); } GameObject gameCameraObj = GameObject.FindGameObjectWithTag("MainCamera"); if (!gameCameraObj || !gameCameraObj.GetComponent<CameraMoves>()) { Debug.LogError("Unable to intiailize FixedDamageAction: Can't find camera with tag MainCamera, or camera doesn't have CameraMoves action attached."); } gameCamera = gameCameraObj.GetComponent<CameraMoves>(); }