Esempio n. 1
0
    RespawnPlayerSystem rps;      //RespawnPlayerSystem script

    // Start is called before the first frame update
    void Start()
    {
        //At the start, the Countdown Timer will be given a random time based on the range between the min and max times
        //We will get the component for RespawnPlayerSystem whenever the player has died or not
        countdownTimer = Random.Range(minTime, maxTime);
        rps            = GameObject.FindGameObjectWithTag("Respawn").GetComponent <RespawnPlayerSystem>();
    }
    bool canMoveRight;            //Used for the right button when pressed/released

    // Start is called before the first frame update
    void Start()
    {
        //At the start, we will get the components for the RespawnPlayerSystem script and Rigidbody as well as setting the animation speed to animSpeed
        rps        = GameObject.FindGameObjectWithTag("Respawn").GetComponent <RespawnPlayerSystem>();
        rb         = gameObject.GetComponent <Rigidbody>();
        anim.speed = animSpeed;
    }
    NextWaveSystem nws;                         //NextWaveSystem script

    void Start()
    {
        //Find the components of RespawnPlayerSystem and NextWaveSystem scripts
        rps = GameObject.FindGameObjectWithTag("Respawn").GetComponent <RespawnPlayerSystem>();
        nws = GameObject.FindGameObjectWithTag("WaveSpawner").GetComponent <NextWaveSystem>();
    }