SetUpAnimation() public static method

public static SetUpAnimation ( string animationName, Part part ) : UnityEngine.AnimationState[]
animationName string
part Part
return UnityEngine.AnimationState[]
        public override void OnStart(PartModule.StartState state)
        {
            deployStates = Utils.SetUpAnimation(DeployAnimation, part);
            heatStates   = Utils.SetUpAnimation(HeatAnimation, part);


            PressureCurve = new FloatCurve();
            PressureCurve.Add(0f, 0f);
            PressureCurve.Add(1f, 1f);

            if (State == RadiatorState.Deployed || State == RadiatorState.Deploying)
            {
                foreach (AnimationState deployState in deployStates)
                {
                    deployState.normalizedTime = 1f;
                }
            }
            else if (State == RadiatorState.Retracted || State == RadiatorState.Retracting)
            {
                foreach (AnimationState deployState in deployStates)
                {
                    deployState.normalizedTime = 0f;
                }
            }
            else
            {
                // broken! none for you!
            }

            this.part.force_activate();
        }
示例#2
0
        public override void OnStart(PartModule.StartState state)
        {
            this.part.force_activate();
            capacityState = Utils.SetUpAnimation(ChargeAnimation, this.part);

            foreach (AnimationState cState in capacityState)
            {
                cState.normalizedTime = 1 - (-currentCharge / MaximumCharge);
            }
            currentCharge = (float)this.part.Resources.Get(PartResourceLibrary.Instance.GetDefinition("StoredCharge").id).amount;
        }
 public override void OnStart(PartModule.StartState state)
 {
     workStates = Utils.SetUpAnimation(RefineAnimation, part);
 }
 public override void OnStart(PartModule.StartState state)
 {
     heatStates = Utils.SetUpAnimation(HeatAnimation, part);
 }