mirror of
https://github.com/Project-Redacted/Highscores-Server.git
synced 2025-05-23 11:54:52 +00:00
Add example Unity Project
This commit is contained in:
parent
fda7ff28dd
commit
e3acdb9d6b
7122 changed files with 505543 additions and 2 deletions
|
@ -0,0 +1,47 @@
|
|||
using System;
|
||||
|
||||
namespace UnityEngine.Timeline
|
||||
{
|
||||
partial class AnimationPlayableAsset : ISerializationCallbackReceiver
|
||||
{
|
||||
enum Versions
|
||||
{
|
||||
Initial = 0,
|
||||
RotationAsEuler = 1,
|
||||
}
|
||||
static readonly int k_LatestVersion = (int)Versions.RotationAsEuler;
|
||||
[SerializeField, HideInInspector] int m_Version;
|
||||
|
||||
[SerializeField, Obsolete("Use m_RotationEuler Instead", false), HideInInspector]
|
||||
private Quaternion m_Rotation = Quaternion.identity; // deprecated. now saves in euler angles
|
||||
|
||||
void ISerializationCallbackReceiver.OnBeforeSerialize()
|
||||
{
|
||||
m_Version = k_LatestVersion;
|
||||
}
|
||||
|
||||
void ISerializationCallbackReceiver.OnAfterDeserialize()
|
||||
{
|
||||
if (m_Version < k_LatestVersion)
|
||||
{
|
||||
OnUpgradeFromVersion(m_Version); //upgrade derived classes
|
||||
}
|
||||
}
|
||||
|
||||
void OnUpgradeFromVersion(int oldVersion)
|
||||
{
|
||||
if (oldVersion < (int)Versions.RotationAsEuler)
|
||||
AnimationPlayableAssetUpgrade.ConvertRotationToEuler(this);
|
||||
}
|
||||
|
||||
static class AnimationPlayableAssetUpgrade
|
||||
{
|
||||
public static void ConvertRotationToEuler(AnimationPlayableAsset asset)
|
||||
{
|
||||
#pragma warning disable 618
|
||||
asset.m_EulerAngles = asset.m_Rotation.eulerAngles;
|
||||
#pragma warning restore 618
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6773203120b27984d9a8572fa3564f03
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,102 @@
|
|||
using System;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace UnityEngine.Timeline
|
||||
{
|
||||
partial class AnimationTrack
|
||||
{
|
||||
// 649 is value is only assigned to. they can be updated from old files being serialized
|
||||
#pragma warning disable 649
|
||||
//fields that are used for upgrading should be put here, ideally as read-only
|
||||
[SerializeField, Obsolete("Use m_InfiniteClipOffsetEulerAngles Instead", false), HideInInspector]
|
||||
Quaternion m_OpenClipOffsetRotation = Quaternion.identity;
|
||||
|
||||
[SerializeField, Obsolete("Use m_RotationEuler Instead", false), HideInInspector]
|
||||
Quaternion m_Rotation = Quaternion.identity;
|
||||
|
||||
[SerializeField, Obsolete("Use m_RootTransformOffsetMode", false), HideInInspector]
|
||||
bool m_ApplyOffsets;
|
||||
#pragma warning restore 649
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
[Obsolete("openClipOffsetPosition has been deprecated. Use infiniteClipOffsetPosition instead. (UnityUpgradable) -> infiniteClipOffsetPosition", true)]
|
||||
public Vector3 openClipOffsetPosition
|
||||
{
|
||||
get { return infiniteClipOffsetPosition; }
|
||||
set { infiniteClipOffsetPosition = value; }
|
||||
}
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
[Obsolete("openClipOffsetRotation has been deprecated. Use infiniteClipOffsetRotation instead. (UnityUpgradable) -> infiniteClipOffsetRotation", true)]
|
||||
public Quaternion openClipOffsetRotation
|
||||
{
|
||||
get { return infiniteClipOffsetRotation; }
|
||||
set { infiniteClipOffsetRotation = value; }
|
||||
}
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
[Obsolete("openClipOffsetEulerAngles has been deprecated. Use infiniteClipOffsetEulerAngles instead. (UnityUpgradable) -> infiniteClipOffsetEulerAngles", true)]
|
||||
public Vector3 openClipOffsetEulerAngles
|
||||
{
|
||||
get { return infiniteClipOffsetEulerAngles; }
|
||||
set { infiniteClipOffsetEulerAngles = value; }
|
||||
}
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
[Obsolete("openClipPreExtrapolation has been deprecated. Use infiniteClipPreExtrapolation instead. (UnityUpgradable) -> infiniteClipPreExtrapolation", true)]
|
||||
public TimelineClip.ClipExtrapolation openClipPreExtrapolation
|
||||
{
|
||||
get { return infiniteClipPreExtrapolation; }
|
||||
set { infiniteClipPreExtrapolation = value; }
|
||||
}
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
[Obsolete("openClipPostExtrapolation has been deprecated. Use infiniteClipPostExtrapolation instead. (UnityUpgradable) -> infiniteClipPostExtrapolation", true)]
|
||||
public TimelineClip.ClipExtrapolation openClipPostExtrapolation
|
||||
{
|
||||
get { return infiniteClipPostExtrapolation; }
|
||||
set { infiniteClipPostExtrapolation = value; }
|
||||
}
|
||||
|
||||
internal override void OnUpgradeFromVersion(int oldVersion)
|
||||
{
|
||||
if (oldVersion < (int)Versions.RotationAsEuler)
|
||||
AnimationTrackUpgrade.ConvertRotationsToEuler(this);
|
||||
if (oldVersion < (int)Versions.RootMotionUpgrade)
|
||||
AnimationTrackUpgrade.ConvertRootMotion(this);
|
||||
if (oldVersion < (int)Versions.AnimatedTrackProperties)
|
||||
AnimationTrackUpgrade.ConvertInfiniteTrack(this);
|
||||
}
|
||||
|
||||
// 612 is Property is Obsolete
|
||||
// 618 is Field is Obsolete
|
||||
#pragma warning disable 612, 618
|
||||
static class AnimationTrackUpgrade
|
||||
{
|
||||
public static void ConvertRotationsToEuler(AnimationTrack track)
|
||||
{
|
||||
track.m_EulerAngles = track.m_Rotation.eulerAngles;
|
||||
track.m_InfiniteClipOffsetEulerAngles = track.m_OpenClipOffsetRotation.eulerAngles;
|
||||
}
|
||||
|
||||
public static void ConvertRootMotion(AnimationTrack track)
|
||||
{
|
||||
track.m_TrackOffset = TrackOffset.Auto; // loaded tracks should use legacy mode
|
||||
|
||||
// reset offsets if not applied
|
||||
if (!track.m_ApplyOffsets)
|
||||
{
|
||||
track.m_Position = Vector3.zero;
|
||||
track.m_EulerAngles = Vector3.zero;
|
||||
}
|
||||
}
|
||||
|
||||
public static void ConvertInfiniteTrack(AnimationTrack track)
|
||||
{
|
||||
track.m_InfiniteClip = track.m_AnimClip;
|
||||
track.m_AnimClip = null;
|
||||
}
|
||||
}
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 3b0c53b13a1539949b3b212e049151d1
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,34 @@
|
|||
namespace UnityEngine.Timeline
|
||||
{
|
||||
partial class TimelineClip
|
||||
{
|
||||
enum Versions
|
||||
{
|
||||
Initial = 0,
|
||||
ClipInFromGlobalToLocal = 1
|
||||
}
|
||||
const int k_LatestVersion = (int)Versions.ClipInFromGlobalToLocal;
|
||||
[SerializeField, HideInInspector] int m_Version;
|
||||
|
||||
//fields that are used for upgrading should be put here, ideally as read-only
|
||||
|
||||
void UpgradeToLatestVersion()
|
||||
{
|
||||
if (m_Version < (int)Versions.ClipInFromGlobalToLocal)
|
||||
{
|
||||
TimelineClipUpgrade.UpgradeClipInFromGlobalToLocal(this);
|
||||
}
|
||||
}
|
||||
|
||||
static class TimelineClipUpgrade
|
||||
{
|
||||
// version 0->1, clipIn move from global to local
|
||||
public static void UpgradeClipInFromGlobalToLocal(TimelineClip clip)
|
||||
{
|
||||
// case 936751 -- clipIn was serialized in global, not local offset
|
||||
if (clip.m_ClipIn > 0 && clip.m_TimeScale > float.Epsilon)
|
||||
clip.m_ClipIn *= clip.m_TimeScale;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6a4f0c91a28ece04198b200dd55145d0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,21 @@
|
|||
namespace UnityEngine.Timeline
|
||||
{
|
||||
partial class TimelineAsset
|
||||
{
|
||||
enum Versions
|
||||
{
|
||||
Initial = 0
|
||||
}
|
||||
const int k_LatestVersion = (int)Versions.Initial;
|
||||
[SerializeField, HideInInspector] int m_Version;
|
||||
|
||||
//fields that are used for upgrading should be put here, ideally as read-only
|
||||
|
||||
void UpgradeToLatestVersion()
|
||||
{}
|
||||
|
||||
//upgrade code should go into this class
|
||||
static class TimelineAssetUpgrade
|
||||
{}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 95c91abdcc1ea03458c2ea4e9626a5d8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,76 @@
|
|||
using System;
|
||||
using UnityEngine.Serialization;
|
||||
|
||||
namespace UnityEngine.Timeline
|
||||
{
|
||||
partial class TrackAsset : ISerializationCallbackReceiver
|
||||
{
|
||||
internal enum Versions
|
||||
{
|
||||
Initial = 0,
|
||||
RotationAsEuler = 1,
|
||||
RootMotionUpgrade = 2,
|
||||
AnimatedTrackProperties = 3
|
||||
}
|
||||
|
||||
const int k_LatestVersion = (int)Versions.AnimatedTrackProperties;
|
||||
|
||||
[SerializeField, HideInInspector] int m_Version;
|
||||
|
||||
[Obsolete("Please use m_InfiniteClip (on AnimationTrack) instead.", false)]
|
||||
[SerializeField, HideInInspector, FormerlySerializedAs("m_animClip")]
|
||||
internal AnimationClip m_AnimClip;
|
||||
|
||||
protected virtual void OnBeforeTrackSerialize() {}
|
||||
protected virtual void OnAfterTrackDeserialize() {}
|
||||
|
||||
internal virtual void OnUpgradeFromVersion(int oldVersion) {}
|
||||
|
||||
void ISerializationCallbackReceiver.OnBeforeSerialize()
|
||||
{
|
||||
m_Version = k_LatestVersion;
|
||||
|
||||
//make sure children are correctly parented
|
||||
if (m_Children != null)
|
||||
{
|
||||
for (var i = m_Children.Count - 1; i >= 0; i--)
|
||||
{
|
||||
var asset = m_Children[i] as TrackAsset;
|
||||
if (asset != null && asset.parent != this)
|
||||
asset.parent = this;
|
||||
}
|
||||
}
|
||||
|
||||
OnBeforeTrackSerialize();
|
||||
}
|
||||
|
||||
void ISerializationCallbackReceiver.OnAfterDeserialize()
|
||||
{
|
||||
// Clear the clip cache when a deserialize is performed, or
|
||||
// we can get out of sync when performing Undo
|
||||
m_ClipsCache = null;
|
||||
Invalidate();
|
||||
|
||||
if (m_Version < k_LatestVersion)
|
||||
{
|
||||
UpgradeToLatestVersion(); //upgrade TrackAsset
|
||||
OnUpgradeFromVersion(m_Version); //upgrade derived classes
|
||||
}
|
||||
|
||||
foreach (var marker in GetMarkers())
|
||||
{
|
||||
marker.Initialize(this);
|
||||
}
|
||||
|
||||
OnAfterTrackDeserialize();
|
||||
}
|
||||
|
||||
//fields that are used for upgrading should be put here, ideally as read-only
|
||||
void UpgradeToLatestVersion()
|
||||
{}
|
||||
|
||||
//upgrade code should go into this class
|
||||
static class TrackAssetUpgrade
|
||||
{}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c68f34993bfe85e489158a29c99a20b5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Add table
Add a link
Reference in a new issue