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


C# Waypoint.Disconnect方法代码示例

本文整理汇总了C#中Waypoint.Disconnect方法的典型用法代码示例。如果您正苦于以下问题:C# Waypoint.Disconnect方法的具体用法?C# Waypoint.Disconnect怎么用?C# Waypoint.Disconnect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Waypoint的用法示例。


在下文中一共展示了Waypoint.Disconnect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnWaypointGUI

        public static void OnWaypointGUI(Waypoint waypoint)
        {
            GUI.changed = false;

            waypoint.Enabled = EditorGUILayout.Toggle ("Enabled", waypoint.Enabled);
            waypoint.Radius = EditorGUILayout.FloatField ("Radius", waypoint.Radius);
            waypoint.Tag = EditorGUILayout.TagField ("Tag", waypoint.Tag);

            EditorGUILayout.Space ();

            GUILayout.Box ("", GUILayout.Height (1), GUILayout.ExpandWidth (true));

            s_ShowConnectionFoldout = EditorGUILayout.Foldout (s_ShowConnectionFoldout, "Connections", BoldFoldoutStyle);

            if (!s_ShowConnectionFoldout)
            {
                if (GUI.changed)
                {
                    EditorUtility.SetDirty (waypoint);
                }
                return;
            }

            if (s_ConnectionNames.Length != 0)
            {
                GUILayout.BeginHorizontal ();
                    s_ConnectionDropDownIndex = EditorGUILayout.Popup (s_ConnectionDropDownIndex, s_ConnectionNames);

                    GUILayout.Space (kDropDownRightButtonOverlap);

                    GUI.enabled = s_ConnectionDropDownIndex - 1 >= 0;
                    if (GUILayout.Button ("<", EditorStyles.miniButtonMid, GUILayout.Width (kPlusMinusWidth)))
                    {
                        s_ConnectionDropDownIndex--;
                    }
                    GUI.enabled = s_ConnectionDropDownIndex + 1 < s_ConnectionNames.Length;
                    if (GUILayout.Button (">", EditorStyles.miniButtonRight, GUILayout.Width (kPlusMinusWidth)))
                    {
                        s_ConnectionDropDownIndex++;
                    }
                    GUI.enabled = true;
                GUILayout.EndHorizontal ();

                waypoint.Connections[s_ConnectionDropDownIndex].Enabled = EditorGUILayout.Toggle ("Enabled", waypoint.Connections[s_ConnectionDropDownIndex].Enabled);
                waypoint.Connections[s_ConnectionDropDownIndex].Width = EditorGUILayout.FloatField ("Width", waypoint.Connections[s_ConnectionDropDownIndex].Width);
                waypoint.Connections[s_ConnectionDropDownIndex].Weight = EditorGUILayout.FloatField ("Weight", waypoint.Connections[s_ConnectionDropDownIndex].Weight);
                waypoint.Connections[s_ConnectionDropDownIndex].Tag = EditorGUILayout.TagField ("Tag", waypoint.Connections[s_ConnectionDropDownIndex].Tag);
            }
            else
            {
                GUILayout.Label ("No outgoing connections", EditorStyles.miniLabel);
            }

            EditorGUILayout.Space ();

            if (s_WaypointNames.Length != 0)
            {
                GUILayout.Label ("New connection", EditorStyles.boldLabel);
                GUILayout.BeginHorizontal ();
                    int newConnectionFormingIndex = EditorGUILayout.Popup (s_ConnectionFormingWaypointIndex, s_WaypointNames);

                    if (newConnectionFormingIndex != s_Waypoints.IndexOf (waypoint))
                    {
                        s_ConnectionFormingWaypointIndex = newConnectionFormingIndex;
                    }

                    GUILayout.Space (kDropDownRightButtonOverlap);

                    if (GUILayout.Button ("Connect", EditorStyles.miniButtonRight))
                    {
                        new Connection (waypoint, s_Waypoints[s_ConnectionFormingWaypointIndex]);
                        EditorUtility.SetDirty (waypoint);
                    }
                GUILayout.EndHorizontal ();
            }

            EditorGUILayout.Space ();

            if (GUILayout.Button ("Disconnect", EditorStyles.miniButton))
            {
                waypoint.Disconnect ();
                EditorUtility.SetDirty (waypoint);
                UpdateLists (waypoint);
            }

            if (GUI.changed)
            {
                EditorUtility.SetDirty (waypoint);
            }
        }
开发者ID:Joelone,项目名称:Path,代码行数:90,代码来源:PathInspector.cs


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