void Start() { //RGBMeterBehaviour = GameObject.Find("RGBMeter").GetComponent<RGBMeterBehaviour>(); GetComponent <Rigidbody>().velocity = new Vector3(0, 0, bulletVelocity); gameObject.GetComponent <Renderer>().material.color = bulletColor.getColor(); DestroyObject(gameObject, timeToLive); }
void Start() { gameObject.GetComponent <Rigidbody>().velocity = new Vector3(0, 0, -1 * enemyMovementSpeed); gameObject.GetComponent <Renderer>().material.color = enemyColor.getColor(); incorrectHits = 0; audioSources = gameObject.GetComponents <AudioSource>(); correct = audioSources[0]; incorrect = audioSources[1]; enemyDeath = audioSources[2]; }
void Start() { gameObject.GetComponent <Rigidbody>().velocity = new Vector3(0, 0, -1 * enemyMovementSpeed); enemyColor = JuggernautColors[colorIndex]; gameObject.GetComponent <Renderer>().material.color = enemyColor.getColor(); gameObject.transform.localScale = new Vector3(2f + colorIndex * 0.2f, 2f + colorIndex * 0.2f, 2f + colorIndex * 0.2f); incorrectHits = 0; audioSources = gameObject.GetComponents <AudioSource>(); correct = audioSources[0]; incorrect = audioSources[1]; enemyDeath = audioSources[2]; }
public void Correct() { if (colorIndex == 0) { GameObject.Find("GameManager").GetComponent <GameManager>().increasePlayerLives(1); GameObject.Find("GameManager").GetComponent <GameManager>().increaseScore(scoreValue); EnemySpawner.GetComponent <EnemySpawner>().CorrectHit(); Die(); } else { EnemySpawner.GetComponent <EnemySpawner>().CorrectHit(); correct.Play(); colorIndex--; enemyColor = JuggernautColors[colorIndex]; gameObject.GetComponent <Renderer>().material.color = enemyColor.getColor(); gameObject.transform.localScale = new Vector3(2f + colorIndex * 0.2f, 2f + colorIndex * 0.2f, 2f + colorIndex * 0.2f); } }
void UpdateColor() { gameObject.GetComponent <Renderer>().material.color = playerColor.getColor(); }
public void UpdateColor() { gameObject.GetComponent <Renderer>().material.color = splitterColor.getColor(); }