Esempio n. 1
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Debug.LogError("MORE THAT ONE PLAYER IN SCENE");
        }

        currentControls = ControlSet.GetControls();
        currentControls.Start();
        canvas  = GameObject.FindWithTag("MainCanvas").GetComponent <Canvas>();
        speed   = canvas.transform.Find("Speed").GetComponent <Text>();
        scoreUI = canvas.transform.Find("Score").GetComponent <Text>();
        rb      = GetComponent <Rigidbody>();
        currentControls.moveInput += Move;
        currentControls.jumpInput += Boost;
    }