squash commits
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user