public IEnumerator ScaleCheckMain() { for (; ;) { yield return(new WaitForSeconds(1f)); if (transform.localScale.x == fjGrow.checkSize && State == GrowState.WORKING) { GetComponentInParent <SkinnedMeshRenderer>().enabled = true; //fjGrow.GrowShrinkSpeed = time_Value; 테스트 fjGrow.GrowShrinkSpeed = tmpTime; fjGrow.StartGrowing(); State = GrowState.MIDDLE; } if (transform.localScale.x >= 0.5f && State == GrowState.MIDDLE) { for (int i = 0; i < 5; i++) { StartCoroutine(Bending(tailBones[i])); } State = GrowState.END; } if (transform.localScale.x >= 1f && State == GrowState.END) { GetComponent <FTail_Animator>().enabled = true; yield break; } } }
private void FixedUpdate() { if (transform.localScale.x == mainbranch.checkSize && State == MGrowState.WORKING) { Debug.Log("1"); GetComponentInParent <SkinnedMeshRenderer>().enabled = true; mainbranch.GrowShrinkSpeed = 0.05f; mainbranch.StartGrowing(); State = MGrowState.MIDDLE; } if (transform.localScale.x >= 0.1f && State == MGrowState.MIDDLE) { Leafcheck(); } if (transform.localScale.x == 1f && State == MGrowState.END) { Debug.Log("d"); State = MGrowState.IDLE; return; } }
public IEnumerator StartGrow() // 성장 시작 { yield return(new WaitForSeconds(1f)); GetComponentInParent <SkinnedMeshRenderer>().enabled = true; fjGrow.GrowShrinkSpeed = 0.5f; fjGrow.StartGrowing(); StartCoroutine(TailAniON()); bendingstart = true; yield break; }
public IEnumerator UP() { yield return(new WaitForSeconds(1f)); int branchcnt = 12; foreach (FJiggling_Grow a in bones) { a.GrowShrinkSpeed = 0.3f; } now.StartGrowing(); while (cnt < 13) { if (now.GetComponent <Transform>().transform.localScale.x >= 1f) { yield return(new WaitForFixedUpdate()); switch (now.gameObject.tag) { case "branch": bones[branchcnt].StartGrowing(); branchcnt--; break; case "end": now.GetComponentInChildren <MegaCacheOBJ>().animate = true; break; } if (cnt == 12) { Debug.Log(cnt); yield break; } now = bones[cnt]; now.StartGrowing(); cnt++; } yield return(new WaitForFixedUpdate()); } }
public IEnumerator CheckScale() { yield return(new WaitForSeconds(0.1f)); fjGrow.StartGrowing(); while (transform.localScale.z <= 1f) { if (transform.localScale.z == 1f) { b = Mathf.Floor(transform.localScale.z * 10f) * 0.1f; Debug.Log(b); yield break; } b = Mathf.Floor(transform.localScale.z * 10f) * 0.1f; Debug.Log(b); yield return(new WaitForSeconds(0.1f)); } }