• 大小: 3.08M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2024-04-28
  • 语言: C#
  • 标签: 多进程  pe  IP  进程  

资源简介

PipeNet Visualize pipe networks and do some related analyses in Unity3D

资源截图

代码片段和文件信息

using UnityEditor;
using UnityEngine;

public class MyHandles
{
    // internal state for DragHandle()
    static int s_DragHandleHash = “DragHandleHash“.GetHashCode();
    static Vector2 s_DragHandleMouseStart;
    static Vector2 s_DragHandleMouseCurrent;
    static Vector3 s_DragHandleWorldStart;
    static float s_DragHandleClickTime = 0;
    static int s_DragHandleClickID;
    static float s_DragHandleDoubleClickInterval = 0.5f;
    static bool s_DragHandleHasMoved;

    // externally accessible to get the ID of the most recently processed DragHandle
    public static int lastDragHandleID;

    public enum DragHandleResult
    {
        None = 0

        LMBPress
        LMBClick
        LMBDoubleClick
        LMBDrag
        LMBRelease

        RMBPress
        RMBClick
        RMBDoubleClick
        RMBDrag
        RMBRelease
    };

    public static Vector3 DragHandle(Vector3 position float handleSize Handles.DrawCapFunction capFunc Color colorSelected out DragHandleResult result)
    {
        int id = GUIUtility.GetControlID(s_DragHandleHash FocusType.Passive);
        lastDragHandleID = id;

        Vector3 screenPosition = Handles.matrix.MultiplyPoint(position);
        Matrix4x4 cachedMatrix = Handles.matrix;

        result = DragHandleResult.None;

        switch (Event.current.GetTypeForControl(id))
        {
            case EventType.MouseDown:
                if (HandleUtility.nearestControl == id && (Event.current.button == 0 || Event.current.button == 1))
                {
                    GUIUtility.hotControl = id;
                    s_DragHandleMouseCurrent = s_DragHandleMouseStart = Event.current.mousePosition;
                    s_DragHandleWorldStart = position;
                    s_DragHandleHasMoved = false;

                    Event.current.Use();
                    EditorGUIUtility.SetWantsMouseJumping(1);

                    if (Event.current.button == 0)
                        result = DragHandleResult.LMBPress;
                    else if (Event.current.button == 1)
                        result = DragHandleResult.RMBPress;
                }
                break;

            case EventType.MouseUp:
                if (GUIUtility.hotControl == id && (Event.current.button == 0 || Event.current.button == 1))
                {
                    GUIUtility.hotControl = 0;
                    Event.current.Use();
                    EditorGUIUtility.SetWantsMouseJumping(0);

                    if (Event.current.button == 0)
                        result = DragHandleResult.LMBRelease;
                    else if (Event.current.button == 1)
                        result = DragHandleResult.RMBRelease;

                    if (Event.current.mousePosition == s_DragHandleMouseStart)
                    {
                        bool doubleClick = (s_DragHandleClickID == id) &&
                            (Time.realtimeSinceStartup - s_DragHandleClickTime < s_DragHandleDoubleClickInterval);


 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-01-24 12:03  PipeNet-master\
     目录           0  2019-01-24 12:03  PipeNet-master\Assets\
     文件         191  2019-01-24 12:03  PipeNet-master\Assets\PipeNet.meta
     目录           0  2019-01-24 12:03  PipeNet-master\Assets\PipeNet\
     文件         191  2019-01-24 12:03  PipeNet-master\Assets\PipeNet\Assets.meta
     目录           0  2019-01-24 12:03  PipeNet-master\Assets\PipeNet\Assets\
     文件         191  2019-01-24 12:03  PipeNet-master\Assets\PipeNet\Assets\Editor.meta
     目录           0  2019-01-24 12:03  PipeNet-master\Assets\PipeNet\Assets\Editor\
     文件        5828  2019-01-24 12:03  PipeNet-master\Assets\PipeNet\Assets\Editor\MyHandles.cs
     文件         262  2019-01-24 12:03  PipeNet-master\Assets\PipeNet\Assets\Editor\MyHandles.cs.meta
     文件       18830  2019-01-24 12:03  PipeNet-master\Assets\PipeNet\Assets\Editor\NetComponentEditor.cs
     文件         262  2019-01-24 12:03  PipeNet-master\Assets\PipeNet\Assets\Editor\NetComponentEditor.cs.meta
     文件         191  2019-01-24 12:03  PipeNet-master\Assets\PipeNet\Assets\Materials.meta
     目录           0  2019-01-24 12:03  PipeNet-master\Assets\PipeNet\Assets\Materials\
     文件        4260  2019-01-24 12:03  PipeNet-master\Assets\PipeNet\Assets\Materials\Block.mat
     文件         179  2019-01-24 12:03  PipeNet-master\Assets\PipeNet\Assets\Materials\Block.mat.meta
     文件         191  2019-01-24 12:03  PipeNet-master\Assets\PipeNet\Assets\Materials\Particles.meta
     目录           0  2019-01-24 12:03  PipeNet-master\Assets\PipeNet\Assets\Materials\Particles\
     文件        4976  2019-01-24 12:03  PipeNet-master\Assets\PipeNet\Assets\Materials\Particles\ClosedValve.mat
     文件         179  2019-01-24 12:03  PipeNet-master\Assets\PipeNet\Assets\Materials\Particles\ClosedValve.mat.meta
     文件        4976  2019-01-24 12:03  PipeNet-master\Assets\PipeNet\Assets\Materials\Particles\RepairPoint.mat
     文件         179  2019-01-24 12:03  PipeNet-master\Assets\PipeNet\Assets\Materials\Particles\RepairPoint.mat.meta
     文件        4976  2019-01-24 12:03  PipeNet-master\Assets\PipeNet\Assets\Materials\Particles\TroublePoint.mat
     文件         179  2019-01-24 12:03  PipeNet-master\Assets\PipeNet\Assets\Materials\Particles\TroublePoint.mat.meta
     文件        5048  2019-01-24 12:03  PipeNet-master\Assets\PipeNet\Assets\Materials\PipeLine.mat
     文件         179  2019-01-24 12:03  PipeNet-master\Assets\PipeNet\Assets\Materials\PipeLine.mat.meta
     文件        5052  2019-01-24 12:03  PipeNet-master\Assets\PipeNet\Assets\Materials\PipeNetPlane.mat
     文件         179  2019-01-24 12:03  PipeNet-master\Assets\PipeNet\Assets\Materials\PipeNetPlane.mat.meta
     文件        5012  2019-01-24 12:03  PipeNet-master\Assets\PipeNet\Assets\Materials\PointData_Common.mat
     文件         179  2019-01-24 12:03  PipeNet-master\Assets\PipeNet\Assets\Materials\PointData_Common.mat.meta
     文件        5112  2019-01-24 12:03  PipeNet-master\Assets\PipeNet\Assets\Materials\PointData_Source.mat
............此处省略122个文件信息

评论

共有 条评论