//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); } }
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(); } }
void Update() { AtackEnemy(); //test for update rate gun if (Input.GetButtonDown("Fire2")) { tm = new timeManager(1, 100); isShootYet = false; } }
// 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); } }
private void Awake() { if (instance == null) { instance = this; } if (this != instance) { Destroy(this.gameObject); } }
// 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>(); }
// 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); }
// Use this for initialization void Start() { gameTimer = GameObject.Find("TimeManager").GetComponent <timeManager>(); pillBonus = GetComponent <AudioSource>(); }
// Use this for initialization void Start() { tm = GameObject.Find("TimeManager").GetComponent <timeManager> (); es = GameObject.Find("successPlatform").GetComponent <endSound> (); myaudio = GetComponent <AudioSource>(); }
// Use this for initialization void Start() { gameTimer = GameObject.Find("TimeManager").GetComponent <timeManager>(); myaudio = GameObject.Find("pillAudio").GetComponent <AudioSource>(); mylight = GameObject.Find("pillLight"); }
void Awake() { myInstance = this; }
private void SetDelayShoot() { tm = new timeManager(_shootDelay, _shootPeriod); tm.StartTimerWithOutDispose(this); }
// Start is called before the first frame update void Awake() { instance = this; Time.timeScale = 1f; timpPlaying = false; }