Esempio n. 1
0
    IEnumerator positionCheck()
    {
        while (true)
        {
            cachedPos = myTransform.position;
            yield return(new WaitForSeconds(0.1f));            //Update interval set to 0.1 sec.

            if (cachedPos != myTransform.position)
            {
                root = rootGo.GetComponent <CatmullRomSpline>();
                root.AddNode(thisGameObject);
            }
        }
    }
Esempio n. 2
0
    void AddNodeToSpline()
    {
        if (root != null)
        {
            if (isPush)
            {
                root.PushNode(thisGameObject);
            }

            else
            {
                root.AddNode(thisGameObject);
            }
        }
        //StartCoroutine("positionCheck");
        //StartCoroutine("Destroy");
    }