Пример #1
0
    // Use this for initialization
    void Start()
    {
        this.timeBeforeNextSpawn = this.delaySpawn;

        gameMode = ((GameObject)GameObject.FindGameObjectWithTag("gamemode")).GetComponent<SorterGamemode>();
        sorterColors = gameMode.GetComponent<SorterColors>();
    }
Пример #2
0
 public void setColor(SorterColors.BallColor color, Material m)
 {
     if (this.GetComponent<Renderer>().material == null)
         Debug.Log("SorterBall : something is wrong here");
     this.color = color;
     this.GetComponent<Renderer>().material = m;
 }
Пример #3
0
    // Use this for initialization
    void Start()
    {
        gameMode = ((GameObject)GameObject.FindGameObjectWithTag("gamemode")).GetComponent<SorterGamemode>();
        sorterColors = gameMode.GetComponent<SorterColors>();

        this.GetComponent<Renderer>().material = sorterColors.getMaterial(color);

        coin = GameObject.Find("Coin").GetComponent<AudioSource>();
    }
Пример #4
0
 public void spawnBall(SorterColors.BallColor color)
 {
     GameObject ball = (GameObject)Instantiate(sorterBall, this.transform.position, Quaternion.identity);
     ball.GetComponent<SorterBall>().setColor(color, sorterColors.getMaterial(color));
 }