void Start() { clockManager = FindObjectOfType <ClockManager>(); uiManager = FindObjectOfType <UIManager>(); InvokeRepeating("SpawnGhosts", initialDelay, repeatRate); }
void Awake() { fadeImage = GameObject.Find("FadeImage").GetComponent<Image>(); daysText = GetComponent<Text>(); screenFader = GameObject.Find(Constants.Game.FADER_OBJECT).GetComponent<ScreenFader>(); clock = GameObject.Find("Clock").GetComponent<ClockManager>(); }
void Awake() { fadeImage = GameObject.Find("FadeImage").GetComponent <Image>(); daysText = GetComponent <Text>(); screenFader = GameObject.Find(Constants.Game.FADER_OBJECT).GetComponent <ScreenFader>(); clock = GameObject.Find("Clock").GetComponent <ClockManager>(); }
void Awake() { Instance = this; ActionToPerform = new List <Sc_Action>(); StartCoroutine(Sequencer()); }
// Use this for initialization void Start() { clockManager = ClockManager.instance; clockManager.onTimeChangedCallback += UpdateUI; UpdateUI(); }
public void onStop() { if (clock != null) { ClockManager.getInstance().RemoveClock(clock); } clock = null; }
public VMMainWindow(ClockManager clockManager, SoftwareBitmapSourceRender render) { manager = clockManager; imgRender = render; ResultImage = imgRender.Image; string rootPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Scripts\\Test1"); loadClockPack(rootPath); }
public ModuleLocator(TimeSpan defaultRunTime) { _clockManager = new ClockManager(defaultRunTime); _modules = new Dictionary <string, Tuple <object, object[]> >(); //event handler _clockManager.Added += _clockManager_Added; _clockManager.Expired += _clockManager_Expired; _clockManager.Removed += _clockManager_Removed; }
// Use this for initialization void Awake() { clock = GameObject.Find("Clock").GetComponent<ClockManager>(); hourToggle = GameObject.Find("Toggle").GetComponent<Toggle>(); volSlider = GameObject.Find("Slider").GetComponent<Slider>(); if(volSlider != null) volSlider.onValueChanged.AddListener(ChangeVolume); mplayer = GameObject.Find("PersistentDataObject").GetComponent<MusicPlayer>(); LoadPrefs(); }
private void initAllUI() { globalTimer = new Clock(0, 0, 1, 0, 100, 0); ClockManager.getInstance().addClock(globalTimer); uiMap.Add(UIType.EquipKnow, new UILayer(equipKnowUI)); uiMap.Add(UIType.TrainUI, new UILayer(trainUI)); uiMap.Add(UIType.CircuitUI, new UILayer(circuitUI)); uiMap.Add(UIType.GuideUI, new UILayer(guideUI)); //uiMap.Add(UIType.ExamUI, new UILayer(examUI)); }
void Awake() { if (instance != null) { Destroy(this.gameObject); } else { instance = this; } }
// Use this for initialization void Start() { Clock clock = new Clock(0, 0, 1, 0, 100, 0); ClockManager.getInstance().addClock(clock); clock.setTick(tick); GetComponent <UITool>().setPlayBtnClick(fall); }
void Start() { clockManager = FindObjectOfType <ClockManager>(); uiManager = FindObjectOfType <UIManager>(); levelManager = FindObjectOfType <LevelManager>(); hazard = FindObjectOfType <EnvironmentalHazard>(); player = GameObject.FindWithTag("Player"); uiManager.UpdateScoreText(currentScore); uiManager.UpdateSavingGraceCountText(savingGraceCount); }
// Use this for initialization void Awake() { clock = GameObject.Find("Clock").GetComponent <ClockManager>(); hourToggle = GameObject.Find("Toggle").GetComponent <Toggle>(); volSlider = GameObject.Find("Slider").GetComponent <Slider>(); if (volSlider != null) { volSlider.onValueChanged.AddListener(ChangeVolume); } mplayer = GameObject.Find("PersistentDataObject").GetComponent <MusicPlayer>(); LoadPrefs(); }
public void Reset() { StopAllCoroutines(); player = GameObject.FindObjectOfType <PlayerController>(); status = GameObject.FindObjectOfType <SliderController>(); clock = GameObject.FindObjectOfType <ClockManager>(); SetupActions(); if (actions.Count > 0) { StartCoroutine(UpdateInteractions()); } }
void Awake() { startingPosition = transform.position; daysRemaining = GameObject.Find("RemainingDays").GetComponent <DayCounterScript>(); eventSystem = GameObject.Find("EventSystem"); mplayer = GameObject.Find("PersistentDataObject").GetComponent <MusicPlayer>(); clock = GameObject.Find("Clock").GetComponent <ClockManager>(); pointer = GetComponent <SliderController>(); animator = GetComponent <Animator>(); gameManager = FindObjectOfType <GameManager>(); dialogController.gameObject.SetActive(true); playerOrientation = PlayerOrientation.Down; screenFader = GameObject.Find("Fader").GetComponent <ScreenFader>(); isForceSleeping = (PlayerPrefs.GetInt(Constants.Prefs.FORCE_SLEEPING, Constants.Prefs.Defaults.FORCE_SLEEPING) == 1); bool hasSavedGame = (PlayerPrefs.GetFloat(Constants.Prefs.GAME_TIME, Constants.Prefs.Defaults.GAME_TIME) > 0); if (hasSavedGame) { LoadPlayerData(); } bool hasChangedFloor = PlayerPrefs.GetInt(Constants.Prefs.CHANGING_FLOOR, Constants.Prefs.Defaults.CHANGING_FLOOR) == 1; if (isForceSleeping) { gameManager.Reset(); daysRemaining.ShowRemainingDays(); StartCoroutine(DisplayDailyMessage()); isForceSleeping = false; PlayerPrefs.SetInt(Constants.Prefs.FORCE_SLEEPING, Constants.Prefs.Defaults.FORCE_SLEEPING); SavePlayerData(); } else if (hasChangedFloor) { mplayer.StopLoopedFootsteps(); transform.position = new Vector3(-0.86f, 3.88f, 0f); playerOrientation = PlayerOrientation.Right; PlayerPrefs.SetInt(Constants.Prefs.CHANGING_FLOOR, Constants.Prefs.Defaults.CHANGING_FLOOR); SavePlayerData(); } UpdatePlayerAnimation(playerOrientation, false); }
static void Main(string[] args) { ClockManager clockManager = new ClockManager(); FirstSubscriber sub1 = new FirstSubscriber(); SecondSubscriber sub2 = new SecondSubscriber(); sub1.Register(clockManager); sub2.Register(clockManager); clockManager.SimulateTimeOut(5); Thread.Sleep(5000); clockManager.SimulateTimeOut(3); Thread.Sleep(5000); sub1.Unregister(clockManager); clockManager.SimulateTimeOut(4); Console.ReadKey(); }
private void Awake() { #region Singleton if (GameObject.FindObjectsOfType <ClockManager>().Length > 1) { Destroy(this); } else { instance = this; } #endregion RegisterListeners(); CheckForEditorClocks(); timezones = GetTimeZones(); dropdownData = TimezonesToDropdown(); SetDefaultTimeZone(); }
void Awake() { startingPosition = transform.position; daysRemaining = GameObject.Find("RemainingDays").GetComponent<DayCounterScript>(); eventSystem = GameObject.Find("EventSystem"); mplayer = GameObject.Find("PersistentDataObject").GetComponent<MusicPlayer>(); clock = GameObject.Find("Clock").GetComponent<ClockManager>(); pointer = GetComponent<SliderController>(); animator = GetComponent<Animator>(); gameManager = FindObjectOfType<GameManager>(); dialogController.gameObject.SetActive(true); playerOrientation = PlayerOrientation.Down; screenFader = GameObject.Find("Fader").GetComponent<ScreenFader>(); isForceSleeping = (PlayerPrefs.GetInt(Constants.Prefs.FORCE_SLEEPING, Constants.Prefs.Defaults.FORCE_SLEEPING) == 1); bool hasSavedGame = (PlayerPrefs.GetFloat(Constants.Prefs.GAME_TIME, Constants.Prefs.Defaults.GAME_TIME) > 0); if(hasSavedGame) { LoadPlayerData(); } bool hasChangedFloor = PlayerPrefs.GetInt(Constants.Prefs.CHANGING_FLOOR, Constants.Prefs.Defaults.CHANGING_FLOOR) == 1; if(isForceSleeping) { gameManager.Reset(); daysRemaining.ShowRemainingDays(); StartCoroutine(DisplayDailyMessage()); isForceSleeping = false; PlayerPrefs.SetInt(Constants.Prefs.FORCE_SLEEPING, Constants.Prefs.Defaults.FORCE_SLEEPING); SavePlayerData(); } else if (hasChangedFloor) { mplayer.StopLoopedFootsteps(); transform.position = new Vector3(-0.86f, 3.88f, 0f); playerOrientation = PlayerOrientation.Right; PlayerPrefs.SetInt(Constants.Prefs.CHANGING_FLOOR, Constants.Prefs.Defaults.CHANGING_FLOOR); SavePlayerData(); } UpdatePlayerAnimation(playerOrientation, false); }
public void startTimer() { clock = new Clock(0, 0, 1, 0, 100, 0); ClockManager.getInstance().addClock(clock); clock.setTick(tick); }
protected void Awake() { clock = FindObjectOfType <ClockManager>(); }
/** PUBLIC FUNCTIONS */ // * THIS IS THE INIT SCRIPT FOR THE ENGINE */ void Start() { referenceClock = GameObject.Find ("DigitalClock"); GameObject kidsvoice = GameObject.Find("kidsVoice"); soundManager = kidsvoice.GetComponent<SoundManager>(); GameObject bedTarget = GameObject.Find ("BedTarget"); playerHealth = bedTarget.GetComponent<PlayerHealth>(); if (referenceClock != null) { referenceClockManager = referenceClock.GetComponent<ClockManager>(); } cleanUpEndingCanvas(); resetGameState(); }
void Awake() { instance = this; }
public void Reset() { StopAllCoroutines(); player = GameObject.FindObjectOfType<PlayerController>(); status = GameObject.FindObjectOfType<SliderController>(); clock = GameObject.FindObjectOfType<ClockManager>(); SetupActions(); if(actions.Count > 0) { StartCoroutine(UpdateInteractions()); } }
public TextSpriteAnimationManager(TextSprite textSprite) { TextSprite = textSprite; ClockManager = new ClockManager(); }
// Setup variables and find child objects by tag and setup all the GameObject member variables private void Awake() { clockManager = GetComponentInParent <ClockManager>(); source = GetComponent <AudioSource>(); source.clip = timerSound; // Organises and sets up all variables of the clock (saving the user from having to pass them in manually) Transform[] childTransforms = GetComponentsInChildren <Transform>(); foreach (Transform t in childTransforms) { switch (t.tag) { // ANALOG case "Analog": analog = t.gameObject; break; case "Analog Time": analog_Time = t.gameObject; break; case "Analog Timer": analog_TimerStopwatch = t.gameObject; break; case "Hour": analog_HourHand = t.gameObject; break; case "Minute": analog_MinuteHand = t.gameObject; break; case "Second": analog_SecondHand = t.gameObject; break; // DIGITAL case "Digital": digital = t.gameObject; break; case "Digital Numbers": digital_Numbers = t.gameObject; break; case "Digital Period": digital_Period = t.gameObject; break; // SETTINGS case "Hideable Settings": hideableSettings = t.gameObject; break; case "Mode": mode = t.gameObject; break; case "Time Format": timeFormat = t.gameObject; break; case "Timer Format": timerStopwatchFormat = t.gameObject; break; case "Set Values": setValues = t.gameObject; break; case "Time Hour 12": timeHour12 = t.gameObject; break; case "Time Hour 24": timeHour24 = t.gameObject; break; case "Timer Hour Value": timerStopwatchHourValue = t.gameObject; break; case "Minute Value": minuteValue = t.gameObject; break; case "Second Value": secondValue = t.gameObject; break; case "Period Value": periodValue = t.gameObject; break; case "Stopwatch Settings": stopwatchSettings = t.gameObject; break; case "Start and Stop": startAndStop = t.gameObject; break; } } modeDropdown = mode.GetComponent <TMP_Dropdown>(); timeDropdown = timeFormat.GetComponent <TMP_Dropdown>(); timerStopwatchDropdown = timerStopwatchFormat.GetComponent <TMP_Dropdown>(); timeHour24Dropdown = timeHour24.GetComponent <TMP_Dropdown>(); timeHour12Dropdown = timeHour12.GetComponent <TMP_Dropdown>(); timerStopwatchHourDropdown = timerStopwatchHourValue.GetComponent <TMP_Dropdown>(); minuteDropdown = minuteValue.GetComponent <TMP_Dropdown>(); secondDropdown = secondValue.GetComponent <TMP_Dropdown>(); periodDropdown = periodValue.GetComponent <TMP_Dropdown>(); numberText = digital_Numbers.GetComponent <TextMeshProUGUI>(); numberTransform = numberText.GetComponent <RectTransform>(); periodText = digital_Period.GetComponent <TextMeshProUGUI>(); }