-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathUtils.cs
49 lines (42 loc) · 1.32 KB
/
Utils.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Utils
// ---------------------------------
// Static functions that are useful for the NearFuture pack
using System;
using UnityEngine;
using System.Collections.Generic;
namespace NearFuture
{
internal static class Utils
{
// This function loads up some animationstates
public static AnimationState[] SetUpAnimation(string animationName, Part part)
{
var states = new List<AnimationState>();
foreach (var animation in part.FindModelAnimators(animationName))
{
var animationState = animation[animationName];
animationState.speed = 0;
animationState.enabled = true;
// Clamp this or else weird things happen
animationState.wrapMode = WrapMode.ClampForever;
animation.Blend(animationName);
states.Add(animationState);
}
// Convert
return states.ToArray();
}
// Returns true if ship is it atmoshpere
public static bool VesselInAtmosphere(Vessel vessel)
{
return vessel.heightFromSurface < vessel.mainBody.maxAtmosphereAltitude;
}
}
public enum RadiatorState
{
Deployed,
Deploying,
Retracted,
Retracting,
Broken,
}
}