Beispiel #1
0
        public void Update(Editor editor, double elapsedTime)
        {
            switch (_positionType)
            {
                case PositionType.World:
                    _screenPos = editor.Camera.GetScreenCoordinates(_position);
                    break;

                default:
                    _screenPos = new Vector2(_position.X, _position.Y);
                    break;
            }
            foreach (var child in _children)
            {
                child.Update(editor, elapsedTime);
            }
        }
Beispiel #2
0
 public Tools(Editor editor)
 {
     _editor = editor;
 }
Beispiel #3
0
        void GameObjectTree_SelectedNodeChanged(Control sender, TreeNode value)
        {
            if (value != null && value is GameObjectTreeNode)
            {
                var newObject = (value as GameObjectTreeNode).GameObject;
                if (newObject != null && newObject != _selectedGameObject)
                {
                    _selectedGameObject = newObject;
                    _removeGameObject.Enabled = (_selectedGameObject != null && _selectedGameObject != _project);

                    _project.UnLoad();
                    if (_editor != null) _editor.Dispose();

                    var go = _selectedGameObject;
                    _editor = null;
                    //Look for an editor
                    while (go != null && _editor == null)
                    {
                        _editor = Plugins.Container.ResolveOptionalNamed<Editor>(go.ExportName);
                        if (_editor == null) go = go.Parent;
                    }
                    //If we did not find an editor, show empty default editor;
                    if (_editor == null) _editor = Plugins.Container.ResolveOptionalNamed<Editor>("Editor");

                    _editor.SelectedGameObject = _selectedGameObject;

                    RefreshGameObjectList();
                    RefreshGameObjectEditors();
                }
            }
        }