squash commits
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a657a600f2fdf2c4f9ea6a5a54a53f04
|
||||
folderAsset: yes
|
||||
timeCreated: 1537147078
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,15 @@
|
||||
#if UNITY_2017_1_OR_NEWER
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Playables;
|
||||
|
||||
namespace UMA.Timeline
|
||||
{
|
||||
[Serializable]
|
||||
public class UmaColorBehaviour : PlayableBehaviour
|
||||
{
|
||||
public string sharedColorName = "";
|
||||
public Color color = Color.white;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4f909d37f5fc4a748bb0497264ef5b9e
|
||||
timeCreated: 1537147127
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/Extensions/Timeline/UmaColor/UmaColorBehaviour.cs
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,26 @@
|
||||
#if UNITY_2017_1_OR_NEWER
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Playables;
|
||||
using UnityEngine.Timeline;
|
||||
|
||||
namespace UMA.Timeline
|
||||
{
|
||||
[Serializable]
|
||||
public class UmaColorClip : PlayableAsset, ITimelineClipAsset
|
||||
{
|
||||
public UmaColorBehaviour template = new UmaColorBehaviour();
|
||||
|
||||
public ClipCaps clipCaps
|
||||
{
|
||||
get { return ClipCaps.Blending; }
|
||||
}
|
||||
|
||||
public override Playable CreatePlayable(PlayableGraph graph, GameObject owner)
|
||||
{
|
||||
var playable = ScriptPlayable<UmaColorBehaviour>.Create(graph, template);
|
||||
return playable;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e57c5b593f7a8fb479834d3e186a6ba6
|
||||
timeCreated: 1537147127
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/Extensions/Timeline/UmaColor/UmaColorClip.cs
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,69 @@
|
||||
#if UNITY_2017_1_OR_NEWER
|
||||
using UnityEngine;
|
||||
using UnityEngine.Playables;
|
||||
using UMA.CharacterSystem;
|
||||
|
||||
namespace UMA.Timeline
|
||||
{
|
||||
public class UmaColorMixerBehaviour : PlayableBehaviour
|
||||
{
|
||||
DynamicCharacterAvatar avatar;
|
||||
public float elapsedTime = 0f;
|
||||
public float timeStep = 0.2f;
|
||||
|
||||
public override void ProcessFrame(Playable playable, FrameData info, object playerData)
|
||||
{
|
||||
string sharedColorName = "";
|
||||
avatar = playerData as DynamicCharacterAvatar;
|
||||
|
||||
if (avatar == null)
|
||||
{
|
||||
if (Debug.isDebugBuild)
|
||||
{
|
||||
Debug.LogWarning("No DynamicCharacterAvatar set for UmaColor Playable!");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
int inputCount = playable.GetInputCount();
|
||||
bool colorUpdated = false;
|
||||
|
||||
if (inputCount <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
UmaColorBehaviour firstBehaviour = ((ScriptPlayable<UmaColorBehaviour>)playable.GetInput(0)).GetBehaviour();
|
||||
Color finalColor = Color.black;
|
||||
if( avatar.GetColor(firstBehaviour.sharedColorName) != null)
|
||||
{
|
||||
finalColor = avatar.GetColor(firstBehaviour.sharedColorName).color;
|
||||
}
|
||||
|
||||
elapsedTime += info.deltaTime;
|
||||
|
||||
for (int i = 0; i < inputCount; i++)
|
||||
{
|
||||
float inputWeight = playable.GetInputWeight(i);
|
||||
ScriptPlayable<UmaColorBehaviour> inputPlayable = (ScriptPlayable<UmaColorBehaviour>)playable.GetInput(i);
|
||||
UmaColorBehaviour input = inputPlayable.GetBehaviour();
|
||||
|
||||
sharedColorName = input.sharedColorName;
|
||||
finalColor = (finalColor * (1f - inputWeight)) + (input.color * inputWeight);
|
||||
}
|
||||
|
||||
if (elapsedTime >= timeStep)
|
||||
{
|
||||
elapsedTime = 0f;
|
||||
avatar.SetColor(sharedColorName, finalColor);
|
||||
colorUpdated = true;
|
||||
}
|
||||
|
||||
if (colorUpdated)
|
||||
{
|
||||
avatar.UpdateColors(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3a86bde5fb3b03f418fc5f3b992a6760
|
||||
timeCreated: 1537147127
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/Extensions/Timeline/UmaColor/UmaColorMixerBehaviour.cs
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,25 @@
|
||||
#if UNITY_2017_1_OR_NEWER
|
||||
using UnityEngine;
|
||||
using UnityEngine.Playables;
|
||||
using UnityEngine.Timeline;
|
||||
using UMA.CharacterSystem;
|
||||
|
||||
namespace UMA.Timeline
|
||||
{
|
||||
[TrackColor(0.2f, 0.4f, 0.2f)]
|
||||
[TrackClipType(typeof(UmaColorClip))]
|
||||
[TrackBindingType(typeof(DynamicCharacterAvatar))]
|
||||
public class UmaColorTrack : TrackAsset
|
||||
{
|
||||
[Tooltip("Time between rebuilding the UMA texture so we aren't rebuilding it every frame")]
|
||||
public float timeStep = 0.2f;
|
||||
|
||||
public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount)
|
||||
{
|
||||
var mixer = ScriptPlayable<UmaColorMixerBehaviour>.Create(graph, inputCount);
|
||||
mixer.GetBehaviour().timeStep = timeStep;
|
||||
return mixer;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6dd78dcf1edcb8d47a2d69b09b3d93b8
|
||||
timeCreated: 1537147127
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/Extensions/Timeline/UmaColor/UmaColorTrack.cs
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8eda3468180cfd34daa11b77486b8ef5
|
||||
folderAsset: yes
|
||||
timeCreated: 1537147087
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,24 @@
|
||||
#if UNITY_2017_1_OR_NEWER
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Playables;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace UMA.Timeline
|
||||
{
|
||||
[Serializable]
|
||||
public class UmaDnaBehaviour : PlayableBehaviour
|
||||
{
|
||||
[Serializable]
|
||||
public struct DnaTuple
|
||||
{
|
||||
public string Name;
|
||||
[Range(0f, 1f)]
|
||||
public float Value;
|
||||
}
|
||||
|
||||
public bool rebuildImmediately = true;
|
||||
public List<DnaTuple> dnaValues = new List<DnaTuple>();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 355cb5b742642114c9e42f45be7ce80f
|
||||
timeCreated: 1537147185
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/Extensions/Timeline/UmaDna/UmaDnaBehaviour.cs
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,26 @@
|
||||
#if UNITY_2017_1_OR_NEWER
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Playables;
|
||||
using UnityEngine.Timeline;
|
||||
|
||||
namespace UMA.Timeline
|
||||
{
|
||||
[Serializable]
|
||||
public class UmaDnaClip : PlayableAsset, ITimelineClipAsset
|
||||
{
|
||||
public UmaDnaBehaviour template = new UmaDnaBehaviour();
|
||||
|
||||
public ClipCaps clipCaps
|
||||
{
|
||||
get { return ClipCaps.Blending; }
|
||||
}
|
||||
|
||||
public override Playable CreatePlayable(PlayableGraph graph, GameObject owner)
|
||||
{
|
||||
var playable = ScriptPlayable<UmaDnaBehaviour>.Create(graph, template);
|
||||
return playable;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f6db0139fca366e4d973be8a8ad0b739
|
||||
timeCreated: 1537147185
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/Extensions/Timeline/UmaDna/UmaDnaClip.cs
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,48 @@
|
||||
#if UNITY_2017_1_OR_NEWER
|
||||
using UnityEngine;
|
||||
using UnityEngine.Playables;
|
||||
using UMA.CharacterSystem;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace UMA.Timeline
|
||||
{
|
||||
public class UmaDnaMixerBehaviour : PlayableBehaviour
|
||||
{
|
||||
DynamicCharacterAvatar avatar;
|
||||
|
||||
public override void ProcessFrame(Playable playable, FrameData info, object playerData)
|
||||
{
|
||||
DynamicCharacterAvatar avatar = playerData as DynamicCharacterAvatar;
|
||||
if (avatar == null || !Application.isPlaying)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Dictionary<string, DnaSetter> allDNA = avatar.GetDNA();
|
||||
|
||||
int inputCount = playable.GetInputCount();
|
||||
for (int i = 0; i < inputCount; i++)
|
||||
{
|
||||
float inputWeight = playable.GetInputWeight(i);
|
||||
ScriptPlayable<UmaDnaBehaviour> inputPlayable = (ScriptPlayable<UmaDnaBehaviour>)playable.GetInput(i);
|
||||
UmaDnaBehaviour input = inputPlayable.GetBehaviour();
|
||||
|
||||
for (int i1 = 0; i1 < input.dnaValues.Count; i1++)
|
||||
{
|
||||
UmaDnaBehaviour.DnaTuple dna = input.dnaValues[i1];
|
||||
if (allDNA.ContainsKey(dna.Name))
|
||||
{
|
||||
float currentValue = allDNA[dna.Name].Value * (1f - inputWeight);
|
||||
allDNA[dna.Name].Set(currentValue + (dna.Value * inputWeight));
|
||||
}
|
||||
}
|
||||
|
||||
if (input.rebuildImmediately)
|
||||
{
|
||||
avatar.ForceUpdate(true, false, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: be1462eee4319874e815403440ccfdf2
|
||||
timeCreated: 1537147185
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/Extensions/Timeline/UmaDna/UmaDnaMixerBehaviour.cs
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,21 @@
|
||||
#if UNITY_2017_1_OR_NEWER
|
||||
using UnityEngine;
|
||||
using UnityEngine.Playables;
|
||||
using UnityEngine.Timeline;
|
||||
using UMA.CharacterSystem;
|
||||
|
||||
namespace UMA.Timeline
|
||||
{
|
||||
[TrackColor(0.2f, 0.8f, 0.2f)]
|
||||
[TrackClipType(typeof(UmaDnaClip))]
|
||||
[TrackBindingType(typeof(DynamicCharacterAvatar))]
|
||||
public class UmaDnaTrack : TrackAsset
|
||||
{
|
||||
public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount)
|
||||
{
|
||||
var mixer = ScriptPlayable<UmaDnaMixerBehaviour>.Create(graph, inputCount);
|
||||
return mixer;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 15fca600c7eff9c4c97a346d7700944c
|
||||
timeCreated: 1537147185
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/Extensions/Timeline/UmaDna/UmaDnaTrack.cs
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b89e9d93e94fdaf4daaf24879bf1be5c
|
||||
folderAsset: yes
|
||||
timeCreated: 1537147093
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,38 @@
|
||||
#if UNITY_2017_1_OR_NEWER
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Playables;
|
||||
using UMA.CharacterSystem;
|
||||
|
||||
namespace UMA.Timeline
|
||||
{
|
||||
[Serializable]
|
||||
public class UmaRaceBehaviour : PlayableBehaviour
|
||||
{
|
||||
public string raceToChangeTo = "";
|
||||
|
||||
[HideInInspector]
|
||||
public bool isAdded = false;
|
||||
|
||||
public override void ProcessFrame(Playable playable, FrameData info, object playerData)
|
||||
{
|
||||
DynamicCharacterAvatar avatar = playerData as DynamicCharacterAvatar;
|
||||
|
||||
if (avatar == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(raceToChangeTo))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (avatar.activeRace.name != raceToChangeTo)
|
||||
{
|
||||
avatar.ChangeRace(raceToChangeTo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5134909ca53e5884daf6cd5e507b4aad
|
||||
timeCreated: 1537147204
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/Extensions/Timeline/UmaRace/UmaRaceBehaviour.cs
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,28 @@
|
||||
#if UNITY_2017_1_OR_NEWER
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Playables;
|
||||
using UnityEngine.Timeline;
|
||||
|
||||
namespace UMA.Timeline
|
||||
{
|
||||
[Serializable]
|
||||
public class UmaRaceClip : PlayableAsset, ITimelineClipAsset
|
||||
{
|
||||
public string raceToChangeTo = "";
|
||||
|
||||
public ClipCaps clipCaps
|
||||
{
|
||||
get { return ClipCaps.None; }
|
||||
}
|
||||
|
||||
public override Playable CreatePlayable(PlayableGraph graph, GameObject owner)
|
||||
{
|
||||
var playable = ScriptPlayable<UmaRaceBehaviour>.Create(graph);
|
||||
playable.GetBehaviour().raceToChangeTo = raceToChangeTo;
|
||||
return playable;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b32596058d6d8774d9d9f7c5de45b102
|
||||
timeCreated: 1537147204
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/Extensions/Timeline/UmaRace/UmaRaceClip.cs
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,14 @@
|
||||
#if UNITY_2017_1_OR_NEWER
|
||||
using UnityEngine.Timeline;
|
||||
using UMA.CharacterSystem;
|
||||
|
||||
namespace UMA.Timeline
|
||||
{
|
||||
[TrackColor(0.2f, 0.2f, 0.2f)]
|
||||
[TrackClipType(typeof(UmaRaceClip))]
|
||||
[TrackBindingType(typeof(DynamicCharacterAvatar))]
|
||||
public class UmaRaceTrack : TrackAsset
|
||||
{
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 09bdfe9c923e2974a83910a6111cb633
|
||||
timeCreated: 1537147204
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/Extensions/Timeline/UmaRace/UmaRaceTrack.cs
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 76cf97464ae668441ab3cf9c8979fe94
|
||||
folderAsset: yes
|
||||
timeCreated: 1537147099
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,83 @@
|
||||
#if UNITY_2017_1_OR_NEWER
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Playables;
|
||||
using UMA.CharacterSystem;
|
||||
|
||||
namespace UMA.Timeline
|
||||
{
|
||||
[Serializable]
|
||||
public class UmaWardrobeBehaviour : PlayableBehaviour
|
||||
{
|
||||
public enum WardrobeOptions
|
||||
{
|
||||
AddRecipes,
|
||||
ClearSlots,
|
||||
ClearAllSlots
|
||||
}
|
||||
|
||||
public WardrobeOptions wardrobeOption = 0;
|
||||
public List<UMAWardrobeRecipe> recipesToAdd = new List<UMAWardrobeRecipe>();
|
||||
public List<string> slotsToClear = new List<string>();
|
||||
[Tooltip("Whether to rebuild the uma avatar immediately on setting/clearing or instead accummulate the changes.")]
|
||||
public bool rebuildImmediately = true;
|
||||
|
||||
[HideInInspector]
|
||||
public bool isAdded = false;
|
||||
|
||||
public override void ProcessFrame(Playable playable, FrameData info, object playerData)
|
||||
{
|
||||
bool dcaUpdated = false;
|
||||
DynamicCharacterAvatar avatar = playerData as DynamicCharacterAvatar;
|
||||
if (avatar == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isAdded)
|
||||
{
|
||||
isAdded = true;
|
||||
dcaUpdated = true;
|
||||
|
||||
if (wardrobeOption == UmaWardrobeBehaviour.WardrobeOptions.AddRecipes)
|
||||
{
|
||||
if (recipesToAdd != null)
|
||||
{
|
||||
for (int i = 0; i < recipesToAdd.Count; i++)
|
||||
{
|
||||
UMAWardrobeRecipe recipe = recipesToAdd[i];
|
||||
avatar.SetSlot(recipe);
|
||||
dcaUpdated = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Debug.isDebugBuild)
|
||||
{
|
||||
Debug.LogWarning("Wardrobe recipes not set!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (wardrobeOption == UmaWardrobeBehaviour.WardrobeOptions.ClearSlots)
|
||||
{
|
||||
avatar.ClearSlots(slotsToClear);
|
||||
dcaUpdated = true;
|
||||
}
|
||||
|
||||
if (wardrobeOption == UmaWardrobeBehaviour.WardrobeOptions.ClearAllSlots)
|
||||
{
|
||||
avatar.ClearSlots();
|
||||
dcaUpdated = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (dcaUpdated && rebuildImmediately)
|
||||
{
|
||||
avatar.BuildCharacter(true,!avatar.BundleCheck);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8c1ed44a66b845d438e0c7ed7bf8c76e
|
||||
timeCreated: 1537147278
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/Extensions/Timeline/UmaWardrobe/UmaWardrobeBehaviour.cs
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,26 @@
|
||||
#if UNITY_2017_1_OR_NEWER
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Playables;
|
||||
using UnityEngine.Timeline;
|
||||
|
||||
namespace UMA.Timeline
|
||||
{
|
||||
[Serializable]
|
||||
public class UmaWardrobeClip : PlayableAsset, ITimelineClipAsset
|
||||
{
|
||||
public UmaWardrobeBehaviour template = new UmaWardrobeBehaviour();
|
||||
|
||||
public ClipCaps clipCaps
|
||||
{
|
||||
get { return ClipCaps.None; }
|
||||
}
|
||||
|
||||
public override Playable CreatePlayable(PlayableGraph graph, GameObject owner)
|
||||
{
|
||||
var playable = ScriptPlayable<UmaWardrobeBehaviour>.Create(graph, template);
|
||||
return playable;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d67d1bdd757e7dd49826ea5f02ae84f7
|
||||
timeCreated: 1537147278
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/Extensions/Timeline/UmaWardrobe/UmaWardrobeClip.cs
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,14 @@
|
||||
#if UNITY_2017_1_OR_NEWER
|
||||
using UnityEngine.Timeline;
|
||||
using UMA.CharacterSystem;
|
||||
|
||||
namespace UMA.Timeline
|
||||
{
|
||||
[TrackColor(0.2f, 0.0f, 0.2f)]
|
||||
[TrackClipType(typeof(UmaWardrobeClip))]
|
||||
[TrackBindingType(typeof(DynamicCharacterAvatar))]
|
||||
public class UmaWardrobeTrack : TrackAsset
|
||||
{
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 21904e453c5200943a2c55faeb7bbf57
|
||||
timeCreated: 1537147278
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/Extensions/Timeline/UmaWardrobe/UmaWardrobeTrack.cs
|
||||
uploadId: 679826
|
||||
Reference in New Issue
Block a user