// Use this for initialization void Start() { score = GetComponent <Text>(); rules = GameRukes.instance; //We have to send a reference to this instance to the sinleton so it knows where to sen information. rules.getAmmoBar(this); score.text = rules.getAmmo().ToString(); }
// Use this for initialization void Start() { //We relate this image to the singleton so we can send and give health informaion. //for the UI. rules = GameRukes.instance; rules.getHealthBar(this); UpdateHealth(); }
// Use this for initialization void Start() { //Get the gamerules singleton and the //instance of the UI. score = GetComponent<Text>(); rules = GameRukes.instance; rules.getScoreBar (this); }
// Use this for initialization void Start() { //get singleton rules = GameRukes.instance; //get target position at instantiation. target = rules.getPlayer() - transform.position; target.Normalize(); }
void Start() { rules = GameRukes.instance; //This gets us the direction towards the player. target = rules.getPlayer() - transform.position; //Then I add a random position along the x axis so I can give the enemy a sort of unexpected factor. target.x = Random.Range(-8, 0); target.Normalize(); }
void Awake() { //we instantly initialise our singleton. if (instance != null) { Debug.LogError("singleton already in"); } instance = this; //we have to reset our timescale because chances our we may have slowed it down at the end of the last game. //For the game over screen. Time.timeScale = 1.0f; }
// Use this for initialization void Start() { //Keep a reference of the game rules class because it's a singleton. rules = GameRukes.instance; }
// Use this for initialization void Start() { rules = GameRukes.instance; target = rules.getPlayer() - transform.position; }
// Use this for initialization void Start() { //We get our singleton rules and the box its collider. rules = GameRukes.instance; box = GetComponent <Collider2D> (); }
// Use this for initialization void Start() { rules = GameRukes.instance; }
// Use this for initialization void Start() { //Get game rules ship = GetComponent <Rigidbody2D>(); rules = GameRukes.instance; }