IEnumerator Start() { if (LeadingFrog) { Level1Manager.NextTurn += () => StartCoroutine(WaitAndStartNextTurn()); while (Level1Manager.Instance == null) { yield return(new WaitForEndOfFrame()); } GameObject go = Level1Manager.Instance.GetFreeKuvshinka(); transform.SetParent(go.transform); transform.localPosition = Vector3.zero; Level1Manager.Instance.SetLeadingFrogPosition(go); yield return(new WaitForSecondsRealtime(2.0f)); Level1Manager.NextTurn(); } else { Level1Manager.CorrectKuvshinkaPointed += NextJump; while (Level1Manager.Instance == null) { yield return(new WaitForEndOfFrame()); } GameObject go = Level1Manager.Instance.GetFreeKuvshinka(); transform.SetParent(go.transform); transform.localPosition = Vector3.zero; Level1Manager.Instance.SetMyFrogPosition(go); while (Level1Manager.NextTurn == null) { yield return(new WaitForEndOfFrame()); } } }
void Awake() { zastavka.gameObject.SetActive(true); Instance = this; _rightWay = new ArrayList(); ActiveObjectPointed += KuvshinkaPointed; ResetAttempts(); Init(); foreach (var digit in digits) digit.SetActive(false); }
void Awake() { if (!instance) { instance = this; } else { Destroy(gameObject); } }
IEnumerator RotateAndJump(GameObject go) { var target = go.transform.position - RotationPoint.transform.position; var angle = Vector3.Angle(transform.up, target); if (FrogAnimator != null) { FrogAnimator.Play("Rotate"); } yield return(new WaitForSeconds(0.1f)); if (RotationSpeed < 0.1) { RotationSpeed = 1f; } for (var i = 0; i < (int)(angle / RotationSpeed); i++) { transform.RotateAround(RotationPoint.position, Vector3.Cross(transform.up, target), RotationSpeed); // вескторное произведение чтобы определить направление поворота yield return(new WaitForSeconds(1f / 30f)); // частота кадров анимации поворота } if (FrogAnimator != null) { FrogAnimator.Play("Jump"); } for (var i = 0; i < 15; i++) // количество кадров анимации прыжка { transform.Translate(target / Mathf.Pow(2.005f, i + 1f), Space.World); yield return(new WaitForSeconds(1f / 30f)); // частота кадров анимации прыжка } transform.SetParent(go.transform); transform.localPosition = Vector3.zero; if (!LeadingFrog) { if (Level1Manager.Instance.LevelDownText.gameObject.activeSelf) { Level1Manager.Instance.LevelDownText.gameObject.SetActive(false); yield break; } Level1Manager.NextTurn(); } else { if (Level1Manager.Instance.CurrentJumpsBeforeNextLevel < 1) { Level1Manager.Instance.LevelUp(); } else { Level1Manager.Instance.Idle = true; } } }
public void PointerDownReceived() { if (!Level1Manager.Instance.Idle) { return; // пока лягушка прыгает не принимаем нажатия } if (GameObjectToSend == null) { GameObjectToSend = gameObject; } Level1Manager.ActiveObjectPointed(GameObjectToSend); }
void Awake() { zastavka.gameObject.SetActive(true); Instance = this; _rightWay = new ArrayList(); ActiveObjectPointed += KuvshinkaPointed; ResetAttempts(); Init(); foreach (var digit in digits) { digit.SetActive(false); } }
private void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } soundEffects = GetComponent <AudioSource>(); myLevel = 1; }
void Start() { text = GetComponent <Text>(); GameOverText.GetComponent <Text>().enabled = false; PlayerHealth = MaxPlayerHealth; LevelManager = FindObjectOfType <Level1Manager>(); LifeSystem = FindObjectOfType <LifeManager>(); isDead = false; }
private void Start() { //currentHappiness = GetComponent<Image>(); manager = GetComponent <Level1Manager>(); happyMax = 100f; maxHappiness = 100f; UpdateHappiness(); aMessage.text = "Good Morning"; bMessage.text = ""; messagec.text = ""; messaged.text = ""; minutes = 0; hours = 8; timer.text = hours + ":" + minutes.ToString("f0") + "AM"; inBed = false; }
//public Dialog dialog; //private ObjectPooler OP; private void Awake() { Instance = this; }
void Start() { level1Manager = this; GameManager.gameManager.StartNarrative(); }
// populating it void Start() { Level1Manager = FindObjectOfType <Level1Manager>(); }