Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class BootupECSJob
- {
- public static MeshInstanceRenderer cubeLook;
- public static Settings settings;
- [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterSceneLoad)]
- public static void Init()
- {
- EntityManager entityManager = World.Active.GetOrCreateManager<EntityManager>();
- cubeLook = GetLookFromPrototype("CubePrototype");
- GameObject go = GameObject.Find("Settings");
- settings = go.GetComponent<Settings>();
- int channelCount = World.Active.GetOrCreateManager<SpectrumSystem>().Init(settings);
- World.Active.GetOrCreateManager<SpawnCubeSystem>().Init(settings,
- entityManager,
- cubeLook);
- World.Active.GetExistingManager<TransformSystem>().Enabled = false;
- }
- private static MeshInstanceRenderer GetLookFromPrototype(string protoName)
- {
- GameObject proto = GameObject.Find(protoName);
- MeshInstanceRenderer result = proto.GetComponent<MeshInstanceRendererComponent>().Value;
- Object.Destroy(proto);
- return result;
- }
- }
- public struct Cube : IComponentData {}
- public struct Origin : IComponentData
- {
- public float3 Value;
- }
Add Comment
Please, Sign In to add comment