public void MovePlayerTo() { playerSpriteRenderer.enabled = true; playerSpriteRenderer.sprite = mainGraphic; Stats s = (Stats)DayManager.Instance.DedicatedStatIndex; Transform t = null; switch (s) { case Stats.SOCIAL: t = doorTransform; break; case Stats.SLEEP: t = bedTransform; break; case Stats.SUCCESS: t = deskTransform; break; default: t = doNothingTransform; break; } CoroutineManager.BeginCoroutine(LerpTo(playerTransform, t.position, 1.0f, s), ref cr_Moving, this); }
public void SetEvent(GameEvent ev) { eventNameText.text = ev.eventName; eventDescriptionText.text = ev.description; img.color = GameEventManager.Instance.GetEventColour(ev.colourClassification); CoroutineManager.BeginCoroutine(CoroutineManager.ShrinkScaleFrom(transform, popInSize, Vector3.one, popInTime), ref cr_Scale, this); }
private IEnumerator UpdateDistanceText() { WaitForSeconds wfs = new WaitForSeconds(0.2f); while (true) { yield return(wfs); for (int i = 0; i < PlayerManager.PlayerCount; i++) { Player p = PlayerManager.GetPlayer(i); float distance = p.transform.position.x; distanceTexts[i].text = distance.ToString("F2") + "m"; progressSliders[i].value = distance; if (p.CurrentVelocity == 0.0f && cr_ResetTimers[i] == null) { if (p.CurrentState == Player.PlayerStates.PLAYING) { CoroutineManager.BeginCoroutine(ResetTimer(i), ref cr_ResetTimers[i], this); } } else if (p.CurrentVelocity > 0.0f && cr_ResetTimers[i] != null) { CoroutineManager.HaltCoroutine(ref cr_ResetTimers[i], this); } } } }
public void SetTimeOfDay(TimeOfDay tod) { currentTimeOfDay_ = tod; dayLabel.text = "Day " + currentDay_.ToString(); dayTimeImage.sprite = dayTimeImages[(int)currentTimeOfDay_]; CoroutineManager.BeginCoroutine(CoroutineManager.ShrinkScaleFrom(dayTimeImage.transform, new Vector3(1.5f, 1.5f, 1.0f), Vector3.one, 0.25f), ref cr_DayTimeImage, this); }
/// <summary> /// Sets the label of the timer to reflect the time remaining. If withAnimation is true, will pulse with the change. /// </summary> /// <param name="text">What should the label read?</param> /// <param name="withAnimation">Should the new text animate?</param> public void SetLabelText(string text, bool withAnimation = true) { timerText.text = text; if (withAnimation) { CoroutineManager.BeginCoroutine(CoroutineManager.ShrinkScaleFrom(timerTextTransform, new Vector3(2.0f, 2.0f, 2.0f), Vector3.one, 1.0f), ref cr_TextScaling, this); } }
// Start is called before the first frame update void Start() { cr_BeginPlayTimers = new Coroutine[PlayerManager.PlayerCount]; for (int i = 0; i < PlayerManager.PlayerCount; i++) { CoroutineManager.BeginCoroutine(BeginPlayTimer(i), ref cr_BeginPlayTimers[i], this); } }
private IEnumerator WaitThenMove() { transform.position = startPosition; outline.transform.localScale = new Vector3(3.0f / PlayerManager.PlayerCount, 3.0f / PlayerManager.PlayerCount, 1); yield return(new WaitForSeconds(1.0f)); CoroutineManager.BeginCoroutine(CREffects.ZoomToScale(outline.transform, outline.transform.localScale, Vector3.one, 0.2f), ref cr_Achievement, this); CoroutineManager.BeginCoroutine(CREffects.ZoomToPosition(transform, transform.position, homePosition, 0.2f), ref cr_MovePos, this); }
public void BeginPlay() { myCurrentState = PlayerStates.PLAYING; SetCurrentFunds(_runStartFunds * GetLevel()); pc.Propel(initialForce); audioSource.clip = launch; audioSource.Play(); handleInput = true; CoroutineManager.BeginCoroutine(CheckAchievementsRoutine(), ref cr_AchievementChecker, this); }
public void Achieve() { if (achieved) { return; } achieved = true; outline.color = achievedColour; plaque.color = plaque.color = new Color(plaque.color.r, plaque.color.g, plaque.color.b, 1.0f); actualGraphic.enabled = true; CoroutineManager.BeginCoroutine(WaitThenMove(), ref cr_waitTimer, this); }
// Start is called before the first frame update void Start() { for (int i = 0; i < PlayerManager.PlayerCount; i++) { PlayerManager.GetPlayer(i).FundsChanged += Player_FundsChanged; } CoroutineManager.BeginCoroutine(UpdateDistanceText(), ref cr_DistanceTimer, this); for (int i = 0; i < PlayerManager.PlayerCount; i++) { highImpactTexts[i].ResetText(); highImpactTexts[i].gameObject.SetActive(false); lowImpactTexts[i].ResetText(); lowImpactTexts[i].gameObject.SetActive(false); } if (cr_ResetTimers == null || cr_ResetTimers.Length != PlayerManager.PlayerCount) { cr_ResetTimers = new Coroutine[PlayerManager.PlayerCount]; } }
private void DelegateMethod() { Debug.Log("Test Item 1: GameObject Enabled: " + objectToShow.activeSelf.ToString()); CoroutineManager.BeginCoroutine(CREffects.SetActiveAfterDelay(objectToShow, !objectToShow.activeSelf, 2.0f, DelegateMethod), ref cr_Appear, this); }
public void ResetRun(int playerIndex) { OnRunReset(playerIndex); CoroutineManager.BeginCoroutine(BeginPlayTimer(playerIndex), ref cr_BeginPlayTimers[playerIndex], this); _currentState = GameStates.PRE_PLAY; }
void StartFadeIn() { CoroutineManager.BeginCoroutine(Fade(1.0f, 1.0f), ref cr_FadeIn, this); }
public void Victory() { CoroutineManager.BeginCoroutine(VictoryScreen(), ref cr_EndScreen, this); }
public void BeginAnimate() { CoroutineManager.BeginCoroutine(LifeTime(), ref cr_Animation, this); }
private void DelegateMethod() { Debug.Log("Test Item 2: Behaviour Enabled: " + behaviourToShow.enabled.ToString()); CoroutineManager.BeginCoroutine(CREffects.SetActiveAfterDelay(behaviourToShow, !behaviourToShow.enabled, 2.0f, DelegateMethod), ref cr_Appear, this); }
// Use this for initialization void Start() { CoroutineManager.BeginCoroutine(CREffects.ZoomToScale(transformToZoom, initialScale, targetScale, zoomTime, DelegateMethod), ref cr_ScaleZoom, this); }
private void DelegateMethod() { Debug.Log("Test Item 3: Particles Enabled: " + ps.emission.enabled.ToString()); CoroutineManager.BeginCoroutine(CREffects.SetActiveAfterDelay(ps, !ps.emission.enabled, 2.0f, DelegateMethod), ref cr_Appear, this); }
private void DelegateMethod() { Debug.Log("Test Item 5: Zooming to scale: " + targetScale.ToString()); CoroutineManager.BeginCoroutine(CREffects.SmoothZoomToScale(transformToZoom, initialScale, targetScale, smoothTime, maxSpeed, scaleError, DelegateMethod), ref cr_ScaleZoom, this); }
// Use this for initialization void Start() { CoroutineManager.BeginCoroutine(CREffects.SmoothZoomToScale(transformToZoom, initialScale, targetScale, smoothTime, maxSpeed, scaleError, DelegateMethod), ref cr_ScaleZoom, this); }
// Use this for initialization void Start() { objectToShow.SetActive(false); CoroutineManager.BeginCoroutine(CREffects.SetActiveAfterDelay(objectToShow, true, 2.0f, DelegateMethod), ref cr_Appear, this); }
private void GameManager_CurtainOpened(object sender, EventArgs e) { CoroutineManager.BeginCoroutine(StartDayTimer(), ref cr_BeginDay, this); }
// Use this for initialization void Start() { behaviourToShow.enabled = false; CoroutineManager.BeginCoroutine(CREffects.SetActiveAfterDelay(behaviourToShow, true, 2.0f, DelegateMethod), ref cr_Appear, this); }
/// <summary> /// Starts the timer. /// </summary> public void StartTimer() { CoroutineManager.BeginCoroutine(RunTimer(startFromTime), ref cr_timerRunning, this); }
public void FadeTo(float alpha) { CoroutineManager.BeginCoroutine(Fade(alpha, 1.0f), ref cr_Fade, this); }
public void LoadScene(string str) { CoroutineManager.BeginCoroutine(SceneTransition(str), ref cr_Transitoning, this); }
public void LoadScene(string scene) { sceneToLoad = scene; CoroutineManager.BeginCoroutine(FadeCurtainTo(1.0f, 1.0f), ref cr_FadeCurtain, this); CurtainClosed += LoadSceneFromEvent; }
// Use this for initialization void Start() { ParticleSystem.EmissionModule em = ps.emission; em.enabled = false; CoroutineManager.BeginCoroutine(CREffects.SetActiveAfterDelay(ps, true, 2.0f, DelegateMethod), ref cr_Appear, this); }
private void DelegateMethod() { Debug.Log("Test Item 4: Zooming to scale: " + targetScale.ToString()); CoroutineManager.BeginCoroutine(CREffects.ZoomToScale(transformToZoom, initialScale, targetScale, zoomTime, DelegateMethod), ref cr_ScaleZoom, this); }
private void SceneManager_sceneLoaded(Scene arg0, LoadSceneMode arg1) { CoroutineManager.BeginCoroutine(FadeCurtainTo(0, 1.0f), ref cr_FadeCurtain, this); }