protected override void ReleaseActiveWorker(Worker w) { if (activeWorker != null) { VisualWorker vw = activeWorker.visualRepresentation.GetComponent <VisualWorker>(); vw.HandleNewWord(); } base.ReleaseActiveWorker(w); }
public IEnumerator DoGameWin(VisualWorker w, RectTransform t, float time = 1f) { gameObject.SetActive(true); transform.position = t.position; transform.localScale = t.localScale; transform.DOMove(defaultPosition, time); transform.DOScale(defaultScale, time); anim.SetCharacter(w.anim.CharacterIndex); yield return(new WaitForSeconds(time + 0.5f)); anim.Play(); yield return(new WaitForSeconds(1f)); }
public IEnumerator DoGameOver(VisualWorker w, RectTransform t, float time = 1f) { gameObject.SetActive(true); transform.position = t.position; transform.localScale = t.localScale; transform.DOMove(defaultPosition, time); transform.DOScale(defaultScale, time); anim.SetCharacter(w.anim.CharacterIndex); yield return(new WaitForSeconds(time + 0.5f)); src.PlayOneShot(firedSound, 0.35f); firedGraphics.alpha = 1f; transform.DOScale(transform.localScale * 0.8f, 0.1f).SetEase(Ease.OutQuad); yield return(new WaitForSeconds(0.1f)); transform.DOScale(defaultScale, 0.25f).SetEase(Ease.OutQuad); }