Beispiel #1
0
 public virtual void OnDestroy(SceneInstance caller)
 {
     foreach (Instance inst in caller.Instances)
     {
         inst.BaseReference.OnDestroy(inst, caller);
     }
 }
Beispiel #2
0
 public virtual void Step(SceneInstance caller)
 {
     foreach (Instance inst in caller.Instances)
     {
         inst.BaseReference.Step(inst, caller);
     }
 }
Beispiel #3
0
 public virtual void OnCreate(SceneInstance caller)
 {
     foreach (Instance inst in caller.Instances)
     {
         if (inst.IsActivated)
         {
             inst.BaseReference.OnCreate(inst, caller);
         }
     }
 }
Beispiel #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;
     }
 }
Beispiel #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);
         }
     }
 }
Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #8
0
 public virtual void OnDestroy(Instance caller, SceneInstance scene)
 {
 }
Beispiel #9
0
 public virtual void OnCreate(Instance caller, SceneInstance scene)
 {
 }
Beispiel #10
0
 public virtual void OnCreate(SceneInstance caller)
 {
 }