// Start is called before the first frame update void Start() { catSprite = GameManager.singleton.GetNewCat(); catSprite.transform.parent = this.gameObject.transform; catSprite.transform.localPosition = Vector3.zero; breedingAparatus = GetComponent <CatMultiply>(); catMove = GetComponent <CatAI>(); }
// Update is called once per frame void Update() { if (state == State.menu) { StartCoroutine(Fade(true)); score = 4; } else if (state == State.game) { if (timer > 0) { //catometer.GetComponent<Slider>().value = timer / 60.0f; timer -= Time.deltaTime; if (slider) { slider.sizeDelta = new Vector2((timer / maxTimer) * 750f, slider.sizeDelta.y); } } else { state = State.end; } for (int i = 0; i < hornyCats.Count - 1; i++) { GameObject cat = hornyCats[i]; CatMultiply firstCatGenitals = cat.GetComponent <CatMultiply>(); if (firstCatGenitals.enabled && firstCatGenitals.makeBaby) { for (int j = i + 1; j < hornyCats.Count; j++) { GameObject otherCat = hornyCats[j]; CatMultiply secondCatGenitals = otherCat.GetComponent <CatMultiply>(); if (secondCatGenitals.enabled && secondCatGenitals.makeBaby) { if (Vector2.Distance(cat.transform.position, otherCat.transform.position) < matingHitbox) { firstCatGenitals.makeBaby = false; secondCatGenitals.makeBaby = false; makeNewCat((cat.transform.position + otherCat.transform.position) / 2, cat, otherCat); } } } } } for (int i = hornyCats.Count - 1; i >= 0; i--) { if (!hornyCats[i].GetComponent <CatMultiply>().makeBaby) { hornyCats.RemoveAt(i); } } // } //else // { // timerText.text = "0.00"; // state = State.end; // } } else if (state == State.end) { StartCoroutine(Fade(false)); } }