// Start is called before the first frame update void Start() { //will control direction of bullet based of the direction the player is moving in //will not need anything else here shoot.velocity = transform.right * thrust; //only one instance of these managers score = FindObjectOfType <scoreManager>(); health = FindObjectOfType <healthManager>(); sound = FindObjectOfType <AudioManager>(); }
// Start is called before the first frame update void Start() { //get all options for path pathPoints = GameObject.Find("TractorPath"); followThis = pathPoints.GetComponentsInChildren <Transform>(); //just generate a random spot to move next nextMove = RNG(); //access managers for update on collision score = FindObjectOfType <scoreManager>(); health = FindObjectOfType <healthManager>(); sound = FindObjectOfType <AudioManager>(); }
// Start is called before the first frame update void Start() { //find the managers for correct health, score keeping and playing sounds on collision score = FindObjectOfType <scoreManager>(); health = FindObjectOfType <healthManager>(); sound = FindObjectOfType <AudioManager>(); //give it a random speed //gameobjects managed by colliders rb = gameObject.GetComponent <Rigidbody2D>(); rb.velocity = transform.right * truckSpeed; }
void Awake() { if (instance) { Destroy(this.gameObject); } else { instance = this; } UpdateHealth(); }
// Start is called before the first frame update void Start() { //set initial speed speed = 1.0f; //get the path pathPoints = GameObject.Find("AmbulancePath"); //get all options for path followThis = pathPoints.GetComponentsInChildren <Transform>(); //access the managers for functionality score = FindObjectOfType <scoreManager>(); health = FindObjectOfType <healthManager>(); sound = FindObjectOfType <AudioManager>(); }
// Use this for initialization void Start() { player = FindObjectOfType <PlayerController> (); manager = FindObjectOfType <healthManager> (); }
void Start() { player = FindObjectOfType <playerController> (); health = PlayerPrefs.GetInt("CurrentHealth"); h_manager = FindObjectOfType <healthManager> (); }
void Start() { rb2D = GetComponent <Rigidbody2D>(); health = GetComponent <healthManager>(); }