예제 #1
0
 public virtual void OnDestroy(SceneInstance caller)
 {
     foreach (Instance inst in caller.Instances)
     {
         inst.BaseReference.OnDestroy(inst, caller);
     }
 }
예제 #2
0
 public virtual void Step(SceneInstance caller)
 {
     foreach (Instance inst in caller.Instances)
     {
         inst.BaseReference.Step(inst, caller);
     }
 }
예제 #3
0
 public virtual void OnCreate(SceneInstance caller)
 {
     foreach (Instance inst in caller.Instances)
     {
         if (inst.IsActivated)
         {
             inst.BaseReference.OnCreate(inst, caller);
         }
     }
 }
예제 #4
0
 public virtual void Step(Instance caller, SceneInstance scene)
 {
     //constraints
     if (caller.ImageAngle >= 360)
     {
         caller.ImageAngle -= 360;
     }
     if (caller.ImageAngle < 0)
     {
         caller.ImageAngle += 360;
     }
 }
예제 #5
0
 public virtual void Step(SceneInstance caller)
 {
     if (caller.PhysicsWorld != null && caller.UsesPhysics)
     {
         caller.PhysicsWorld.UpdateCycle();
     }
     foreach (Instance inst in caller.Instances)
     {
         if (inst.IsActivated)
         {
             inst.BaseReference.Step(inst, caller);
         }
     }
 }
예제 #6
0
        public SceneInstance CreateInstance()
        {
            SceneInstance instance = new SceneInstance();

            instance.BaseReference = this;
            instance.ReferenceType = ReferenceType;
            instance.UsesPhysics   = UsesPhysics;
            instance._initPhysics();
            foreach (var obj in GameObjects)
            {
                Instance inst = obj.GameObject.CreateInstance(out Guid guid);
                inst.Position = new Coord(obj.Position.X, obj.Position.Y);
                instance.Instances.Add(inst);
                inst.BaseReference.OnCreate(inst, instance);
            }

            return(instance);
        }
예제 #7
0
        public SceneInstance CreateInstance()
        {
            SceneInstance instance = new SceneInstance();

            instance.BaseReference = this;
            instance.Instances     = new InstanceCollection();
            instance.ReferenceType = ReferenceType;
            instance.ViewPosition  = new Coord(0, 0);

            foreach (var obj in GameObjects)
            {
                Instance inst = obj.GameObject.CreateInstance(out Guid guid);
                inst.Position = new Coord(obj.Position.X, obj.Position.Y);
                instance.Instances.Add(inst);
                inst.BaseReference.OnCreate(inst, instance);
            }

            return(instance);
        }
예제 #8
0
 public virtual void OnDestroy(Instance caller, SceneInstance scene)
 {
 }
예제 #9
0
 public virtual void OnCreate(Instance caller, SceneInstance scene)
 {
 }
예제 #10
0
 public virtual void OnCreate(SceneInstance caller)
 {
 }