private void Awake() { if (instance != null) { Debug.LogWarning("Multiple instances of " + this + "found"); } instance = this; }
// Start is called before the first frame update void Start() { //sets the duck game manager object equal to duckmanager by using .find duckManagerObject = GameObject.Find("DuckManager"); //gets component of DuckManager mDuckManager = (DuckManager)duckManagerObject.GetComponent(typeof(DuckManager)); //sets m current changer to move to the left mCurrentChanger = StartCoroutine(MoveLeft(5.0f, 0.5f)); }
// Start is called before the first frame update void Start() { //sets the duckmanager to the script DuckManager duckmg = GameObject.FindGameObjectWithTag("DuckManager").GetComponent <DuckManager>(); //sets max health MaxHealth = 200f; //sets current health equal to max health CurrentHealth = MaxHealth; //and sets the health bar on screen equal to calcalute health method where it calculates the current health healthbar.value = CalculateHealth(); }
// Use this for initialization void Awake() { if (instance == null) { instance = this; } else { Destroy(this); } ducks = new List <GameObject>(GameObject.FindGameObjectsWithTag("Duck")); }
bool gameRunning; // is the game running, or in the menu void Start() { audioManager = AudioManager.instance; bulletManager = BulletManager.instance; duckManager = DuckManager.instance; juiceManager = JuiceManager.instance; timeManager = TimeManager.instance; // sets up singletons announcer = Announcer.instance; shooter = Shooter.instance; dog = Dog.instance; LoadMenu(); // loads the main menu }
private DuckManager duckManager; // Duck manager game object. private void Start() { // Finds duck manager game object using tag. GameObject duckManagerObject = GameObject.Find("DuckManager"); if (duckManagerObject != null) { // If the duck manager object it's not null take the component of it. duckManager = duckManagerObject.GetComponent <DuckManager>(); // Set score value to 1. scoreValue = 1; } // If the enemy manager object it's null display in console log. if (duckManager == null) { Debug.Log("Cannot find 'GameController' script"); } }// End of Start method
private void Awake() { Instance = this; }
// Start is called before the first frame update void Start() { duckManagerObject = GameObject.Find("DuckManager"); mDuckManager = (DuckManager)duckManagerObject.GetComponent(typeof(DuckManager)); mCurrentChanger = StartCoroutine(MoveRight(5.0f, 0.5f)); }