/// <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++; }
void Awake() { matController = GetComponentInChildren<ObjectMaterialController>(); if (matController == null) Debug.LogWarning("Cannot find an ObjectMaterialController for the mesh of " + this.name); }
/// <summary> /// Awake is being used to initialize all the reference the class needs, /// and to bring it to an initial state. /// </summary> void Awake() { _omc = gameObject.GetComponent <ObjectMaterialController>(); }
void Awake() { _isActivated = false; effects = GetComponentsInChildren<InteractiveEffect>(); activator = GetComponentInChildren<InteractiveActivator>(); hintHandler = GetComponent<HintHandler>(); matController = GetComponentInChildren<ObjectMaterialController>(); var physicsColliderTr = transform.Find("PhysicsCollider"); if(physicsColliderTr != null) physicsCollider = physicsColliderTr.GetComponent<Collider>(); }