-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Expand file tree
/
Copy pathAnimationPlayableOutput.bindings.cs
More file actions
82 lines (67 loc) · 2.73 KB
/
Copy pathAnimationPlayableOutput.bindings.cs
File metadata and controls
82 lines (67 loc) · 2.73 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
// 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 UnityEngine.Bindings;
using UnityEngine.Scripting;
using UnityEngine.Playables;
namespace UnityEngine.Animations
{
[NativeHeader("Modules/Animation/ScriptBindings/AnimationPlayableOutput.bindings.h")]
[NativeHeader("Modules/Animation/Director/AnimationPlayableOutput.h")]
[NativeHeader("Modules/Animation/Animator.h")]
[NativeHeader("Runtime/Director/Core/HPlayableGraph.h")]
[NativeHeader("Runtime/Director/Core/HPlayableOutput.h")]
[StaticAccessor("AnimationPlayableOutputBindings", StaticAccessorType.DoubleColon)]
[RequiredByNativeCode]
public struct AnimationPlayableOutput : IPlayableOutput
{
private PlayableOutputHandle m_Handle;
public static AnimationPlayableOutput Create(PlayableGraph graph, string name, Animator target)
{
PlayableOutputHandle handle;
if (!AnimationPlayableGraphExtensions.InternalCreateAnimationOutput(ref graph, name, out handle))
return AnimationPlayableOutput.Null;
AnimationPlayableOutput output = new AnimationPlayableOutput(handle);
output.SetTarget(target);
return output;
}
internal AnimationPlayableOutput(PlayableOutputHandle handle)
{
if (handle.IsValid())
{
if (!handle.IsPlayableOutputOfType<AnimationPlayableOutput>())
throw new InvalidCastException("Can't set handle: the playable is not an AnimationPlayableOutput.");
}
m_Handle = handle;
}
public static AnimationPlayableOutput Null
{
get { return new AnimationPlayableOutput(PlayableOutputHandle.Null); }
}
public PlayableOutputHandle GetHandle()
{
return m_Handle;
}
public static implicit operator PlayableOutput(AnimationPlayableOutput output)
{
return new PlayableOutput(output.GetHandle());
}
public static explicit operator AnimationPlayableOutput(PlayableOutput output)
{
return new AnimationPlayableOutput(output.GetHandle());
}
public Animator GetTarget()
{
return InternalGetTarget(ref m_Handle);
}
public void SetTarget(Animator value)
{
InternalSetTarget(ref m_Handle, value);
}
[NativeThrows]
extern private static Animator InternalGetTarget(ref PlayableOutputHandle handle);
[NativeThrows]
extern private static void InternalSetTarget(ref PlayableOutputHandle handle, Animator target);
}
}