Ejemplo n.º 1
0
    private void Awake()
    {
        if (instance != null)
        {
            Debug.LogWarning("Multiple instances of " + this + "found");
        }

        instance = this;
    }
Ejemplo n.º 2
0
 // 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();
 }
Ejemplo n.º 4
0
 // Use this for initialization
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(this);
     }
     ducks = new List <GameObject>(GameObject.FindGameObjectsWithTag("Duck"));
 }
Ejemplo n.º 5
0
    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
    }
Ejemplo n.º 6
0
    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
Ejemplo n.º 7
0
 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));
 }