// Update is called once per frame void Update() { if (sphereMovementScript.getPoints() == 9 && velocity == -1) { moveDown(); } }
public void restoreNewInstance() { newObj = Instantiate(prefab, sphereMovementScript.getStartPos(), Quaternion.identity); int oldPoints = sphereMovementScript.getPoints(); sphereMovementScript = FindObjectOfType(typeof(SphereMovement)) as SphereMovement; sphereMovementScript.setPoints(oldPoints); }
private void FixedUpdate() { sphereMovementScript = FindObjectOfType(typeof(SphereMovement)) as SphereMovement; coins_text.text = "COINS: " + sphereMovementScript.getPoints(); }