本文整理汇总了C#中GraphNode.NodeCoords方法的典型用法代码示例。如果您正苦于以下问题:C# GraphNode.NodeCoords方法的具体用法?C# GraphNode.NodeCoords怎么用?C# GraphNode.NodeCoords使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GraphNode
的用法示例。
在下文中一共展示了GraphNode.NodeCoords方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HideComponents
/*CustomObjectEditor()
{
HideComponents();
}*/
public void OnSceneGUI()
{
m_currentNode = GraphNode.GetNodeByCoords(edited.transform.position, edited.Level);
edited.Node = m_currentNode;
edited.transform.position = m_currentNode.NodeCoords();
}
示例2: OnInspectorGUI
public override void OnInspectorGUI()
{
//base.OnInspectorGUI();
//if(Application.isPlaying)return;
//Debug.Log("1412351345");
try
{
m_currentNode = edited.Node;
}
catch
{
Debug.Log(edited);
}
(target as CustomObjectEditorSupply).transform.localScale=new Vector3(16,1,16);
EditorGUILayout.BeginHorizontal();
EditorGUILayout.LabelField("X", GUILayout.MaxWidth(45));
int xCoord = EditorGUILayout.IntField(m_currentNode.X, GUILayout.ExpandWidth(true));
EditorGUILayout.LabelField("Y", GUILayout.MaxWidth(45));
int yCoord = EditorGUILayout.IntField(m_currentNode.Y, GUILayout.ExpandWidth(true));
EditorGUILayout.EndHorizontal();
int index = EditorGUILayout.IntField("Index", m_currentNode.Index);
string[] levelNames = new string[creator.levels.Count];
int[] levels = new int[levelNames.Length];
for (int i = 0; i < levelNames.Length; i++)
{
levels[i] = i;
levelNames[i] = creator.levels[i].name;
}
int level = EditorGUILayout.IntPopup("Level", edited.Level, levelNames, levels);
int selected;
try
{
selected=EditorGUILayout.IntPopup("Selected object", selectedObject, adjNames, adjIndexes.ToArray());
}
catch
{
Debug.Log(selectedObject);
Debug.Log(adjNames);
Debug.Log(adjIndexes);
throw;
}
if(GUILayout.Button("Delete"))
if(EditorUtility.DisplayDialog("Delete", "Are you sure", "Yes", "Cancel"))
DestroyObject();
if (GUI.changed)
{
//Debug.Log(creator.levels.Count);
// Debug.Log(m_currentNode);
//Debug.Log(edited.name);
m_currentNode = GraphNode.GetNodeByParameters(xCoord, yCoord, index, level);//.GetNodeByCoords(m_currentNode.NodeCoords(), level);
//Debug.Log(m_currentNode);
edited.Node = m_currentNode;
//edited.transform.position = m_currentNode.NodeCoords();
//edited.GetComponent<CustomObject>().Level = level;
edited.gameObject.SetActive(level == EditorAdditionalGUI.EditorOptions.ActiveLevel);
edited.transform.position = m_currentNode.NodeCoords();
if(selected!=selectedObject)
{
Selection.activeGameObject=adjacent[selected].gameObject;
}
}
//edited.transform.hideFlags=0;
(target as CustomObjectEditorSupply).SetFlags();
EditorUtility.SetDirty(edited);
}
示例3: SetNode
public void SetNode(GraphNode Node)
{
// Debug.Log("setNode");
transform.position=Node.NodeCoords();
}