예제 #1
0
 public void slideOut(float time)
 {
     this.animTime      = time;
     this.animStartTime = Time.time;
     this.animType      = AnimTypes.OUT;
     this.destPosition  = this.outPosition;
 }
예제 #2
0
 public void slideIn(float time)
 {
     this.gameObject.SetActive(true);
     this.animTime         = time;
     this.animStartTime    = Time.time;
     this.rt.localPosition = this.inPosition;
     this.animType         = AnimTypes.OUT;
     this.destPosition     = this.startPosition;
 }
예제 #3
0
    private void CarryAnim(AnimTypes type, Player player)
    {
        switch (type)
        {
        case AnimTypes.twoHanded_front:
            player.animManager.ChangeToCarry_Front(transform);
            break;

        case AnimTypes.twoHanded_weapon:
            player.animManager.ChangeToCarry_TwoHanded_Weapon(transform);
            break;
        }
    }
예제 #4
0
    void Update()
    {
        if (this.animType != AnimTypes.STOP)
        {
            var progressPercent = (Time.time - this.animStartTime) / this.animTime;
            this.rt.localPosition = Vector3.Lerp(this.rt.localPosition, this.destPosition, progressPercent);

            if (progressPercent >= 1.0f)
            {
                if (this.animType == AnimTypes.OUT)
                {
                    this.gameObject.SetActive(true);
                }
                this.animType = AnimTypes.STOP;
            }
        }
    }
예제 #5
0
 public SimpleAnimation(Sprite spriteToChange, AnimTypes animType, params AnimationFrame[] frames)
 {
     SpriteToChange = spriteToChange;
     AnimType       = animType;
     AnimFrames     = frames;
 }