public static GameObject CreateFlyingPoint(FlyingPath path) { var nodeID = path.GetComponentsInChildren <FlyingPoint>().Length + 1; //var go = new GameObject ("NPC-"+npcId); var go = GameObject.CreatePrimitive(PrimitiveType.Sphere); go.name = "Node-" + nodeID; go.AddComponent <FlyingPoint> ().objectId = nodeID; go.transform.SetParent(path.transform); go.transform.position = selectionPosition; go.transform.localScale = Vector3.one; go.transform.rotation = Quaternion.identity; Selection.activeGameObject = go; return(go); }
public void RemoveFlyingPoint(FlyingPath node) { node.map = this; flyingPaths.Remove(node); }
public void AddFlyingPoint(FlyingPath node) { node.map = this; flyingPaths.Add(node); }