コード例 #1
0
ファイル: BulletBehaviour.cs プロジェクト: MauroOrlic/Chroma
 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);
 }
コード例 #2
0
 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];
 }
コード例 #3
0
    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];
    }
コード例 #4
0
 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);
     }
 }
コード例 #5
0
ファイル: PlayerController.cs プロジェクト: MauroOrlic/Chroma
 void UpdateColor()
 {
     gameObject.GetComponent <Renderer>().material.color = playerColor.getColor();
 }
コード例 #6
0
 public void UpdateColor()
 {
     gameObject.GetComponent <Renderer>().material.color = splitterColor.getColor();
 }