public new void Update(bool eu) { orig_Update(eu); if (creatureDebug && Input.GetKeyDown(KeyCode.C)) { Debug.Log("Spawn LightWorm."); //add DebugCreature on mousepointer spot Vector2 vector = Vector2.zero; vector.x = Input.mousePosition.x + room.game.cameras[0].pos.x; vector.y = Input.mousePosition.y + room.game.cameras[0].pos.y; WorldCoordinate coord = room.GetWorldCoordinate(vector); AbstractLightWorm abstractCreature = new AbstractLightWorm(room.world, StaticWorld.creatureTemplates[(int)patch_CreatureTemplate.Type.LightWorm], null, coord, room.game.GetNewID()); abstractCreature.Room.AddEntity(abstractCreature); LightWorm creature = new LightWorm(abstractCreature, room.world); room.AddObject(creature); creature.abstractCreature.RealizeInRoom(); /* * DebugSprite dbspr = new DebugSprite(vector, new FSprite("pixel", true), this.room); * dbspr.sprite.scale = 5f; dbspr.sprite.alpha = 0.5f; dbspr.pos = vector; * this.room.AddObject(dbspr); */ } }
public override void Realize() { if (realizedCreature == null) { realizedCreature = new LightWorm(this, world); abstractAI.RealAI = new LightWormAI(this, world); } }