// Start is called before the first frame update void Start() { //instantiates the ball object to the proper game object ball = GameObject.FindGameObjectWithTag("Player").GetComponent <BallPhysics>(); //instantiates the UI to the proper game object targetsLeft = GameObject.FindGameObjectWithTag("Score").GetComponent <TargetsLeftUI>(); //instantiates the scene object to get the active/current scene scene = SceneManager.GetActiveScene(); }
// Start is called before the first frame update void Start() { //create the game object for the UI (to get the score / # of targets left) targetsLeft = GameObject.FindGameObjectWithTag("Score").GetComponent <TargetsLeftUI>(); //create the scene object to get the active/current scene scene = SceneManager.GetActiveScene(); //creates the game object for the aim m_AimDisplay = GameObject.FindGameObjectWithTag("Aim").GetComponent <AimBehavior>(); //sets the variable for the ball's rigidbody m_rb = GetComponent <Rigidbody>(); Assert.IsNotNull(m_rb, "Houston, we've got a problem here! No Rigidbody attached"); //sets the aim original position to whatever position the aim is currently in (from the editor) m_vAimOriginalPos = m_AimDisplay.getPosition(); //sets the ball original position to whatever position the ball is currently in (from the editor) m_vOriginalPos = transform.position; }
// Start is called before the first frame update void Start() { //instantiates the scene (get the current scene) & UI objects (for the # of targets left) scene = SceneManager.GetActiveScene(); score = GameObject.FindGameObjectWithTag("Score").GetComponent <TargetsLeftUI>(); }