public void RemoveAllVariables() { for (int i = 0; i < variables.Count; i++) { CustomAnchor anchor = gridVariable.FirstOrDefault(x => x.objectAnchored == variables[i]); VariableObjeto oldObject = anchor.objectAnchored as VariableObjeto; variables.Remove(oldObject); anchor.NotifyDetached(oldObject.Anchorable); Destroy(oldObject.gameObject); anchor.gameObject.SetActive(false); activeVariableAnchors--; i--; m.NumberVariables--; } }
public void RemoveAllObjects() { for (int i = 0; i < objects.Count; i++) { CustomAnchor anchor = gridObjeto.FirstOrDefault(x => x.objectAnchored == objects[i]); ObjetoBase oldObject = anchor.objectAnchored as ObjetoBase; objects.Remove(oldObject); anchor.NotifyDetached(oldObject.Anchorable); Destroy(oldObject.gameObject); anchor.gameObject.SetActive(false); activeObjectAnchors--; i--; m.NumberObjetos--; } }
public void RemoveOneVariable(CustomAnchorable c) { if (activeVariableAnchors > 0) { CustomAnchor anchor = gridVariable.FirstOrDefault(x => x.objectAnchored == c); VariableObjeto oldObject = anchor.objectAnchored as VariableObjeto; variables.Remove(oldObject); anchor.NotifyDetached(oldObject.Anchorable); Destroy(oldObject.gameObject); anchor.gameObject.SetActive(false); activeVariableAnchors--; Debug.Log(activeObjectAnchors); m.NumberVariables--; } else { Debug.Log("No existen objetos creados"); } }
public void RemoveOneObject(CustomAnchorable c) { if (activeObjectAnchors > 0) { CustomAnchor anchor = gridObjeto.FirstOrDefault(x => x.objectAnchored == c); ObjetoBase oldObject = anchor.objectAnchored as ObjetoBase; objects.Remove(oldObject); anchor.NotifyDetached(oldObject.Anchorable); Destroy(oldObject.gameObject); anchor.gameObject.SetActive(false); activeObjectAnchors--; Debug.Log(activeObjectAnchors); m.NumberObjetos--; } else { Debug.Log("No existen objetos creados"); } }