add live camera support

This commit is contained in:
CroakFang
2023-07-23 17:48:49 +08:00
parent bcb4b00985
commit a13cac6ede
42 changed files with 5252 additions and 717 deletions
@@ -10,9 +10,39 @@ public class LiveViewerUI : MonoBehaviour
public UnityEngine.UI.Slider ProgressBar;
public RectTransform BottonUITransform;
float targetHeight = 0;
float height;
private void Awake()
{
height = BottonUITransform.rect.height;
targetHeight = 0;
Invoke(nameof(HideSlider), 1.5f);
Instance = this;
//TrueProgressBar = (UnityEngine.UIElements.Slider)ProgressBar;
}
public void OnMouse(bool isEnter)
{
if (isEnter)
{
targetHeight = 0;
CancelInvoke();
}
else
{
Invoke(nameof(HideSlider), 2.5f);
}
}
private void FixedUpdate()
{
BottonUITransform.anchoredPosition = Vector2.Lerp(BottonUITransform.anchoredPosition, new Vector2(0, targetHeight), Time.fixedDeltaTime * 5);
}
private void HideSlider()
{
targetHeight = -height;
}
}
+2
View File
@@ -1,4 +1,5 @@
using Gallop;
using Gallop.Live.Cutt;
using RootMotion.Dynamics;
using RootMotion.FinalIK;
using System;
@@ -79,6 +80,7 @@ public class UmaContainer : MonoBehaviour
[Header("Live")]
public bool IsLive = false;
public LiveTimelineCharaLocator LiveLocator;
[Header("Other")]
public CharaShaderEffectData ShaderEffectData;
+13 -11
View File
@@ -12,6 +12,7 @@ using UmaMusumeAudio;
using UnityEngine;
using UnityEngine.SceneManagement;
using Debug = UnityEngine.Debug;
using Random = UnityEngine.Random;
public class UmaViewerBuilder : MonoBehaviour
{
@@ -46,6 +47,8 @@ public class UmaViewerBuilder : MonoBehaviour
public Animator AnimationCameraAnimator;
public Camera AnimationCamera;
public GameObject LiveControllerPrefab;
private bool ShadersLoaded = false;
private void Awake()
@@ -106,6 +109,8 @@ public class UmaViewerBuilder : MonoBehaviour
CurrentUMAContainer.transform.parent = Gallop.Live.Director.instance.charaObjs[i];
LoadNormalUma(characters[i].CharaEntry, characters[i].CostumeId);
}
Gallop.Live.Director.instance.CharaContainerScript.Add(CurrentUMAContainer);
}
}
}
@@ -652,15 +657,18 @@ public class UmaViewerBuilder : MonoBehaviour
public void LoadLive(LiveEntry live, List<LiveCharacterSelect> characters)
{
GameObject MainLive = new GameObject("Live");
GameObject Director = new GameObject("Director");
GameObject MainLive = Instantiate(LiveControllerPrefab);
Gallop.Live.Director mController = MainLive.GetComponentInChildren<Gallop.Live.Director>();
mController.live = live;
mController.Initialize();
List<GameObject> transferObjs = new List<GameObject>() {
MainLive,
GameObject.Find("ViewerMain"),
GameObject.Find("Directional Light"),
GameObject.Find("GlobalShaderController"),
GameObject.Find("AudioManager")
};
};
UmaSceneController.LoadScene("LiveScene",
delegate ()
@@ -672,17 +680,11 @@ public class UmaViewerBuilder : MonoBehaviour
{
if (a.CharaEntry == null || a.CostumeId == "")
{
//a.CharaEntry = Main.Characters[Random.Range(0, Main.Characters.Count)];
//a.CostumeId = "00";
a.CharaEntry = Main.Characters[Random.Range(0, Main.Characters.Count/2)];
a.CostumeId = "00";
}
});//fill empty
Gallop.Live.Director mController = Director.AddComponent<Gallop.Live.Director>();
mController.live = live;
Instantiate(mController, MainLive.transform);
Destroy(Director);
LoadLiveUma(characters);
},
@@ -133,7 +133,7 @@ namespace Cutt
public List<LiveTimelineLensFlareData> lensFlareList = new List<LiveTimelineLensFlareData>();
public List<LiveTimelineMonitorCameraPositionData> monitorCameraPosKeys = new List<LiveTimelineMonitorCameraPositionData>();
public List<DereLiveTimelineMonitorCameraPositionData> monitorCameraPosKeys = new List<DereLiveTimelineMonitorCameraPositionData>();
public List<LiveTimelineMonitorCameraLookAtData> monitorLookAtPosKeys = new List<LiveTimelineMonitorCameraLookAtData>();
@@ -336,7 +336,7 @@ namespace Cutt
}
return key.dataType switch
{
LiveTimelineKeyDataType.MonitorCameraPos => monitorCameraPosKeys.FindIndex((LiveTimelineMonitorCameraPositionData x) => x.keys.Contains(key)),
LiveTimelineKeyDataType.MonitorCameraPos => monitorCameraPosKeys.FindIndex((DereLiveTimelineMonitorCameraPositionData x) => x.keys.Contains(key)),
LiveTimelineKeyDataType.MonitorCameraLookAt => monitorLookAtPosKeys.FindIndex((LiveTimelineMonitorCameraLookAtData x) => x.keys.Contains(key)),
LiveTimelineKeyDataType.MultiCameraPos => multiCameraPositionKeys.FindIndex((LiveTimelineMultiCameraPositionData x) => x.keys.Contains(key)),
LiveTimelineKeyDataType.MultiCameraLookAt => multiCameraLookAtKeys.FindIndex((LiveTimelineMultiCameraLookAtData x) => x.keys.Contains(key)),
@@ -0,0 +1,16 @@
using System;
namespace Cutt
{
[Serializable]
public class DereLiveTimelineMonitorCameraPositionData : ILiveTimelineGroupDataWithName
{
private const string default_name = "MonitorCameraPos";
public DereLiveTimelineKeyMonitorCameraPositionDataList keys = new DereLiveTimelineKeyMonitorCameraPositionDataList();
public DereLiveTimelineMonitorCameraPositionData() : base("MonitorCameraPos") { }
public override ILiveTimelineKeyDataList GetKeyList() { return keys; }
}
}
@@ -1,16 +0,0 @@
using System;
namespace Cutt
{
[Serializable]
public class LiveTimelineMonitorCameraPositionData : ILiveTimelineGroupDataWithName
{
private const string default_name = "MonitorCameraPos";
public LiveTimelineKeyMonitorCameraPositionDataList keys = new LiveTimelineKeyMonitorCameraPositionDataList();
public LiveTimelineMonitorCameraPositionData() : base("MonitorCameraPos") { }
public override ILiveTimelineKeyDataList GetKeyList() { return keys; }
}
}
@@ -5211,7 +5211,7 @@ namespace Cutt
int count = sheet.monitorCameraPosKeys.Count;
for (int i = 0; i < count; i++)
{
LiveTimelineKeyMonitorCameraPositionDataList keys = sheet.monitorCameraPosKeys[i].keys;
DereLiveTimelineKeyMonitorCameraPositionDataList keys = sheet.monitorCameraPosKeys[i].keys;
if (keys.HasAttribute(LiveTimelineKeyDataListAttr.Disable) || !keys.EnablePlayModeTimeline(_playMode) || _arrMonitorCameraCache.Length <= i)
{
continue;
@@ -0,0 +1,9 @@
using System;
namespace Cutt
{
[Serializable]
public class DereLiveTimelineKeyMonitorCameraPositionDataList : LiveTimelineKeyDataListTemplate<LiveTimelineKeyMonitorCameraPositionData>
{
}
}
@@ -1,9 +0,0 @@
using System;
namespace Cutt
{
[Serializable]
public class LiveTimelineKeyMonitorCameraPositionDataList : LiveTimelineKeyDataListTemplate<LiveTimelineKeyMonitorCameraPositionData>
{
}
}
@@ -29,5 +29,73 @@ namespace Gallop.Live
[SerializeField] // RVA: 0xEBE0 Offset: 0xEBE0 VA: 0x7FF85CCBEBE0
private Animator _cameraAnimator; // 0x70
private Quaternion _currentQuaternion; // 0x78
private bool _initializeAnimationLength;
private float _animationLength;
private void Awake()
{
_targetCamera.transform.parent = _attachObject.transform;
_targetCamera.transform.localPosition = Vector3.zero;
_targetCamera.transform.localRotation = Quaternion.Euler(new Vector3(0f, 180f, 0f));
_targetCamera.transform.localScale = Vector3.one;
_cameraAnimator = _cameraMotionObject.GetComponent<Animator>();
_tmFOVObject = _fovObject.transform;
_tmRotateObject = _rotateObject.transform;
_tmAttachObject = _attachObject.transform;
_tmTranslateObject = _translateObject.transform;
UpdateCamera();
}
public void ActivationUpdate()
{
if (!(_targetCamera == null) && !(_cameraAnimator == null) && !(Director.instance == null))
{
AlterUpdate();
}
}
private void Update()
{
if (Director.instance == null || !Director.instance.isTimelineControlled)
{
AlterUpdate();
}
}
public void AlterUpdate()
{
if (!(_cameraAnimator.runtimeAnimatorController == null))
{
if (!_initializeAnimationLength)
{
_animationLength = _cameraAnimator.GetCurrentAnimatorStateInfo(0).length;
_initializeAnimationLength = true;
}
float normalizedTime = Director.instance.CalcFrameJustifiedMusicTime() / _animationLength;
_cameraAnimator.Play(0, -1, normalizedTime);
_cameraAnimator.speed = 0f;
}
}
private void LateUpdate()
{
UpdateCamera();
if (_targetCamera.fieldOfView < _fieldOfViewLimit)
{
_targetCamera.fieldOfView = _fieldOfViewLimit;
}
}
private void UpdateCamera()
{
_targetCamera.fieldOfView = (0f - _tmFOVObject.localPosition.x) * _multiplyValue;
_tmAttachObject.localPosition = _tmTranslateObject.localPosition;
_currentQuaternion = Quaternion.AngleAxis((0f - _tmRotateObject.localPosition.z) * _multiplyValue, Vector3.forward) * Quaternion.AngleAxis((0f - _tmRotateObject.localPosition.y) * _multiplyValue, Vector3.up) * Quaternion.AngleAxis((0f - _tmRotateObject.localPosition.x) * _multiplyValue, Vector3.right);
_tmAttachObject.localRotation = _currentQuaternion;
}
}
}
@@ -1,136 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Gallop.Live.Cutt;
using System.Runtime.CompilerServices;
namespace Gallop.Live
{
public class CharacterObject : MonoBehaviour, ILiveTimelineCharactorLocator, ILiveTimelineMSQTarget
{
public enum RealtimeShadowType
{
HardShadow = 0,
SoftShadow = 1
}
public const int DRESS_COUNT = 2;
public const int DRESS_MAIN_INDEX = 0;
public const int DRESS_SUB_INDEX = 1;
private int _reserveDressModelCount; // 0x18
private int _activeModelIndex; // 0x1C
private GameObject[] _modelObjectArray; // 0x20
private Transform[] _modelTransformArray; // 0x28
//private LiveModelController[] _liveModelControllerArray; // 0x30
//private GallopSweatController[] _sweatControllerArray; // 0x38
//private EyeTraceController[] _eyeTraceControllerArray; // 0x40
//private LiveModelController.EyeTargetPositionSetter[] _eyeTargetSetter; // 0x48
private const int EffectAttachNum = 26;
private Transform[,] _effectAttachTransformArray; // 0x50
public int prevFrameWarmUpCyspring; // 0x58
public int CurrentFrameEyeTrack; // 0x5C
private List<Collider[]> _colliderListArray; // 0x60
private bool _liveMSQControlled; // 0x68
private float _liveMSQCurrentAnimStartTime; // 0x6C
private bool _bVisible; // 0x70
private LiveCharaPosition _liveCharaStandingPosition; // 0x74
private Vector3 _liveCharaInitialPosition; // 0x78
private const float kLiveCharaHeadPositionOffsetHeight = 0.1f;
private int _liveCharaHeightLevel; // 0x84
private float _liveCharaHeightValue; // 0x88
private float _liveCharaHeightRatioBase; // 0x8C
private float _liveCharaHeightRatio; // 0x90
private Vector3 _liveCharaFormationHeightRateOffset; // 0x94
private bool _isPositionNodePositionAddParent; // 0xA0
private LiveTimelineDefine.FacialEyeTrackTargetType _eyeTrackTargetType; // 0xA4
private GameObject _softShadowCamera; // 0xC0
private GameObject _softShadowReceiver; // 0xC8
private Transform _softShadowCameraTrans; // 0xD0
private Transform _softShadowReceiverTrans; // 0xD8
private const string SoftShadowObjectName = "Shadow Camera";
private CharacterObject.RealtimeShadowType _realtimeShadowType; // 0xE0
private bool _enableRealtimeShadow; // 0xE4
private bool _isMirror; // 0xE5
//private CastShadowEffect _dynamicShadow; // 0xE8
private int _characterDataIndex; // 0xF0
[SerializeField] // RVA: 0xEBE0 Offset: 0xEBE0 VA: 0x7FF85CCBEBE0
private float _motionNoiseTime; // 0xF4
[SerializeField] // RVA: 0xEBE0 Offset: 0xEBE0 VA: 0x7FF85CCBEBE0
private float _motionNoiseRate; // 0xF8
private bool _isUpdateMotionNoiseTime; // 0xFC
protected bool _isLod; // 0xFD
protected Transform _parentDefaultTransform; // 0x100
protected Transform _parentTransform; // 0x108
protected AnimationState _bodyAnimationState; // 0x110
private bool _isSetting; // 0x118
protected bool _isMeshActiveAuto; // 0x119
private readonly Dictionary<int, Props> _dicProps; // 0x120
private readonly List<int> _lstPropHashs; // 0x128
//private FakeShadowController[] _shadowL; // 0x130
//private FakeShadowController[] _shadowR; // 0x138
//private FollowSpotLightController[] _followSpotLightControllers; // 0x140
//private List<Spotlight3dController> _spotlight3dControllerList; // 0x148
private Vector3 _eyeTrackDefaultPos; // 0x150
public int ReserveDressModelCount { get; }
public int ActiveModelIndex { get; }
public int LayerIndex { get; set; }
public Color EmissiveColor { get; set; }
public GameObject[] ModelObjectArray { get; }
public GameObject CurrentModelObject { get; }
public Transform[] ModelTransformArray { get; }
public Transform CurrentModelTransform { get; }
//public LiveModelController[] LiveModelControllerArray { get; }
//public LiveModelController CurrentLiveModelController { get; }
public EyeTraceController[] EyeTraceControllerArray { get; }
public Animation liveMSQAnimation { get; }
public bool liveMSQControlled { get; set; }
public AnimationState liveMSQCurrentAnimState { get; set; }
public float liveMSQCurrentAnimStartTime { get; set; }
public float heightRate { get; }
//public LiveIK IKCtrl { get; }
public bool liveCharaVisible { get; set; }
public LiveCharaPosition liveCharaStandingPosition { get; set; }
public Vector3 liveCharaInitialPosition { get; set; }
public Vector3 liveCharaPosition { get; }
public Quaternion liveCharaPositionLocalRotation { get; set; }
public Vector3 liveCharaHeadPosition { get; }
public Vector3 liveCharaWaistPosition { get; }
public Vector3 liveCharaLeftHandWristPosition { get; }
public Vector3 liveCharaLeftHandAttachPosition { get; }
public Vector3 liveCharaRightHandWristPosition { get; }
public Vector3 liveCharaRightHandAttachPosition { get; }
public Vector3 liveCharaChestPosition { get; }
public Vector3 liveCharaFootPosition { get; }
public Vector3 liveCharaConstHeightHeadPosition { get; }
public Vector3 liveCharaConstHeightWaistPosition { get; }
public Vector3 liveCharaConstHeightChestPosition { get; }
public Vector3 liveCharaInitialHeightHeadPosition { get; }
public Vector3 liveCharaInitialHeightWaistPosition { get; }
public Vector3 liveCharaInitialHeightChestPosition { get; }
public Vector3 liveCharaScale { get; }
public Transform liveParentDefaultTransform { get; set; }
public Transform liveParentTransform { get; set; }
public Transform liveRootTransform { get; }
public int liveCharaHeightLevel { get; set; }
public float liveCharaHeightValue { get; }
public float liveCharaHeightRatioBase { get; set; }
public float liveCharaHeightRatio { get; set; }
public Vector3 liveCharaFormationHeightRateOffset { get; set; }
public bool IsPositionNodePositionAddParent { get; set; }
public bool IsCastShadow { get; set; }
public float CySpringRate { get; set; }
public LiveTimelineDefine.FacialEyeTrackTargetType EyeTrackTargetType { get; set; }
public float EyeTrackVerticalRate { get; set; }
public float EyeTrackHorizontalRate { get; set; }
public Vector3 EyeTrackDirectWorldPosition { get; set; }
public CharacterObject.RealtimeShadowType realtimeShadowType { get; set; }
public bool enableRealtimeShadow { get; set; }
public bool IsMirror { get; set; }
public int CharacterDataIndex { get; set; }
public bool IsUpdateMotionNoiseTime { get; set; }
public bool IsSetting { get; }
public static string FollowSpotLightParentName { get; set; }
public FollowSpotLightController[] FollowSpotLightControllers { get; }
}
}
@@ -0,0 +1,86 @@
using System;
using UnityEngine;
namespace Gallop.Live.Cutt
{
public static class BezierUtil
{
private static Vector3[] subPointsWork = new Vector3[17];
public static void Bezier(ref Vector3 startPos, Vector3[] points, ref Vector3 endPos, float t, out Vector3 outPos)
{
points[0] = startPos;
Array.Copy(points, 0, subPointsWork, 1, points.Length);
points[points.Length + 1] = endPos;
outPos = CalcRecurse(points, points.Length, t);
}
public static void Calc(Vector3[] points, int pointNum, float t, out Vector3 outPos)
{
outPos = CalcRecurse(points, pointNum, t);
}
private static Vector3 CalcRecurse(Vector3[] points, int pointNum, float t)
{
if (pointNum == 2)
{
return Vector3.LerpUnclamped(points[0], points[1], t);
}
for (int i = 0; i < pointNum - 1; i++)
{
subPointsWork[i] = Vector3.LerpUnclamped(points[i], points[i + 1], t);
}
return CalcRecurse(subPointsWork, pointNum - 1, t);
}
public static void Calc(ref Vector3 start, ref Vector3 end, ref Vector3 cp, float t, out Vector3 v3)
{
float num = 1f - t;
float num2 = t * t;
float num3 = 2f * t * num;
float num4 = num * num;
v3.x = num2 * end.x + num3 * cp.x + num4 * start.x;
v3.y = num2 * end.y + num3 * cp.y + num4 * start.y;
v3.z = num2 * end.z + num3 * cp.z + num4 * start.z;
}
public static void Calc(ref Vector3 start, ref Vector3 end, ref Vector3 cp1, ref Vector3 cp2, float t, out Vector3 v3)
{
float num = 1f - t;
float num2 = t * t * t;
float num3 = 3f * t * t * num;
float num4 = 3f * t * num * num;
float num5 = num * num * num;
v3.x = num2 * end.x + num3 * cp2.x + num4 * cp1.x + num5 * start.x;
v3.y = num2 * end.y + num3 * cp2.y + num4 * cp1.y + num5 * start.y;
v3.z = num2 * end.z + num3 * cp2.z + num4 * cp1.z + num5 * start.z;
}
public static void Calc(ref Vector3 start, ref Vector3 end, ref Vector3 cp1, ref Vector3 cp2, ref Vector3 cp3, float t, out Vector3 v3)
{
float num = 1f - t;
float num2 = t * t * t * t;
float num3 = 4f * t * t * t * num;
float num4 = 4f * t * t * num * num;
float num5 = 4f * t * num * num * num;
float num6 = num * num * num * num;
v3.x = num2 * end.x + num3 * cp3.x + num4 * cp2.x + num5 * cp1.x + num6 * start.x;
v3.y = num2 * end.y + num3 * cp3.y + num4 * cp2.y + num5 * cp1.y + num6 * start.y;
v3.z = num2 * end.z + num3 * cp3.z + num4 * cp2.z + num5 * cp1.z + num6 * start.z;
}
public static void Calc(ref Vector3 start, ref Vector3 end, ref Vector3 cp1, ref Vector3 cp2, ref Vector3 cp3, ref Vector3 cp4, float t, out Vector3 v3)
{
float num = 1f - t;
float num2 = t * t * t * t * t;
float num3 = 5f * t * t * t * t * num;
float num4 = 5f * t * t * t * num * num;
float num5 = 5f * t * t * num * num * num;
float num6 = 5f * t * num * num * num * num;
float num7 = num * num * num * num * num;
v3.x = num2 * end.x + num3 * cp4.x + num4 * cp3.x + num5 * cp2.x + num6 * cp1.x + num7 * start.x;
v3.y = num2 * end.y + num3 * cp4.y + num4 * cp3.y + num5 * cp2.y + num6 * cp1.y + num7 * start.y;
v3.z = num2 * end.z + num3 * cp4.z + num4 * cp3.z + num5 * cp2.z + num6 * cp1.z + num7 * start.z;
}
}
}
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 2db4a9726d149bf4c8d4c8cca1d06ff6
guid: 8cc97b2280eb0104497f8eae006afdff
MonoImporter:
externalObjects: {}
serializedVersion: 2
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: add356d6cd2707342824231786b93f34
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,461 @@
using System;
namespace Gallop.Live.Cutt
{
public static class LiveTimelineEasing
{
public enum Type
{
Linear,
ExpoEaseOut,
ExpoEaseIn,
ExpoEaseInOut,
ExpoEaseOutIn,
CircEaseOut,
CircEaseIn,
CircEaseInOut,
CircEaseOutIn,
QuadEaseOut,
QuadEaseIn,
QuadEaseInOut,
QuadEaseOutIn,
SineEaseOut,
SineEaseIn,
SineEaseInOut,
SineEaseOutIn,
CubicEaseOut,
CubicEaseIn,
CubicEaseInOut,
CubicEaseOutIn,
QuartEaseOut,
QuartEaseIn,
QuartEaseInOut,
QuartEaseOutIn,
QuintEaseOut,
QuintEaseIn,
QuintEaseInOut,
QuintEaseOutIn,
ElasticEaseOut,
ElasticEaseIn,
ElasticEaseInOut,
ElasticEaseOutIn,
BounceEaseOut,
BounceEaseIn,
BounceEaseInOut,
BounceEaseOutIn,
BackEaseOut,
BackEaseIn,
BackEaseInOut,
BackEaseOutIn
}
private delegate double EasingFunctionDelegate(double t, double b, double c, double d);
private static int _easeTypeMax = -1;
private static EasingFunctionDelegate[] _functions = new EasingFunctionDelegate[41]
{
Linear,
ExpoEaseOut,
ExpoEaseIn,
ExpoEaseInOut,
ExpoEaseOutIn,
CircEaseOut,
CircEaseIn,
CircEaseInOut,
CircEaseOutIn,
QuadEaseOut,
QuadEaseIn,
QuadEaseInOut,
QuadEaseOutIn,
SineEaseOut,
SineEaseIn,
SineEaseInOut,
SineEaseOutIn,
CubicEaseOut,
CubicEaseIn,
CubicEaseInOut,
CubicEaseOutIn,
QuartEaseOut,
QuartEaseIn,
QuartEaseInOut,
QuartEaseOutIn,
QuintEaseOut,
QuintEaseIn,
QuintEaseInOut,
QuintEaseOutIn,
ElasticEaseOut,
ElasticEaseIn,
ElasticEaseInOut,
ElasticEaseOutIn,
BounceEaseOut,
BounceEaseIn,
BounceEaseInOut,
BounceEaseOutIn,
BackEaseOut,
BackEaseIn,
BackEaseInOut,
BackEaseOutIn
};
public static int easeTypeMax
{
get
{
if (_easeTypeMax < 0)
{
foreach (object value in Enum.GetValues(typeof(Type)))
{
if ((int)value > _easeTypeMax)
{
_easeTypeMax = (int)value;
}
}
_easeTypeMax++;
}
return _easeTypeMax;
}
}
public static float GetValue(Type type, float t, float b, float c, float d)
{
if ((int)type < easeTypeMax)
{
return (float)_functions[(int)type](t, b, c, d);
}
return 0f;
}
public static double Linear(double t, double b, double c, double d)
{
return c * t / d + b;
}
public static double ExpoEaseOut(double t, double b, double c, double d)
{
if (t != d)
{
return c * (0.0 - Math.Pow(2.0, -10.0 * t / d) + 1.0) + b;
}
return b + c;
}
public static double ExpoEaseIn(double t, double b, double c, double d)
{
if (t != 0.0)
{
return c * Math.Pow(2.0, 10.0 * (t / d - 1.0)) + b;
}
return b;
}
public static double ExpoEaseInOut(double t, double b, double c, double d)
{
if (t == 0.0)
{
return b;
}
if (t == d)
{
return b + c;
}
if ((t /= d / 2.0) < 1.0)
{
return c / 2.0 * Math.Pow(2.0, 10.0 * (t - 1.0)) + b;
}
return c / 2.0 * (0.0 - Math.Pow(2.0, -10.0 * (t -= 1.0)) + 2.0) + b;
}
public static double ExpoEaseOutIn(double t, double b, double c, double d)
{
if (t < d / 2.0)
{
return ExpoEaseOut(t * 2.0, b, c / 2.0, d);
}
return ExpoEaseIn(t * 2.0 - d, b + c / 2.0, c / 2.0, d);
}
public static double CircEaseOut(double t, double b, double c, double d)
{
return c * Math.Sqrt(1.0 - (t = t / d - 1.0) * t) + b;
}
public static double CircEaseIn(double t, double b, double c, double d)
{
return (0.0 - c) * (Math.Sqrt(1.0 - (t /= d) * t) - 1.0) + b;
}
public static double CircEaseInOut(double t, double b, double c, double d)
{
if ((t /= d / 2.0) < 1.0)
{
return (0.0 - c) / 2.0 * (Math.Sqrt(1.0 - t * t) - 1.0) + b;
}
return c / 2.0 * (Math.Sqrt(1.0 - (t -= 2.0) * t) + 1.0) + b;
}
public static double CircEaseOutIn(double t, double b, double c, double d)
{
if (t < d / 2.0)
{
return CircEaseOut(t * 2.0, b, c / 2.0, d);
}
return CircEaseIn(t * 2.0 - d, b + c / 2.0, c / 2.0, d);
}
public static double QuadEaseOut(double t, double b, double c, double d)
{
return (0.0 - c) * (t /= d) * (t - 2.0) + b;
}
public static double QuadEaseIn(double t, double b, double c, double d)
{
return c * (t /= d) * t + b;
}
public static double QuadEaseInOut(double t, double b, double c, double d)
{
if ((t /= d / 2.0) < 1.0)
{
return c / 2.0 * t * t + b;
}
return (0.0 - c) / 2.0 * ((t -= 1.0) * (t - 2.0) - 1.0) + b;
}
public static double QuadEaseOutIn(double t, double b, double c, double d)
{
if (t < d / 2.0)
{
return QuadEaseOut(t * 2.0, b, c / 2.0, d);
}
return QuadEaseIn(t * 2.0 - d, b + c / 2.0, c / 2.0, d);
}
public static double SineEaseOut(double t, double b, double c, double d)
{
return c * Math.Sin(t / d * (Math.PI / 2.0)) + b;
}
public static double SineEaseIn(double t, double b, double c, double d)
{
return (0.0 - c) * Math.Cos(t / d * (Math.PI / 2.0)) + c + b;
}
public static double SineEaseInOut(double t, double b, double c, double d)
{
if ((t /= d / 2.0) < 1.0)
{
return c / 2.0 * Math.Sin(Math.PI * t / 2.0) + b;
}
return (0.0 - c) / 2.0 * (Math.Cos(Math.PI * (t -= 1.0) / 2.0) - 2.0) + b;
}
public static double SineEaseOutIn(double t, double b, double c, double d)
{
if (t < d / 2.0)
{
return SineEaseOut(t * 2.0, b, c / 2.0, d);
}
return SineEaseIn(t * 2.0 - d, b + c / 2.0, c / 2.0, d);
}
public static double CubicEaseOut(double t, double b, double c, double d)
{
return c * ((t = t / d - 1.0) * t * t + 1.0) + b;
}
public static double CubicEaseIn(double t, double b, double c, double d)
{
return c * (t /= d) * t * t + b;
}
public static double CubicEaseInOut(double t, double b, double c, double d)
{
if ((t /= d / 2.0) < 1.0)
{
return c / 2.0 * t * t * t + b;
}
return c / 2.0 * ((t -= 2.0) * t * t + 2.0) + b;
}
public static double CubicEaseOutIn(double t, double b, double c, double d)
{
if (t < d / 2.0)
{
return CubicEaseOut(t * 2.0, b, c / 2.0, d);
}
return CubicEaseIn(t * 2.0 - d, b + c / 2.0, c / 2.0, d);
}
public static double QuartEaseOut(double t, double b, double c, double d)
{
return (0.0 - c) * ((t = t / d - 1.0) * t * t * t - 1.0) + b;
}
public static double QuartEaseIn(double t, double b, double c, double d)
{
return c * (t /= d) * t * t * t + b;
}
public static double QuartEaseInOut(double t, double b, double c, double d)
{
if ((t /= d / 2.0) < 1.0)
{
return c / 2.0 * t * t * t * t + b;
}
return (0.0 - c) / 2.0 * ((t -= 2.0) * t * t * t - 2.0) + b;
}
public static double QuartEaseOutIn(double t, double b, double c, double d)
{
if (t < d / 2.0)
{
return QuartEaseOut(t * 2.0, b, c / 2.0, d);
}
return QuartEaseIn(t * 2.0 - d, b + c / 2.0, c / 2.0, d);
}
public static double QuintEaseOut(double t, double b, double c, double d)
{
return c * ((t = t / d - 1.0) * t * t * t * t + 1.0) + b;
}
public static double QuintEaseIn(double t, double b, double c, double d)
{
return c * (t /= d) * t * t * t * t + b;
}
public static double QuintEaseInOut(double t, double b, double c, double d)
{
if ((t /= d / 2.0) < 1.0)
{
return c / 2.0 * t * t * t * t * t + b;
}
return c / 2.0 * ((t -= 2.0) * t * t * t * t + 2.0) + b;
}
public static double QuintEaseOutIn(double t, double b, double c, double d)
{
if (t < d / 2.0)
{
return QuintEaseOut(t * 2.0, b, c / 2.0, d);
}
return QuintEaseIn(t * 2.0 - d, b + c / 2.0, c / 2.0, d);
}
public static double ElasticEaseOut(double t, double b, double c, double d)
{
if ((t /= d) == 1.0)
{
return b + c;
}
double num = d * 0.3;
double num2 = num / 4.0;
return c * Math.Pow(2.0, -10.0 * t) * Math.Sin((t * d - num2) * (Math.PI * 2.0) / num) + c + b;
}
public static double ElasticEaseIn(double t, double b, double c, double d)
{
if ((t /= d) == 1.0)
{
return b + c;
}
double num = d * 0.3;
double num2 = num / 4.0;
return 0.0 - c * Math.Pow(2.0, 10.0 * (t -= 1.0)) * Math.Sin((t * d - num2) * (Math.PI * 2.0) / num) + b;
}
public static double ElasticEaseInOut(double t, double b, double c, double d)
{
if ((t /= d / 2.0) == 2.0)
{
return b + c;
}
double num = d * 0.44999999999999996;
double num2 = num / 4.0;
if (t < 1.0)
{
return -0.5 * (c * Math.Pow(2.0, 10.0 * (t -= 1.0)) * Math.Sin((t * d - num2) * (Math.PI * 2.0) / num)) + b;
}
return c * Math.Pow(2.0, -10.0 * (t -= 1.0)) * Math.Sin((t * d - num2) * (Math.PI * 2.0) / num) * 0.5 + c + b;
}
public static double ElasticEaseOutIn(double t, double b, double c, double d)
{
if (t < d / 2.0)
{
return ElasticEaseOut(t * 2.0, b, c / 2.0, d);
}
return ElasticEaseIn(t * 2.0 - d, b + c / 2.0, c / 2.0, d);
}
public static double BounceEaseOut(double t, double b, double c, double d)
{
if ((t /= d) < 0.36363636363636365)
{
return c * (7.5625 * t * t) + b;
}
if (t < 0.72727272727272729)
{
return c * (7.5625 * (t -= 0.54545454545454541) * t + 0.75) + b;
}
if (t < 0.90909090909090906)
{
return c * (7.5625 * (t -= 0.81818181818181823) * t + 0.9375) + b;
}
return c * (7.5625 * (t -= 21.0 / 22.0) * t + 63.0 / 64.0) + b;
}
public static double BounceEaseIn(double t, double b, double c, double d)
{
return c - BounceEaseOut(d - t, 0.0, c, d) + b;
}
public static double BounceEaseInOut(double t, double b, double c, double d)
{
if (t < d / 2.0)
{
return BounceEaseIn(t * 2.0, 0.0, c, d) * 0.5 + b;
}
return BounceEaseOut(t * 2.0 - d, 0.0, c, d) * 0.5 + c * 0.5 + b;
}
public static double BounceEaseOutIn(double t, double b, double c, double d)
{
if (t < d / 2.0)
{
return BounceEaseOut(t * 2.0, b, c / 2.0, d);
}
return BounceEaseIn(t * 2.0 - d, b + c / 2.0, c / 2.0, d);
}
public static double BackEaseOut(double t, double b, double c, double d)
{
return c * ((t = t / d - 1.0) * t * (2.70158 * t + 1.70158) + 1.0) + b;
}
public static double BackEaseIn(double t, double b, double c, double d)
{
return c * (t /= d) * t * (2.70158 * t - 1.70158) + b;
}
public static double BackEaseInOut(double t, double b, double c, double d)
{
double num = 1.70158;
if ((t /= d / 2.0) < 1.0)
{
return c / 2.0 * (t * t * (((num *= 1.525) + 1.0) * t - num)) + b;
}
return c / 2.0 * ((t -= 2.0) * t * (((num *= 1.525) + 1.0) * t + num) + 2.0) + b;
}
public static double BackEaseOutIn(double t, double b, double c, double d)
{
if (t < d / 2.0)
{
return BackEaseOut(t * 2.0, b, c / 2.0, d);
}
return BackEaseIn(t * 2.0 - d, b + c / 2.0, c / 2.0, d);
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 18166ee5027bfd6488364a4e0e57bda1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -19,5 +19,45 @@ namespace Gallop.Live.Cutt
LiveTimelineKeyIndex FindCurrentKey(float currentTime);
LiveTimelineKeyIndex UpdateCurrentKey(float currentTime);
LiveTimelineKey this[int index] { get; set; }
LiveTimelineKeyDataListAttr attribute { get; set; }
TimelineKeyPlayMode playMode { get; set; }
int depthCounter { get; }
void Insert(int index, LiveTimelineKey item);
IEnumerator<LiveTimelineKey> GetEnumerator();
void Add(LiveTimelineKey item);
void Clear();
bool Remove(LiveTimelineKey item);
void RemoveAt(int index);
IEnumerable<LiveTimelineKey> ToEnumerable();
LiveTimelineKey At(int index);
LiveTimelineKey[] ToArray();
List<LiveTimelineKey> ToList();
bool HasAttribute(LiveTimelineKeyDataListAttr attr);
bool EnablePlayModeTimeline(TimelinePlayerMode playerMode);
FindKeyResult FindKeyCached(int frame, bool ignoreCache);
FindKeyResult FindCurrentKey(int frame);
FindKeyResult FindCurrentKeyNeighbor(int frame, int baseIndex);
List<LiveTimelineKey> GetRange(int index, int count);
}
}
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: cec5ac8f4ed2b4f45837e9d4d8f3a997
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,12 @@
using UnityEngine;
namespace Gallop.Live.Cutt
{
public class LiveTimelineCamLookAtLocator : MonoBehaviour
{
private void Awake()
{
Object.Destroy(this);
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 8e37b05c1d0746a41b8d506037fe66cc
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,12 @@
using UnityEngine;
namespace Gallop.Live.Cutt
{
public class LiveTimelineCamPosLocator : MonoBehaviour
{
private void Awake()
{
Object.Destroy(this);
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 40af6c8e71c671f4ead4328697430cf6
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,97 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
namespace Gallop.Live.Cutt
{
public class LiveTimelineCharaLocator : ILiveTimelineCharactorLocator
{
public UmaContainer UmaContainer;
public Dictionary<string, Transform> Bones;
public LiveTimelineCharaLocator(UmaContainer umaContainer)
{
UmaContainer = umaContainer;
Bones = new Dictionary<string, Transform>();
foreach (var bone in umaContainer.GetComponentsInChildren<Transform>())
{
if (!Bones.ContainsKey(bone.name))
{
Bones.Add(bone.name, bone);
}
}
HeadHeght = Bones["Position"].InverseTransformPoint(Bones["Head"].position).y;
WaistHeght = Bones["Position"].InverseTransformPoint(Bones["Waist"].position).y;
ChestHeght = Bones["Position"].InverseTransformPoint(Bones["Chest"].position).y;
}
float HeadHeght;
float WaistHeght;
float ChestHeght;
public bool liveCharaVisible { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public LiveCharaPosition liveCharaStandingPosition { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public Vector3 liveCharaInitialPosition { get => _liveCharaInitialPosition; set => _liveCharaInitialPosition = value; }
private Vector3 _liveCharaInitialPosition = Vector3.zero;
public Vector3 liveCharaPosition => throw new NotImplementedException();
public Quaternion liveCharaPositionLocalRotation { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public Vector3 liveCharaHeadPosition => UmaContainer.HeadBone.transform.position + new Vector3(0, UmaContainer.EyeHeight, 0);
public Vector3 liveCharaWaistPosition => Bones["Waist"].position;
public Vector3 liveCharaLeftHandWristPosition => Bones["Wrist_L"].position;
public Vector3 liveCharaLeftHandAttachPosition => Bones["Hand_Attach_L"].position;
public Vector3 liveCharaRightHandAttachPosition => Bones["Hand_Attach_R"].position;
public Vector3 liveCharaRightHandWristPosition => Bones["Wrist_R"].position;
public Vector3 liveCharaChestPosition => Bones["Chest"].position;
public Vector3 liveCharaFootPosition => new Vector3(liveCharaChestPosition.x, 0, liveCharaChestPosition.y);
public Vector3 liveCharaConstHeightHeadPosition => new Vector3(liveCharaInitialPosition.x, HeadHeght, liveCharaInitialPosition.y);
public Vector3 liveCharaConstHeightWaistPosition => new Vector3(liveCharaInitialPosition.x, WaistHeght, liveCharaInitialPosition.y);
public Vector3 liveCharaConstHeightChestPosition => new Vector3(liveCharaInitialPosition.x, ChestHeght, liveCharaInitialPosition.y);
public Vector3 liveCharaInitialHeightHeadPosition => throw new NotImplementedException();
public Vector3 liveCharaInitialHeightWaistPosition => throw new NotImplementedException();
public Vector3 liveCharaInitialHeightChestPosition => throw new NotImplementedException();
public Vector3 liveCharaScale => Bones["Position"].localScale;
public Transform liveParentDefaultTransform { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public Transform liveParentTransform { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public Transform liveRootTransform => throw new NotImplementedException();
public int liveCharaHeightLevel { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public float liveCharaHeightValue => 160 * Bones["Position"].localScale.y;
public float liveCharaHeightRatioBase { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public float liveCharaHeightRatio { get => 1; set => throw new NotImplementedException(); }
public Vector3 liveCharaFormationHeightRateOffset { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public bool IsPositionNodePositionAddParent { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public bool IsCastShadow { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public float CySpringRate { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public int LayerIndex { set => throw new NotImplementedException(); }
public Color EmissiveColor { set => throw new NotImplementedException(); }
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 6b4bac6f526569b42a2e3d41ef56f17e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
File diff suppressed because it is too large Load Diff
@@ -2,7 +2,7 @@ using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Gallop.Cutt.Util;
using Cutt;
using Gallop.Live.Cutt;
namespace Gallop.Live.Cutt
{
@@ -1,4 +1,4 @@
using Cutt;
using Gallop.Live.Cutt;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
@@ -1,4 +1,4 @@
using Cutt;
using Gallop.Live.Cutt;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
@@ -20,6 +20,92 @@ namespace Gallop.Live.Cutt
public Vector3 charaPos;
public Vector3[] bezierPoints;
public float traceSpeed;
public Vector3 rotation = Vector3.forward;
public float eyeLength = 10f;
public Vector3 offset = Vector3.zero;
public bool newBezierCalcMethod;
public bool necessaryToUseNewBezierCalcMethod
{
get
{
if (!newBezierCalcMethod)
{
return GetBezierPointCount() > 3;
}
return true;
}
}
public bool HasBezier()
{
if (bezierPoints != null)
{
return bezierPoints.Length != 0;
}
return false;
}
public int GetBezierPointCount()
{
if (!HasBezier())
{
return 0;
}
return bezierPoints.Length;
}
public Vector3 GetBezierPoint(int index, LiveTimelineControl timelineControl, Vector3 camPos)
{
if (HasBezier() && index < bezierPoints.Length)
{
return GetValue(timelineControl, camPos) + bezierPoints[index];
}
return GetValue(timelineControl, camPos) + Vector3.zero;
}
public void GetBezierPoints(LiveTimelineControl timelineControl, Vector3 camPos, Vector3[] outPoints, int startIndex)
{
if (HasBezier())
{
int num = Mathf.Min(outPoints.Length, bezierPoints.Length);
Vector3 value = GetValue(timelineControl, camPos);
for (int i = 0; i < num; i++)
{
outPoints[startIndex + i] = value + bezierPoints[i];
}
}
}
public virtual Vector3 GetValue(LiveTimelineControl timelineControl, Vector3 camPos)
{
return GetValue(timelineControl, lookAtType, camPos, containOffset: true);
}
protected virtual Vector3 GetValue(LiveTimelineControl timelineControl, LiveCameraLookAtType type, Vector3 camPos, bool containOffset)
{
Vector3 vector = Vector3.zero;
switch (type)
{
case LiveCameraLookAtType.Character:
vector += timelineControl.GetPositionWithCharacters(lookAtCharaPos, lookAtCharaParts);
break;
case LiveCameraLookAtType.Direct:
{
Vector3 vector2 = Quaternion.Euler(rotation) * Vector3.forward * eyeLength;
vector = camPos + vector2;
break;
}
}
if (!containOffset)
{
return vector;
}
return vector + offset;
}
}
[System.Serializable]
@@ -10,7 +10,6 @@ namespace Gallop.Live.Cutt
public bool enable;
public float fov;
public float roll;
public LiveCameraCullingLayer cullingMask;
}
[System.Serializable]
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 68b636722278d2346926822cb2c60910
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,9 @@
namespace Gallop.Live.Cutt
{
public struct CameraPosUpdateInfo
{
public float outlineZOffset;
public int characterLODMask;
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 5f756ac2cf9111b409997b33ef3f4e3d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -176,6 +176,7 @@ namespace Gallop.Live
[SerializeField]
private GameObject[] _cameraNodes;
private Camera[] _cameraObjects;
private Transform[] _cameraTransforms;
private CameraEventCallback[] _cameraEventCallbackArray;
private GameObject _transparentCameraObject;
private Camera _transparentCamera;
@@ -194,7 +195,7 @@ namespace Gallop.Live
private HandShakeCamera _handShakeCamera;
private int _activeCameraIndex;
private readonly int kMotionCameraIndex;
private readonly int[] kTimelineCameraIndices;
private readonly int[] kTimelineCameraIndices = new int[3] { 1, 2, 3 };
//private GallopFrameBuffer _frameBuffer;
//private LowResolutionCameraFrameBuffer[] _lowResolutionCameraArray;
private Camera _mainCameraObject;
@@ -317,6 +318,8 @@ namespace Gallop.Live
public List<Transform> charaObjs;
public List<UmaContainer> CharaContainerScript = new List<UmaContainer>();
public List<Animation> charaAnims;
public List<LiveTimelineCharaMotSeqData> seqData;
@@ -344,7 +347,32 @@ namespace Gallop.Live
public SliderControl sliderControl;
private void Awake()
public bool isTimelineControlled
{
get
{
if (_liveTimelineControl != null)
{
return _liveTimelineControl.data != null;
}
return false;
}
}
public float CalcFrameJustifiedMusicTime()
{
if (isTimelineControlled)
{
return (float)Mathf.RoundToInt(musicScoreTime * 60f) / 60f;
}
return musicScoreTime;
}
public float musicScoreTime => Mathf.Clamp(smoothMusicScoreTime, 0f, 99999f);
private float smoothMusicScoreTime => _liveCurrentTime;//temp to liveCurrentTime
public void Initialize()
{
if (live != null)
{
@@ -381,7 +409,6 @@ namespace Gallop.Live
}
}
public void InitializeUI()
{
UI = GameObject.Find("LiveUI").GetComponent<LiveViewerUI>();
@@ -418,9 +445,9 @@ namespace Gallop.Live
var nextKey = keyData_.nextKey as LiveTimelineKeyLipSyncData;
for (int k = 0; k < charaObjs.Count; k++)
{
var container = charaObjs[k].GetComponentInChildren<UmaContainer>();
if(container != null)
if(k < CharaContainerScript.Count)
{
var container = CharaContainerScript[k];
container.FaceDrivenKeyTarget.AlterUpdateAutoLip(prevKey, curKey, liveTime_, ((int)curKey.character >> k) % 2);
}
}
@@ -429,10 +456,83 @@ namespace Gallop.Live
{
if( position < charaObjs.Count)
{
var container = charaObjs[position].GetComponentInChildren<UmaContainer>();
var container = CharaContainerScript[position];
container.FaceDrivenKeyTarget.AlterUpdateFacialNew(ref updateInfo_, liveTime_);
}
};
SetupCharacterLocator();
InitializeCamera();
UpdateMainCamera();
for (int i = 0; i < kTimelineCameraIndices.Length; i++)
{
int num = kTimelineCameraIndices[i];
if (num < _cameraObjects.Length)
{
_liveTimelineControl.SetTimelineCamera(_cameraObjects[num], i);
}
}
_liveTimelineControl.OnUpdateCameraSwitcher += delegate (int cameraIndex_)
{
if (cameraIndex_ < 0)
{
_activeCameraIndex = 0;
}
else if (cameraIndex_ < kTimelineCameraIndices.Length)
{
_activeCameraIndex = kTimelineCameraIndices[cameraIndex_];
}
};
}
public void InitializeCamera()
{
if (_cameraObjects == null)
{
_cameraObjects = new Camera[_cameraNodes.Length + 1];
_cameraTransforms = new Transform[_cameraNodes.Length + 1];
for (int i = 0; i < _cameraNodes.Length; i++)
{
GameObject gameObject = _cameraNodes[i];
Camera camera = gameObject.GetComponent<Camera>();
if (camera == null)
{
camera = gameObject.GetComponentInChildren<Camera>();
}
//camera.cullingMask = num;
_cameraObjects[i] = camera;
_cameraTransforms[i] = camera.transform;
}
}
}
private void UpdateMainCamera()
{
if (_cameraObjects == null) return;
for (int i = 0; i < _cameraNodes.Length; i++)
{
bool activeSelf = _cameraNodes[i].activeSelf;
bool flag = i == _activeCameraIndex;
_cameraNodes[i].SetActive(flag);
if (i == 0 && activeSelf != flag && flag && _cameraLookAt != null)
{
_cameraLookAt.ActivationUpdate();
}
}
_mainCameraObject = _cameraObjects[_activeCameraIndex];
_mainCameraTransform = _cameraTransforms[_activeCameraIndex];
}
private void SetupCharacterLocator()
{
if (!_liveTimelineControl) return;
for (int i = 0; i < CharaContainerScript.Count; i++)
{
var container = CharaContainerScript[i];
container.LiveLocator = new LiveTimelineCharaLocator(container);
_liveTimelineControl.liveCharactorLocators[i] = container.LiveLocator;
container.LiveLocator.liveCharaInitialPosition = container.transform.position;
}
}
public void InitializeMusic(int songid, List<LiveCharacterSelect> characters)
@@ -446,7 +546,6 @@ namespace Gallop.Live
singer = 1;
}
for (int i = 0; i < characters.Count; i++)
{
if (characters[i].CharaEntry.Name != "" && i < 3)
@@ -479,8 +578,6 @@ namespace Gallop.Live
liveMusic = UmaViewerAudio.ApplySound(string.Format(SONG_PATH, songid));
}
public void Play()
{
@@ -582,6 +679,12 @@ namespace Gallop.Live
}
}
}
UpdateMainCamera();
}
private void LateUpdate()
{
_liveTimelineControl.AlterLateUpdate();
}
}