Beispiel #1
0
                /// <summary>
                /// Actually add a node to the scene.
                /// </summary>
                /// <param name="camera"></param>
                private void DoAddNode(Camera camera)
                {
                    Debug.Assert(fromNode != null);

                    if (inGame.UnderBudget)
                    {
                        if (fromNode != node)
                        {
                            Click(ModeChange.Add);
                            if (node != null)
                            {
                                WayPoint.CreateNewEdge(fromNode, node);
                                fromNode = node;
                            }
                            else
                            {
                                Vector3 pos = AddPosition(camera, fromNode);
                                fromNode = WayPoint.CreateNewNode(fromNode, inGame.shared.curObjectColor, pos);
                            }
                            Changed();
                        }
                        else
                        {
                            mode     = Mode.None;
                            fromNode = null;
                        }
                    }
                    else
                    {
                        Click(ModeChange.NoBudget);
                    }
                }
Beispiel #2
0
 /// <summary>
 /// Start a new path, and go into Add mode to continue adding more nodes
 /// until cancelled. Assumes
 /// </summary>
 /// <param name="pos"></param>
 /// <param name="objColorIndex"></param>
 public void NewPath(Vector3 pos, int objColorIndex)
 {
     fromNode = WayPoint.CreateNewNode(null, objColorIndex, pos);
     mode     = Mode.Add;
     Foley.PlayMakePath();
     Changed();
 }
Beispiel #3
0
 /// <summary>
 /// Start a new path, and go into Add mode to continue adding more nodes
 /// until cancelled. Assumes
 /// </summary>
 /// <param name="pos"></param>
 /// <param name="objColorIndex"></param>
 public void NewPath(Vector3 pos, int objColorIndex)
 {
     fromNode = WayPoint.CreateNewNode(null, objColorIndex, pos);
     //in touch mode, also auto-select newly created nodes
     node = fromNode;
     mode = Mode.Add;
     Foley.PlayMakePath();
     Changed();
 }
Beispiel #4
0
                /// <summary>
                /// Actually add a node to the scene.
                /// </summary>
                /// <param name="camera"></param>
                private void DoAddNode(Camera camera)
                {
                    Debug.Assert(fromNode != null);

                    if (inGame.UnderBudget)
                    {
                        if (fromNode != node)
                        {
                            Click(ModeChange.Add);
                            if (node != null)
                            {
                                WayPoint.CreateNewEdge(fromNode, node);
                                fromNode = node;
                            }
                            else
                            {
                                Vector3 pos = AddPosition(camera, fromNode);
                                fromNode = WayPoint.CreateNewNode(fromNode, inGame.shared.curObjectColor, pos);
                                //in touch mode, when we place a new node, have it highlighted, since there is no mouse over equivalent
                                node = fromNode;
                            }
                            Changed();
                        }
                        else if (TouchGestureManager.Get().DoubleTapGesture.WasRecognized)
                        {
                            //allow finish by double tapping selected node
                            node     = null;
                            mode     = Mode.None;
                            fromNode = null;
                        }
                    }
                    else
                    {
                        Click(ModeChange.NoBudget);
                    }
                }