using UnityEngine;
using System.Collections;

public class MainBodyStateOne_Two : FiniteState
{
    MainBody self;
    float delta = 0.05f;
    float radius;
    public override void Init()
    {
        self = subject as MainBody;
        self.sphere.GetComponent<TrailRenderer>().enabled = true;
    }
    public override void Update()
    {
        self.MoveSelf(self.speed_2);
        self.RotateSelf(self.rotate_2);
        radius = Mathf.MoveTowards(radius, self.minRadius, delta * Time.deltaTime);
        Vector3 local = self.sphere.localPosition;
        local.z = radius;
        self.sphere.localPosition = local;
        if (radius == self.minRadius)
            self.sm.SwitchTo<MainBodyStateTwoD>();

    }
}
