/// <summary> /// Awake is being used to initialize all the reference the class needs, /// and to bring it to an initial state. /// </summary> void Awake() { _timer = 0f; _placed = false; _orginalProjectileMode = true; _currentProjectile = _projectiles[0]; _currentProjectileDamage = _projectileDamages[0]; _currentShootPace = _projectilesShootPaces[0]; _spawner = GetComponentInChildren <ProjectileSpawner>(); _targetFinder = GetComponentInChildren <TargetFinder>(); _omc = GetComponent <ObjectMaterialController>(); _rotation = GetComponentInChildren <Transform>(); _transforms = GetComponentsInChildren <Transform>(); _damageMultiplier = 1f; _shootPaceMultiplier = 1f; _collids = false; level = 1; sellValue = costs / 2; upgradeCost = costs / 2; health = initialHealth; _omc.SetBaseMaterial(_placedMaterial); _spawner.SetProjectileSpeed(_projectileSpeed); _spawner.SetProjectileDamage(_currentProjectileDamage); _spawner.SetProjectile(_currentProjectile); SetLayerToPlaceMode(); }
/// <summary> /// Awake is being used to initialize all the reference the class needs, /// and to bring it to an initial state. /// </summary> protected void Awake() { _omc = gameObject.GetComponent <ObjectMaterialController>(); _gc = GameObject.Find("GameManager").GetComponent <GameManager>(); CalculateMultipliesAccordingToLevel(); ResetEnemy(); _omc.SetBaseMaterial(enemyMaterial); _waypointIndex = startingWaypoint - 1; _target = Waypoints.waypoints[_waypointIndex]; _waypointIndex++; }