示例#1
0
    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);
    }
示例#2
0
 public void RemoveFlyingPoint(FlyingPath node)
 {
     node.map = this;
     flyingPaths.Remove(node);
 }
示例#3
0
 public void AddFlyingPoint(FlyingPath node)
 {
     node.map = this;
     flyingPaths.Add(node);
 }