浏览代码

Fixes for Streaming Level Action inspector / Added direct set of Full Screen Fade / Added Send Message Track Playable

/main
Thomas ICHÉ 6 年前
当前提交
19704cb2
共有 14 个文件被更改,包括 188 次插入10 次删除
  1. 4
      Runtime/Actions/StreamingLevelAction.cs
  2. 37
      Runtime/Managers/Implementations/FullScreenFadeManager.cs
  3. 8
      Runtime/Playables.meta
  4. 8
      Runtime/Playables/SendMessage.meta
  5. 30
      Runtime/Playables/SendMessage/SendMessageBehaviour.cs
  6. 11
      Runtime/Playables/SendMessage/SendMessageBehaviour.cs.meta
  7. 25
      Runtime/Playables/SendMessage/SendMessageClip.cs
  8. 11
      Runtime/Playables/SendMessage/SendMessageClip.cs.meta
  9. 26
      Runtime/Playables/SendMessage/SendMessageMixerBehaviour.cs
  10. 11
      Runtime/Playables/SendMessage/SendMessageMixerBehaviour.cs.meta
  11. 16
      Runtime/Playables/SendMessage/SendMessageTrack.cs
  12. 11
      Runtime/Playables/SendMessage/SendMessageTrack.cs.meta

4
Runtime/Actions/StreamingLevelAction.cs


public class StreamingLevelAction : ActionBase
{
[ReorderableList]
public Scene[] Scenes;
public string[] Scenes;
public string SceneToActivate;
public LevelStreamingManager.StreamingAction Action = LevelStreamingManager.StreamingAction.Load;

{
List<string> sceneNames = new List<string>();
foreach (var scene in Scenes)
sceneNames.Add(scene.name);
sceneNames.Add(scene);
Manager.Get<LevelStreamingManager>().LoadScenes(Action, sceneNames.ToArray(), SceneToActivate, ShowUI, OnLoadComplete);
}
}

37
Runtime/Managers/Implementations/FullScreenFadeManager.cs


m_Coroutine = null;
}
switch (mode)
if (duration <= 0.0f)
{
var color = FullScreenFadePlane.color; ;
switch (mode)
{
case FadeMode.ToBlack:
color.a = 1.0f;
break;
case FadeMode.FromBlack:
color.a = 0.0f;
break;
default: throw new NotImplementedException();
}
FullScreenFadePlane.gameObject.SetActive(color.a == 1.0f);
FullScreenFadePlane.color = color;
Callable.Call(OnComplete);
}
else
case FadeMode.ToBlack:
m_Coroutine = StartCoroutine(FadeCoroutine(duration, 1.0f, 1.0f, OnComplete));
break;
case FadeMode.FromBlack:
m_Coroutine = StartCoroutine(FadeCoroutine(duration, 0.0f, -1.0f, OnComplete));
break;
default: throw new NotImplementedException();
switch (mode)
{
case FadeMode.ToBlack:
m_Coroutine = StartCoroutine(FadeCoroutine(duration, 1.0f, 1.0f, OnComplete));
break;
case FadeMode.FromBlack:
m_Coroutine = StartCoroutine(FadeCoroutine(duration, 0.0f, -1.0f, OnComplete));
break;
default: throw new NotImplementedException();
}
}
IEnumerator FadeCoroutine(float duration, float target, float sign, Callable[] OnComplete)

8
Runtime/Playables.meta


fileFormatVersion: 2
guid: 82fb72ee12182554681d3834638a7410
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
Runtime/Playables/SendMessage.meta


fileFormatVersion: 2
guid: 28fbd0def0e32d047a3ed5f8690959c6
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

30
Runtime/Playables/SendMessage/SendMessageBehaviour.cs


using System;
using UnityEngine;
using UnityEngine.Playables;
using UnityEngine.Timeline;
namespace GameplayIngredients.Playables
{
[Serializable]
public class SendMessageBehaviour : PlayableBehaviour
{
public string StartMessage;
public override void OnBehaviourPlay(Playable playable, FrameData info)
{
base.OnBehaviourPlay(playable, info);
if(StartMessage != "" )
{
if (Application.isPlaying)
Messager.Send(StartMessage);
else
Debug.Log("[SendMessageBehaviour] Would have sent broadcast message : '" + StartMessage + "'");
}
}
public override void OnGraphStart (Playable playable)
{
}
}
}

11
Runtime/Playables/SendMessage/SendMessageBehaviour.cs.meta


fileFormatVersion: 2
guid: 36ad03ebb9cd1654a81443986e35d906
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

25
Runtime/Playables/SendMessage/SendMessageClip.cs


using System;
using UnityEngine;
using UnityEngine.Playables;
using UnityEngine.Timeline;
namespace GameplayIngredients.Playables
{
[Serializable]
public class SendMessageClip : PlayableAsset, ITimelineClipAsset
{
public SendMessageBehaviour template = new SendMessageBehaviour ();
public ClipCaps clipCaps
{
get { return ClipCaps.None; }
}
public override Playable CreatePlayable (PlayableGraph graph, GameObject owner)
{
var playable = ScriptPlayable<SendMessageBehaviour>.Create (graph, template);
SendMessageBehaviour clone = playable.GetBehaviour ();
return playable;
}
}
}

11
Runtime/Playables/SendMessage/SendMessageClip.cs.meta


fileFormatVersion: 2
guid: cb58c39ec6569f44f80a61f5c3cf164f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

26
Runtime/Playables/SendMessage/SendMessageMixerBehaviour.cs


using System;
using UnityEngine;
using UnityEngine.Playables;
using UnityEngine.Timeline;
namespace GameplayIngredients.Playables
{
public class SendMessageMixerBehaviour : PlayableBehaviour
{
// NOTE: This function is called at runtime and edit time. Keep that in mind when setting the values of properties.
public override void ProcessFrame(Playable playable, FrameData info, object playerData)
{
int inputCount = playable.GetInputCount ();
for (int i = 0; i < inputCount; i++)
{
float inputWeight = playable.GetInputWeight(i);
ScriptPlayable<SendMessageBehaviour> inputPlayable = (ScriptPlayable<SendMessageBehaviour>)playable.GetInput(i);
SendMessageBehaviour input = inputPlayable.GetBehaviour ();
// Use the above variables to process each frame of this playable.
}
}
}
}

11
Runtime/Playables/SendMessage/SendMessageMixerBehaviour.cs.meta


fileFormatVersion: 2
guid: 77ff4b879de7c6442b58e17420f97a6b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

16
Runtime/Playables/SendMessage/SendMessageTrack.cs


using UnityEngine;
using UnityEngine.Playables;
using UnityEngine.Timeline;
namespace GameplayIngredients.Playables
{
[TrackColor(0.5377358f, 0.3115655f, 0.1699448f)]
[TrackClipType(typeof(SendMessageClip))]
public class SendMessageTrack : TrackAsset
{
public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount)
{
return ScriptPlayable<SendMessageMixerBehaviour>.Create (graph, inputCount);
}
}
}

11
Runtime/Playables/SendMessage/SendMessageTrack.cs.meta


fileFormatVersion: 2
guid: 7d750ab4465e67c4d87e45dee6734baf
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存