-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Expand file tree
/
Copy pathMuscleHandle.bindings.cs
More file actions
87 lines (69 loc) · 2.52 KB
/
Copy pathMuscleHandle.bindings.cs
File metadata and controls
87 lines (69 loc) · 2.52 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// Unity C# reference source
// Copyright (c) Unity Technologies. For terms of use, see
// https://unity3d.com/legal/licenses/Unity_Reference_Only_License
using System;
using System.Runtime.InteropServices;
using UnityEngine.Bindings;
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.Animations
{
[MovedFrom("UnityEngine.Experimental.Animations")]
[NativeHeader("Modules/Animation/Animator.h")] // -> dof enum
[NativeHeader("Modules/Animation/MuscleHandle.h")]
[StructLayout(LayoutKind.Sequential)]
public struct MuscleHandle
{
public HumanPartDof humanPartDof
{
get;
private set;
}
public int dof
{
get;
private set;
}
public MuscleHandle(BodyDof bodyDof)
{
humanPartDof = HumanPartDof.Body;
dof = (int)bodyDof;
}
public MuscleHandle(HeadDof headDof)
{
humanPartDof = HumanPartDof.Head;
dof = (int)headDof;
}
public MuscleHandle(HumanPartDof partDof, LegDof legDof)
{
if (partDof != HumanPartDof.LeftLeg && partDof != HumanPartDof.RightLeg)
throw new InvalidOperationException("Invalid HumanPartDof for a leg, please use either HumanPartDof.LeftLeg or HumanPartDof.RightLeg.");
humanPartDof = partDof;
dof = (int)legDof;
}
public MuscleHandle(HumanPartDof partDof, ArmDof armDof)
{
if (partDof != HumanPartDof.LeftArm && partDof != HumanPartDof.RightArm)
throw new InvalidOperationException("Invalid HumanPartDof for an arm, please use either HumanPartDof.LeftArm or HumanPartDof.RightArm.");
humanPartDof = partDof;
dof = (int)armDof;
}
public MuscleHandle(HumanPartDof partDof, FingerDof fingerDof)
{
if (partDof < HumanPartDof.LeftThumb || partDof > HumanPartDof.RightLittle)
throw new InvalidOperationException("Invalid HumanPartDof for a finger.");
humanPartDof = partDof;
dof = (int)fingerDof;
}
public string name
{
get { return GetName(); }
}
public static int muscleHandleCount
{
get { return GetMuscleHandleCount(); }
}
public extern static void GetMuscleHandles([NotNull][Out] MuscleHandle[] muscleHandles);
private extern string GetName();
private extern static int GetMuscleHandleCount();
}
}