Example #1
0
        private void Awake()
        {
            var systemRegistry = RegistryRegistry.GetObjectRegistry <LSystemObject>();

            systemRegistry.AssignAllIDs();
            instance = this;
            allResourceReservations = new List <LSystemGlobalResourceHandle>();
        }
Example #2
0
            public void Apply(LSystemBehavior target)
            {
                Debug.Log("l system behavior deserialized");
                target.lastUpdateTime = 0;
                var systemRegistry = RegistryRegistry.GetObjectRegistry <LSystemObject>();

                target.systemObject = systemRegistry.GetUniqueObjectFromID(lSystemId);

                target.steppingHandle?.Dispose();

                target.steppingHandle = steppingHandle.Deserialize();
                target.steppingHandle.InitializePostDeserialize(target);
                target.steppingHandle.OnSystemStateUpdated += target.LSystemStateWasUpdated;

                target.OnSystemObjectUpdated?.Invoke();
                target.OnSystemStateUpdated?.Invoke();
            }
            public LSystemSteppingHandle Deserialize()
            {
                var target = new LSystemSteppingHandle();

                target.totalSteps = this.totalSteps;

                target.lastUpdateChanged = this.lastUpdateChanged;
                target.useSharedSystem   = this.useSharedSystem;

                target.currentState         = this.currentState;
                target.lastState            = this.lastState;
                target.globalResourceHandle = this.oldHandle;

                var systemObjectId        = this.systemObjectId;
                var lSystemObjectRegistry = RegistryRegistry.GetObjectRegistry <LSystemObject>();

                target.systemObject = lSystemObjectRegistry.GetUniqueObjectFromID(systemObjectId);


                target.runtimeParameters = this.runtimeParameters;
                target.compiledGlobalCompiletimeReplacements = this.compiledGlobalCompiletimeReplacements;

                return(target);
            }