// Use this for initialization void Awake() { GameObject missleValuesObjectRef = GameObject.FindWithTag("ScriptManager"); if (missleValuesObjectRef != null) { _MVRef = missleValuesObjectRef.GetComponent <MissleValues>(); } else { Debug.Log("Cannot find MissleValues script"); } _camTransform = Camera.main.transform; _missle = this.gameObject; _missleSpeed = _MVRef.missleSpeed; }
private void Awake() { GameObject missleValuesObject = GameObject.FindWithTag("ScriptManager"); if (missleValuesObject != null) { _MVRef = missleValuesObject.GetComponent <MissleValues>(); } else { Debug.Log("Cannot find MissleValues script"); } _thisTransform = this.gameObject.transform; _timeBetweenMissles = Random.Range(_MVRef.minMissleFireRate, _MVRef.maxMissleFireRate); _droneRange = _MVRef.droneRange; _timeOfPreviousShot = 0f; }
private void Awake() { _MV = MissleValues.Instance; _missles = CreateList(_MV.prefab, _MV.poolSize); }