void DestroyNode(GameObject inGameObject, float inWithin) { CircleCollider2D collider2d = inGameObject.GetComponent <CircleCollider2D>(); Destroy(collider2d, inWithin); Rigidbody2D rigidbody2d = inGameObject.GetComponent <Rigidbody2D>(); Destroy(rigidbody2d, inWithin); NodeComponent nodeComponent = inGameObject.GetComponent <NodeComponent>(); nodeComponent.SetNodeIndex(-1); Destroy(nodeComponent, inWithin); Destroy(inGameObject, 0.0f); }
public void UpdateNode(int inNodeIndex, GameObject inNodePrefab) { NodeComponent nodeComponent = inNodePrefab.gameObject.GetComponent <NodeComponent>(); nodeComponent.SetNodeIndex(inNodeIndex); }