Ejemplo n.º 1
0
        void CreateObject()
        {
            instanceInScene?.Dispose();

            instanceInScene = (Component_Character2D)Character.Clone();
            Scene.AddComponent(instanceInScene);
        }
Ejemplo n.º 2
0
        protected override void Viewport_UpdateBeforeOutput(Viewport viewport)
        {
            base.Viewport_UpdateBeforeOutput(viewport);

            if (Character != null && needRecreateInstance)
            {
                instanceInScene?.Dispose();

                instanceInScene = (Component_Character2D)Character.Clone();
                Scene.AddComponent(instanceInScene);

                needRecreateInstance = false;
            }
        }