public void OnGameObectRemoved(object sender, GameObjectEventArgs e) { Root.RemoveAll(element => (element.GameObject == e.GameObject)); foreach (var child in Root) { RemoveInChildren(child,e.GameObject); } }
public void OnGameObectAdded(object sender,GameObjectEventArgs e) { TRVGameObjectElementViewModel element = new TRVGameObjectElementViewModel(e.GameObject); element.ElementReassigning += OnElementReassigning; Root.Add(element); foreach (var child in e.GameObject.Children) { AddChildToParrent(child, element); } }
public void OnAddingObject(object source, GameObjectEventArgs e) { UndoRedoStack.ClearRedoStack(); AddGameObject(e.GameObject); }