add live camera support
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8cc97b2280eb0104497f8eae006afdff
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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:
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Gallop.Live.Cutt
|
||||
{
|
||||
public class LiveTimelineCamLookAtLocator : MonoBehaviour
|
||||
{
|
||||
private void Awake()
|
||||
{
|
||||
Object.Destroy(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
+11
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
+11
@@ -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
+1
-1
@@ -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
-1
@@ -1,4 +1,4 @@
|
||||
using Cutt;
|
||||
using Gallop.Live.Cutt;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
using Cutt;
|
||||
using Gallop.Live.Cutt;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
+86
@@ -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]
|
||||
|
||||
-1
@@ -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:
|
||||
Reference in New Issue
Block a user