Initial commit

This commit is contained in:
2025-12-10 21:06:22 +01:00
commit cc9190b9ce
476 changed files with 320218 additions and 0 deletions

View File

@@ -0,0 +1,120 @@
namespace Marro.PacManUdon
{
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor.Animations;
using UnityEditor;
public class AnimationRecorder : MonoBehaviour
{
[SerializeField] AnimationClip clip;
[SerializeField] GameObject root;
[SerializeField] GameObject[] gameObjectsToAnimate;
private GameObjectRecorder recorder;
void Start()
{
recorder = new GameObjectRecorder(root);
foreach (GameObject gameObject in gameObjectsToAnimate)
{
// if(gameObject.GetComponent<PacMan>() || gameObject.GetComponent<Ghost>())
// {
// recorder.BindComponentsOfType<Transform>(gameObject, true);
// }
// recorder.BindComponentsOfType<Renderer>(gameObject, true);
string path = AnimationUtility.CalculateTransformPath(gameObject.transform, root.transform);
recorder.Bind(EditorCurveBinding.FloatCurve(path, typeof(GameObject), "m_IsActive"));
Pellet pellet = gameObject.GetComponent<Pellet>();
if (pellet)
{
recorder.Bind(EditorCurveBinding.FloatCurve(path, typeof(SpriteRenderer), "m_Enabled"));
if (pellet.isPowerPellet)
{
recorder.Bind(EditorCurveBinding.PPtrCurve(path, typeof(SpriteRenderer), "m_Sprite"));
}
continue;
}
if (gameObject.GetComponent<SpriteRenderer>())
{
recorder.Bind(EditorCurveBinding.FloatCurve(path, typeof(SpriteRenderer), "m_Enabled"));
recorder.Bind(EditorCurveBinding.PPtrCurve(path, typeof(SpriteRenderer), "m_Sprite"));
}
else if (gameObject.GetComponent<MeshRenderer>())
{
recorder.Bind(EditorCurveBinding.DiscreteCurve(path, typeof(MeshRenderer), "m_Enabled"));
}
recorder.Bind(EditorCurveBinding.FloatCurve(path, typeof(Transform), "m_LocalPosition.x"));
recorder.Bind(EditorCurveBinding.FloatCurve(path, typeof(Transform), "m_LocalPosition.y"));
recorder.Bind(EditorCurveBinding.FloatCurve(path, typeof(Transform), "m_LocalPosition.z"));
}
EditorCurveBinding[] bindings = recorder.GetBindings();
foreach (EditorCurveBinding binding in bindings)
{
Debug.Log($"{binding.path}, {binding.propertyName}, {binding.type}");
}
}
private static string GetGameObjectPathToObject(GameObject obj, Transform target)
{
string path = "/" + obj.name;
while (!obj.transform.parent.Equals(target))
{
obj = obj.transform.parent.gameObject;
path = "/" + obj.name + path;
}
Debug.Log($"GetGameObjectPathToTransform from {obj} to {target.gameObject} gives {path}");
return path;
}
void LateUpdate()
{
if (clip == null)
return;
recorder.TakeSnapshot(Time.deltaTime);
}
void OnDisable()
{
if (clip == null)
return;
if (recorder.isRecording)
{
recorder.SaveToClip(clip);
RemoveUnneededCurves(clip);
}
}
private static void RemoveUnneededCurves(AnimationClip clip)
{
// Collect curves to process
EditorCurveBinding[] bindings = AnimationUtility.GetCurveBindings(clip);
List<EditorCurveBinding> unneededCurves = new List<EditorCurveBinding>();
foreach (var binding in bindings)
{
AnimationCurve curve = AnimationUtility.GetEditorCurve(clip, binding);
if (curve == null || curve.keys.Length <= 2)
{
unneededCurves.Add(binding);
}
}
// Remove unchanged curves
foreach (var binding in unneededCurves)
{
AnimationUtility.SetEditorCurve(clip, binding, null);
Debug.Log($"Removed unchanged curve for property: {binding.propertyName}");
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a79412bf624eb994fa04fb74977f55fb
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,52 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
m_Name: GhostHorizontalOnlyIndicator
m_EditorClassIdentifier:
serializedUdonProgramAsset: {fileID: 11400000, guid: ec5dc1a411fa93748afcc14c7c05e9c2, type: 2}
udonAssembly:
assemblyError:
sourceCsScript: {fileID: 11500000, guid: 5c42e267ba031f14a8afba9858e3ff5d, type: 3}
scriptVersion: 2
compiledVersion: 2
behaviourSyncMode: 0
hasInteractEvent: 0
scriptID: -3475333653084687851
serializationData:
SerializedFormat: 2
SerializedBytes:
ReferencedUnityObjects: []
SerializedBytesString:
Prefab: {fileID: 0}
PrefabModificationsReferencedUnityObjects: []
PrefabModifications: []
SerializationNodes:
- Name: fieldDefinitions
Entry: 7
Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition,
UdonSharp.Editor]], mscorlib
- Name: comparer
Entry: 7
Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String,
mscorlib]], mscorlib
- Name:
Entry: 8
Data:
- Name:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8c46385ea0a30314989bee3954b8b45c
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,15 @@
namespace Marro.PacManUdon
{
using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;
public class GhostHorizontalOnlyIndicator : UdonSharpBehaviour
{
void Start()
{
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 5c42e267ba031f14a8afba9858e3ff5d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,52 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
m_Name: GhostTunnelIndicator
m_EditorClassIdentifier:
serializedUdonProgramAsset: {fileID: 11400000, guid: 1190f4be45885db4fb3cee680f69783c, type: 2}
udonAssembly:
assemblyError:
sourceCsScript: {fileID: 11500000, guid: cc0e91108c3d33c4586edcc61f25d6d6, type: 3}
scriptVersion: 2
compiledVersion: 2
behaviourSyncMode: 0
hasInteractEvent: 0
scriptID: 8475396515912883789
serializationData:
SerializedFormat: 2
SerializedBytes:
ReferencedUnityObjects: []
SerializedBytesString:
Prefab: {fileID: 0}
PrefabModificationsReferencedUnityObjects: []
PrefabModifications: []
SerializationNodes:
- Name: fieldDefinitions
Entry: 7
Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition,
UdonSharp.Editor]], mscorlib
- Name: comparer
Entry: 7
Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String,
mscorlib]], mscorlib
- Name:
Entry: 8
Data:
- Name:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b6f2fd6b39e15634ba7516919b725587
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,11 @@
namespace Marro.PacManUdon
{
using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;
public class GhostTunnelIndicator : UdonSharpBehaviour
{
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: cc0e91108c3d33c4586edcc61f25d6d6
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,52 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
m_Name: PacManGhostCollider
m_EditorClassIdentifier:
serializedUdonProgramAsset: {fileID: 11400000, guid: c5c5f319202c800458920423915157d7, type: 2}
udonAssembly:
assemblyError:
sourceCsScript: {fileID: 11500000, guid: 197f2fb3a12aac94795943b0ee8d3320, type: 3}
scriptVersion: 2
compiledVersion: 2
behaviourSyncMode: 0
hasInteractEvent: 0
scriptID: -6949880379881253794
serializationData:
SerializedFormat: 2
SerializedBytes:
ReferencedUnityObjects: []
SerializedBytesString:
Prefab: {fileID: 0}
PrefabModificationsReferencedUnityObjects: []
PrefabModifications: []
SerializationNodes:
- Name: fieldDefinitions
Entry: 7
Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition,
UdonSharp.Editor]], mscorlib
- Name: comparer
Entry: 7
Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String,
mscorlib]], mscorlib
- Name:
Entry: 8
Data:
- Name:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 33ddebb883650354f868d672f01e54dd
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,11 @@
namespace Marro.PacManUdon
{
using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;
public class PacManGhostCollider : UdonSharpBehaviour
{
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 197f2fb3a12aac94795943b0ee8d3320
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: