Пример #1
0
 public override void Update()
 {
     base.Update();
     if (_mouseFollow != null)
     {
         Transform2 transform = _mouseFollow.GetTransform();
         transform.Position = Controller.GetMouseWorld();
         _mouseFollow.SetTransform(transform);
     }
     if (_input.KeyPress(Key.Delete) || _input.KeyPress(Key.Escape) || _input.MousePress(MouseButton.Right))
     {
         Controller.SetTool(null);
     }
     else if (_input.MousePress(MouseButton.Left))
     {
         EditorActor editorActor = new EditorActor(Controller.Level, PolygonFactory.CreateRectangle(4, 0.5f));
         Transform2.SetPosition(editorActor, Controller.GetMouseWorld());
         if (!_input.KeyDown(KeyBoth.Shift))
         {
             Controller.SetTool(null);
         }
     }
 }
Пример #2
0
 public override IDeepClone ShallowClone()
 {
     EditorActor clone = new EditorActor(Scene);
     base.ShallowClone(clone);
     return clone;
 }
Пример #3
0
 public Model GetActorModel(EditorActor actor)
 {
     Model model = Game.ModelFactory.CreatePolygon(actor.Vertices);
     model.SetTexture(Scene.Renderer.GetTexture("default.png"));
     return model;
 }