public void Register(Base_Node node) { if (node != null) { var cur = allBaseNodes[node.IndexForPEGI]; if (cur != null && cur != node) { while (this[firstFree] != null) { firstFree++; } Debug.LogError("Trying to replace {0} with {1}. Assigning index {2}".F(cur, node, firstFree)); node.IndexForPEGI = firstFree; allBaseNodes[firstFree] = node; firstFree++; } else { allBaseNodes[node.IndexForPEGI] = node; } } else { Debug.LogError("Registering NULL node"); } }
public void SetInspectedUpTheHierarchy(Base_Node node) { if (node == null) { return; } var gn = node.AsGameNode; if (gn != null) { if (gameNodes.Contains(gn)) { _gamesNodesMeta.inspected = gameNodes.IndexOf(gn); } } else { if (coreNodes.Contains(node)) { _coreNodesMeta.inspected = coreNodes.IndexOf(node); } } parentNode?.SetInspectedUpTheHierarchy(this); }
public bool Contains(Base_Node node) { if (node == null) { return(false); } var gn = node.AsGameNode; return(gn != null?gameNodes.Contains(gn) : coreNodes.Contains(node)); }
public void Remove(Base_Node node) { var gn = node.AsGameNode; if (gn != null) { gameNodes.Remove(gn); } else { coreNodes.Remove(node); } }
public void Add(Base_Node node) { var gn = node.AsGameNode; if (gn != null) { gameNodes.Add(gn); } else { coreNodes.Add(node); } }