Skip to content

Commit fff51ac

Browse files
committed
Add Assets/Demoscene/Scripts/Playables/RaymarchingWorldSandwich/RaymarchingWorldSandwich
1 parent e548089 commit fff51ac

10 files changed

+142
-0
lines changed

Assets/Demoscene/Scripts/Playables.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Demoscene/Scripts/Playables/RaymarchingWorldSandwich.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using System;
2+
using UnityEngine;
3+
using UnityEngine.Playables;
4+
using UnityEngine.Timeline;
5+
6+
[Serializable]
7+
public class RaymarchingWorldSandwichBehaviour : PlayableBehaviour
8+
{
9+
public GameObject newExposedReference;
10+
public float newBehaviourVariable;
11+
12+
public override void OnGraphStart (Playable playable)
13+
{
14+
15+
}
16+
}

Assets/Demoscene/Scripts/Playables/RaymarchingWorldSandwich/RaymarchingWorldSandwichBehaviour.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using System;
2+
using UnityEngine;
3+
using UnityEngine.Playables;
4+
using UnityEngine.Timeline;
5+
6+
[Serializable]
7+
public class RaymarchingWorldSandwichClip : PlayableAsset, ITimelineClipAsset
8+
{
9+
public RaymarchingWorldSandwichBehaviour template = new RaymarchingWorldSandwichBehaviour ();
10+
public ExposedReference<GameObject> newExposedReference;
11+
12+
public ClipCaps clipCaps
13+
{
14+
get { return ClipCaps.SpeedMultiplier | ClipCaps.Blending; }
15+
}
16+
17+
public override Playable CreatePlayable (PlayableGraph graph, GameObject owner)
18+
{
19+
var playable = ScriptPlayable<RaymarchingWorldSandwichBehaviour>.Create (graph, template);
20+
RaymarchingWorldSandwichBehaviour clone = playable.GetBehaviour ();
21+
clone.newExposedReference = newExposedReference.Resolve (graph.GetResolver ());
22+
return playable;
23+
}
24+
}

Assets/Demoscene/Scripts/Playables/RaymarchingWorldSandwich/RaymarchingWorldSandwichClip.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using System;
2+
using UnityEngine;
3+
using UnityEngine.Playables;
4+
using UnityEngine.Timeline;
5+
6+
public class RaymarchingWorldSandwichMixerBehaviour : PlayableBehaviour
7+
{
8+
// NOTE: This function is called at runtime and edit time. Keep that in mind when setting the values of properties.
9+
public override void ProcessFrame(Playable playable, FrameData info, object playerData)
10+
{
11+
MonoBehaviour trackBinding = playerData as MonoBehaviour;
12+
13+
if (!trackBinding)
14+
return;
15+
16+
int inputCount = playable.GetInputCount ();
17+
18+
for (int i = 0; i < inputCount; i++)
19+
{
20+
float inputWeight = playable.GetInputWeight(i);
21+
ScriptPlayable<RaymarchingWorldSandwichBehaviour> inputPlayable = (ScriptPlayable<RaymarchingWorldSandwichBehaviour>)playable.GetInput(i);
22+
RaymarchingWorldSandwichBehaviour input = inputPlayable.GetBehaviour ();
23+
24+
// Use the above variables to process each frame of this playable.
25+
26+
}
27+
}
28+
}

Assets/Demoscene/Scripts/Playables/RaymarchingWorldSandwich/RaymarchingWorldSandwichMixerBehaviour.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using UnityEngine;
2+
using UnityEngine.Playables;
3+
using UnityEngine.Timeline;
4+
5+
[TrackColor(0.855f, 0.8623f, 0.87f)]
6+
[TrackClipType(typeof(RaymarchingWorldSandwichClip))]
7+
[TrackBindingType(typeof(MonoBehaviour))]
8+
public class RaymarchingWorldSandwichTrack : TrackAsset
9+
{
10+
public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount)
11+
{
12+
return ScriptPlayable<RaymarchingWorldSandwichMixerBehaviour>.Create (graph, inputCount);
13+
}
14+
}

Assets/Demoscene/Scripts/Playables/RaymarchingWorldSandwich/RaymarchingWorldSandwichTrack.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)