Exemplo n.º 1
0
    //Constructor
    private Managers()
    {
        if (m_managers == null)
        {
            m_managers = GameObject.FindGameObjectWithTag("Managers");

            if (m_managers == null)
            {
                //Create the gameObject
                m_managers = GameObject.Instantiate(Resources.Load("Prefabs/GamePrefabs/Managers")) as GameObject;
                m_managers.name = "Managers";

                //If the managers is not created, then ERROR
                Assert.assert(m_managers != null, "Error creating the Managers");
            }

            m_GameMgr = m_managers.GetSafeComponent<gameMgr>();
            m_InputMgr = m_managers.GetSafeComponent<inputMgr>();
            m_SpawnerMgr = m_managers.GetSafeComponent<spawnerMgr>();
            m_GameStateMgr = m_managers.GetSafeComponent<gameStateMgr>();
            m_StorageMgr = m_managers.GetSafeComponent<storageMgr>();
            m_SceneMgr = m_managers.GetSafeComponent<sceneMgr>();
            m_TimeMgr = m_managers.GetSafeComponent<timeManager>();

            //This object is not destroyed between scenes
            GameObject.DontDestroyOnLoad(m_managers);
        }
    }
Exemplo n.º 2
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        timeManager myScript = (timeManager)target;

        if (GUILayout.Button("Play"))
        {
            myScript.Play();
        }

        if (GUILayout.Button("Pause"))
        {
            myScript.Pause();
        }

        if (GUILayout.Button("Rewind"))
        {
            myScript.Rewind();
        }

        if (GUILayout.Button("FF"))
        {
            myScript.FastForward();
        }
    }
Exemplo n.º 3
0
 void Update()
 {
     AtackEnemy();
     //test for update rate gun
     if (Input.GetButtonDown("Fire2"))
     {
         tm         = new timeManager(1, 100);
         isShootYet = false;
     }
 }
Exemplo n.º 4
0
    // Use this for initialization
    void Start()
    {
        Loader          = GetComponent <levelLoader>();
        timeMan         = GetComponent <timeManager>();
        EventDispatcher = GetComponent <EventManager>();

        BindToEvents();

        //PreLoadInitialiseGame();
        PostLoadInitialiseGame();
    }
Exemplo n.º 5
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
 }
Exemplo n.º 6
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }

        if (this != instance)
        {
            Destroy(this.gameObject);
        }
    }
Exemplo n.º 7
0
    // Use this for initialization
    void Start()
    {
        melodyPlayable = false;
        rythmPlayable  = false;
        inputReady     = false;
        GetToneSets();
        AudioSetup();

        startMusic = false;

        mainTrackTime = drumClip.length;

        mainTrackTimer   = 0;
        beatTimer        = beatInterval;
        melodicBeatTimer = melodicBeatInterval;
        rythmBeatTimer   = rythmBeatInterval;

        playApplause = false;

        timeSetter      = GetComponent <timeManager>();
        fireworkManager = GetComponent <FireworkManager>();
        countDown       = GetComponent <IntroCountDown>();
    }
Exemplo n.º 8
0
 // Start is called before the first frame update
 void Start()
 {
     _camera = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Camera>();
     _shoot  = new Shoot(gameObject);
     tm      = new timeManager(_shootDelay, _shootPeriod);
 }
Exemplo n.º 9
0
 // Use this for initialization
 void Start()
 {
     gameTimer = GameObject.Find("TimeManager").GetComponent <timeManager>();
     pillBonus = GetComponent <AudioSource>();
 }
Exemplo n.º 10
0
 // Use this for initialization
 void Start()
 {
     tm      = GameObject.Find("TimeManager").GetComponent <timeManager> ();
     es      = GameObject.Find("successPlatform").GetComponent <endSound> ();
     myaudio = GetComponent <AudioSource>();
 }
Exemplo n.º 11
0
 // Use this for initialization
 void Start()
 {
     gameTimer = GameObject.Find("TimeManager").GetComponent <timeManager>();
     myaudio   = GameObject.Find("pillAudio").GetComponent <AudioSource>();
     mylight   = GameObject.Find("pillLight");
 }
Exemplo n.º 12
0
 void Awake()
 {
     myInstance = this;
 }
Exemplo n.º 13
0
 private void SetDelayShoot()
 {
     tm = new timeManager(_shootDelay, _shootPeriod);
     tm.StartTimerWithOutDispose(this);
 }
Exemplo n.º 14
0
 // Start is called before the first frame update
 void Awake()
 {
     instance       = this;
     Time.timeScale = 1f;
     timpPlaying    = false;
 }