public IEnumerator ScaleCheckMain()
    {
        for (; ;)
        {
            yield return(new WaitForSeconds(1f));

            if (transform.localScale.x == branch.checkSize && State == BranchGrowState.WORKING)
            {
                GetComponentInParent <SkinnedMeshRenderer>().enabled = true;
                branch.GrowShrinkSpeed = 0.1f;
                branch.StartGrowing();
                State = BranchGrowState.MIDDLE;
            }

            if (transform.localScale.x >= 0.3f && State == BranchGrowState.MIDDLE)
            {
                for (int i = 0; i < leaf.Length; i++)
                {
                    yield return(new WaitForSeconds(1f));

                    leaf[i].GrowShrinkSpeed = 0.25f;
                    leaf[i].StartGrowing();
                }

                State = BranchGrowState.END;
            }

            if (transform.localScale.x >= 1f && State == BranchGrowState.END)
            {
                Debug.Log("d");
                yield break;
            }
        }
    }
 private void FixedUpdate()
 {
     if (transform.localScale.x == branch.checkSize && State == BranchGrowState.WORKING)
     {
         GetComponentInParent <SkinnedMeshRenderer>().enabled = true;
         branch.GrowShrinkSpeed = 0.1f;
         branch.StartGrowing();
         State = BranchGrowState.MIDDLE;
     }
     else if (transform.localScale.x >= 0.2f && State == BranchGrowState.MIDDLE)
     {
         Leafcheck();
     }
     else if (transform.localScale.x == 1f && State == BranchGrowState.END)
     {
         Debug.Log("d");
         State = BranchGrowState.IDLE;
         return;
     }
     else
     {
         return;
     }
 }
    public void Leafcheck()
    {
        if (transform.localScale.x >= 0.2f && transform.localScale.x < 0.4f)
        {
            leaf[0].GrowShrinkSpeed = 0.25f;
            leaf[0].StartGrowing();
        }
        else if (transform.localScale.x >= 0.4f && transform.localScale.x < 0.6f)
        {
            leaf[1].GrowShrinkSpeed = 0.25f;
            leaf[1].StartGrowing();
        }
        else if (transform.localScale.x >= 0.6f)
        {
            leaf[2].GrowShrinkSpeed = 0.25f;
            leaf[2].StartGrowing();

            State = BranchGrowState.END;
        }
        else
        {
            return;
        }
    }
 private void Start()
 {
     State = BranchGrowState.WORKING;
 }