当前位置: 首页>>代码示例>>C#>>正文


C# GraphNode.NodeCoords方法代码示例

本文整理汇总了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();
    }
开发者ID:crassus0,项目名称:Edge-drivers,代码行数:11,代码来源:CustomObjectEditor.cs

示例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);
    }
开发者ID:crassus0,项目名称:Edge-drivers,代码行数:71,代码来源:CustomObjectEditor.cs

示例3: SetNode

    public void SetNode(GraphNode Node)
    {
        //	  Debug.Log("setNode");

          transform.position=Node.NodeCoords();
    }
开发者ID:crassus0,项目名称:Edge-drivers,代码行数:6,代码来源:CustomObjectEditorSupply.cs


注:本文中的GraphNode.NodeCoords方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。