コード例 #1
0
        public override EditorActor clone()
        {
            XElement data = this.data;

            data.SetAttributeValue("id", _level.controller.getUnusedActorID());
            EditorTreeActor copy = new EditorTreeActor(_level, data);

            _level.addActor(copy);
            return(copy);
        }
コード例 #2
0
 public override bool handleUnselectedClick(System.Windows.Forms.MouseButtons button)
 {
     if (button == System.Windows.Forms.MouseButtons.Left)
     {
         return(hitTest(_level.controller.worldMouse, (results) =>
         {
             if (results.Count == 1 && results[0] == this)
             {
                 if (_level.controller.isKeyHeld(Keys.LeftShift))
                 {
                     EditorTreeActor copy = (EditorTreeActor)clone();
                     copy.select();
                 }
                 else
                 {
                     select();
                 }
                 return true;
             }
             return false;
         }));
     }
     else if (button == System.Windows.Forms.MouseButtons.Right)
     {
         return(hitTest(_level.controller.worldMouse, (results) =>
         {
             if (results.Count == 1)
             {
                 _level.controller.openActorProperties(results[0]);
                 return true;
             }
             return false;
         }));
     }
     return(false);
 }