Created
August 28, 2025 20:19
-
-
Save gamesbyangelina/0e20e0a4e9a1c027ed35083f561b1f61 to your computer and use it in GitHub Desktop.
Root File: Dodgeball
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| using System; | |
| using GameFeelDescriptions.Examples; | |
| public class DodgeballRoot : MonoBehaviour | |
| { | |
| [Header("Prefabs")] | |
| public List<PixiePrefab> pixiePrefabs; | |
| public static List<PixiePrefab> _pixiePrefabs; | |
| object[] args; | |
| Type[] types; | |
| Dictionary<string, Action<object[]>> hookDictionary; | |
| Dictionary<string, int> hookCalls; | |
| // Start is called before the first frame update | |
| void Start() | |
| { | |
| hookDictionary = new Dictionary<string, Action<object[]>>(); | |
| hookCalls = new Dictionary<string, int>(); | |
| _pixiePrefabs = new List<PixiePrefab>(); | |
| foreach(PixiePrefab p in pixiePrefabs){ | |
| p.GenerateBaseSettingsTemplate(); | |
| _pixiePrefabs.Add(p); | |
| } | |
| //Search for any statically referenced methods that we can use | |
| GameGeneration.RefreshStaticReferences(); | |
| GameGeneration.AddPixiePrefab(_pixiePrefabs[0], "DodgeballRoot._pixiePrefabs[0]"); | |
| GameGeneration.AddPixiePrefab(_pixiePrefabs[1], "DodgeballRoot._pixiePrefabs[1]"); | |
| GameGeneration.AddPixiePrefab(_pixiePrefabs[2], "DodgeballRoot._pixiePrefabs[2]"); | |
| //Add an external method that cannot be annotated because we don't have source access | |
| GameGeneration.AddExternalMethod("UnityEngine.Vector2, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", "Reflect"); | |
| GameGeneration.ForceAddField("GameFeelDescriptions.Examples.NormalBall, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", | |
| "transform.localScale", | |
| "UnityEngine.Vector3, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"); | |
| GameGeneration.ForceAddField("GameFeelDescriptions.Examples.NormalBall, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", | |
| "transform.position", | |
| "UnityEngine.Vector3, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"); | |
| AssemblyEvolution.instance.Setup( | |
| new DodgeballRunSpec() | |
| ); | |
| AssemblyEvolution.instance.EvolveViaSimpleMutation( | |
| new HookSpec("onBounce", typeof(NormalBall), typeof(BallController)), | |
| new HookSpec("onStart", typeof(BallController)) | |
| ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment