예제 #1
0
 // Update is called once per frame
 IEnumerator myUpdate()
 {
     while (x < 1.1f)
     {
         this.transform.position = mylerp(Vector3.zero, tarpos, StripUtils.getInterpolation(x));
         Debug.Log(x);
         Debug.Log(StripUtils.getInterpolation(x));
         x += 0.01f;
         yield return(new WaitForSeconds(1));
     }
 }
예제 #2
0
    private IEnumerator BackToOrigin()
    {
        float   curtime     = 0.0f;
        float   springinput = 0.0f;
        Vector3 tmpPos      = this.pos;

        //while (Vector3.Distance(this.oriPos,this.pos) >= backDelta)
        while (springinput < 1 && curtime < coroutineBreakTime)
        {
            curtime += Time.deltaTime;
            float w = StripUtils.getInterpolation(springinput);
            this.Pos     = StripUtils.mylerp(tmpPos, this.oriPos, w);
            springinput += 0.009f;
            yield return(new WaitForEndOfFrame());
        }
        this.pos = this.oriPos;
    }