//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);
        }
    }
示例#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();
        }
    }
示例#3
0
 void Update()
 {
     AtackEnemy();
     //test for update rate gun
     if (Input.GetButtonDown("Fire2"))
     {
         tm         = new timeManager(1, 100);
         isShootYet = false;
     }
 }
示例#4
0
    // Use this for initialization
    void Start()
    {
        Loader          = GetComponent <levelLoader>();
        timeMan         = GetComponent <timeManager>();
        EventDispatcher = GetComponent <EventManager>();

        BindToEvents();

        //PreLoadInitialiseGame();
        PostLoadInitialiseGame();
    }
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
 }
示例#6
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }

        if (this != instance)
        {
            Destroy(this.gameObject);
        }
    }
示例#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>();
    }
示例#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);
 }
示例#9
0
 // Use this for initialization
 void Start()
 {
     gameTimer = GameObject.Find("TimeManager").GetComponent <timeManager>();
     pillBonus = GetComponent <AudioSource>();
 }
示例#10
0
 // Use this for initialization
 void Start()
 {
     tm      = GameObject.Find("TimeManager").GetComponent <timeManager> ();
     es      = GameObject.Find("successPlatform").GetComponent <endSound> ();
     myaudio = GetComponent <AudioSource>();
 }
示例#11
0
 // Use this for initialization
 void Start()
 {
     gameTimer = GameObject.Find("TimeManager").GetComponent <timeManager>();
     myaudio   = GameObject.Find("pillAudio").GetComponent <AudioSource>();
     mylight   = GameObject.Find("pillLight");
 }
示例#12
0
 void Awake()
 {
     myInstance = this;
 }
示例#13
0
 private void SetDelayShoot()
 {
     tm = new timeManager(_shootDelay, _shootPeriod);
     tm.StartTimerWithOutDispose(this);
 }
示例#14
0
 // Start is called before the first frame update
 void Awake()
 {
     instance       = this;
     Time.timeScale = 1f;
     timpPlaying    = false;
 }