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


C# GizmoType类代码示例

本文整理汇总了C#中GizmoType的典型用法代码示例。如果您正苦于以下问题:C# GizmoType类的具体用法?C# GizmoType怎么用?C# GizmoType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: DrawOutlines

        static void DrawOutlines(UIWindow window, GizmoType gizmoType)
        {
            var rectTransform = window.gameObject.GetComponent<RectTransform>();
            if (rectTransform != null)
            {
                if (EditorPrefs.HasKey("InventoryPro_UIWindowDebug") == false)
                    return;

                var color = new Color(Color.yellow.r, Color.yellow.g, Color.yellow.b, 0.6f);
                Gizmos.color = color;
                Handles.color = color;


                Vector3[] corners = new Vector3[4];
                rectTransform.GetWorldCorners(corners);


                // Draw window name
                //Handles.DrawBezier(Vector3.zero, Vector3.one * 1000, Vector3.up * 500, Vector3.up * 500, Color.yellow, null, 2.0f);
                //Handles.ArrowCap(0, Vector3.one * 1000, Quaternion.Euler(90.0f, 0.0f, 0.0f), 100.0f);
                DrawWindowName(corners[1] + Vector3.up * 20, window.windowName);


                // Draw the bounding box
                Gizmos.DrawLine(corners[0], corners[1]);
                Gizmos.DrawLine(corners[1], corners[2]);
                Gizmos.DrawLine(corners[2], corners[3]);
                Gizmos.DrawLine(corners[3], corners[0]);



                Gizmos.color = Color.white;
                Handles.color = Color.white;
            }
        }
开发者ID:predominant,项目名称:Treasure_Chest,代码行数:35,代码来源:UIWindowEditor.cs

示例2: RenderGizmo

	static void RenderGizmo(MegaTracks track, GizmoType gizmoType)
	{
		if ( (gizmoType & GizmoType.Active) != 0 && Selection.activeObject == track.gameObject )
		{
			if ( !track.displayspline )
				return;

			DrawGizmos(track, new Color(1.0f, 1.0f, 1.0f, 1.0f));
			Color col = Color.yellow;
			col.a = 0.5f;	//0.75f;
			Gizmos.color = col;	//Color.yellow;

			Matrix4x4 RingTM = Matrix4x4.identity;
			RingTM = track.transform.localToWorldMatrix * RingTM;

			float gsize = 0.1f;

			gsize *= 0.1f;

			if ( track.shape != null )
			{
				MegaSpline spl = track.shape.splines[track.curve];

				for ( int p = 0; p < spl.knots.Count; p++ )
				{
					Vector3 p1 = RingTM.MultiplyPoint(spl.knots[p].p);

					Gizmos.color = Color.green;
					Gizmos.DrawSphere(p1, gsize);
				}
			}
		}
	}
开发者ID:Morac,项目名称:Orca6,代码行数:33,代码来源:MegaTracksEditor.cs

示例3: RenderGizmoSelected

	static void RenderGizmoSelected(MegaModifier mod, GizmoType gizmoType)
	{
		if ( GUI.changed )
		{
			Debug.Log("Editing " + mod.ModName());
		}
	}
开发者ID:xiaopangoo,项目名称:MotionPlatform,代码行数:7,代码来源:MegaModifierEditor.cs

示例4: RenderSpawnGizmo

 static void RenderSpawnGizmo(SpawnPoint spawnPoint, GizmoType gizmoType)
 {
     // Draw the icon
     string iconName = spawnPoint.gizmoIcon;
     if (string.IsNullOrEmpty(iconName)) { iconName = "EnemySpawn"; }
     Gizmos.DrawIcon (spawnPoint.transform.position, iconName, true);
 }
开发者ID:Gamieon,项目名称:PaperCowboys,代码行数:7,代码来源:SpawnPointGizmo.cs

示例5: BuildMesh

    //public virtual Mesh BuildMesh() {
    //    return new Mesh();
    //}
    public Mesh BuildMesh(GizmoMeshShape shape, GizmoType type) {  // SIMPLE CUBE!
        MeshBuilder meshBuilder = new MeshBuilder();

        if(shape == GizmoMeshShape.Cube) {
            meshBuilder = EditorGizmoMeshShapes.GetCubeMesh(meshBuilder);
            //BuildQuad(meshBuilder, new Vector3(-0.5f, -0.5f, -0.5f), Vector3.right, Vector3.up); // FRONT
            //BuildQuad(meshBuilder, new Vector3(-0.5f, -0.5f, 0.5f), Vector3.back, Vector3.up); // LEFT
            //BuildQuad(meshBuilder, new Vector3(-0.5f, 0.5f, 0.5f), Vector3.back, Vector3.right); // TOP
            //BuildQuad(meshBuilder, new Vector3(0.5f, -0.5f, 0.5f), Vector3.left, Vector3.up); // BACK
            //BuildQuad(meshBuilder, new Vector3(0.5f, -0.5f, -0.5f), Vector3.forward, Vector3.up); // RIGHT
            //BuildQuad(meshBuilder, new Vector3(-0.5f, -0.5f, 0.5f), Vector3.right, Vector3.back); // BOTTOM

            if(type != GizmoType.none) {
                collider = this.gameObject.AddComponent<BoxCollider>();
                collider.isTrigger = true;
            }
            
            if (gizmoMaterial == null) {
                gizmoMaterial = new Material(Shader.Find("Custom/CritterEditorGizmo"));
                //gizmoMaterial.renderQueue = 4000;
            }
            GetComponent<MeshRenderer>().material = gizmoMaterial;
        }
        else if(shape == GizmoMeshShape.Arrow) {
            EditorGizmoMeshShapes.GetArrowMesh(meshBuilder);

            if (type != GizmoType.none) {
                MeshCollider meshCollider = this.gameObject.AddComponent<MeshCollider>();
                meshCollider.sharedMesh = meshBuilder.CreateMesh();
                collider = meshCollider;
                //collider.isTrigger = true;
            }

            if (gizmoMaterial == null) {
                gizmoMaterial = new Material(Shader.Find("Custom/CritterEditorGizmo"));
                //gizmoMaterial.renderQueue = 4000;
            }
            GetComponent<MeshRenderer>().material = gizmoMaterial;
        }
        else if (shape == GizmoMeshShape.OmniArrow) {
            EditorGizmoMeshShapes.GetOmniArrowMesh(meshBuilder);

            if (type != GizmoType.none) {
                MeshCollider meshCollider = this.gameObject.AddComponent<MeshCollider>();
                meshCollider.sharedMesh = meshBuilder.CreateMesh();
                collider = meshCollider;
            }

            if (gizmoMaterial == null) {
                gizmoMaterial = new Material(Shader.Find("Custom/CritterEditorGizmo"));
                //gizmoMaterial.renderQueue = 4000;
            }
            GetComponent<MeshRenderer>().material = gizmoMaterial;
        }
        else {
            Debug.Log("No Gizmo Shape!!!");
        }

        return meshBuilder.CreateMesh();
    }
开发者ID:eaclou,项目名称:Master_CreatureTrainer01,代码行数:63,代码来源:EditorGizmoObject.cs

示例6: DrawGraphGizmo

    public static void DrawGraphGizmo(Graph graph, GizmoType type)
    {
        Color graphColor = GraphEditorWindow.GetGraphColor(graph);
        using (new GizmosColor(graphColor)) {
            foreach (GraphNode node in graph.Nodes) {
                GraphNodeEditor.DrawGraphNodeGizmo(node, GizmoType.NonSelected);
            }

            Color linkColor = Color.gray;
            if ((type & GizmoType.Selected) != 0) {
                linkColor = graphColor * 0.75f;
            }
            else if ((type & GizmoType.NonSelected) != 0) {
                linkColor = graphColor * 0.25f;
            }

            using (new GizmosColor(linkColor)) {
                foreach (var links in graph.Links) {
                    GraphNode nodeFrom = links.Key;
                    foreach (GraphNode nodeTo in links.Value) {
                        Vector3 pinShift = GraphEditorWindow.GetGraphNodePinShift(nodeTo);
                        Gizmos.DrawLine(nodeFrom.transform.position + pinShift, nodeTo.transform.position + pinShift);
                    }
                }
            }
        }
    }
开发者ID:yatagarasu25,项目名称:GraphBuilder,代码行数:27,代码来源:GraphEditor.cs

示例7: OnDrawRootGizmo

 static void OnDrawRootGizmo(GuiPanel panel, GizmoType gizmoType)
 {
     if (panel.enabled && panel.ClipType == GuiPanelClipType.Range) {
         Gizmos.color = (gizmoType & GizmoType.InSelectionHierarchy) != 0 ? Color.red : new Color (0.5f, 0f, 0f);
         Gizmos.DrawWireCube (panel.transform.position, new Vector3 (panel.ClipWidth, panel.ClipHeight, 0f));
     }
 }
开发者ID:Leopotam,项目名称:LeopotamGroupLibraryUnity,代码行数:7,代码来源:GuiPanelInspector.cs

示例8: RenderBoundsGizmo

    static void RenderBoundsGizmo(DrawBoundsGizmo boundsGizmo, GizmoType gizmoType) {
        Gizmos.color = boundsGizmo.color;

        // get renderer bonding box
        var bounds = new Bounds();
        var initBound = false;
        if (UnityUtility.GetBoundWithChildren(boundsGizmo.transform, ref bounds, ref initBound)) {
            if (boundsGizmo.drawCube) {
                Gizmos.DrawWireCube(bounds.center, bounds.size);
            }
            if (boundsGizmo.drawSphere) {
                Gizmos.DrawWireSphere(bounds.center, Mathf.Max(Mathf.Max(bounds.extents.x, bounds.extents.y), bounds.extents.z));
            }
        }

        if (boundsGizmo.showCenter) {
            Gizmos.DrawLine(new Vector3(bounds.min.x, bounds.center.y, bounds.center.z), new Vector3(bounds.max.x, bounds.center.y, bounds.center.z));
            Gizmos.DrawLine(new Vector3(bounds.center.x, bounds.min.y, bounds.center.z), new Vector3(bounds.center.x, bounds.max.y, bounds.center.z));
            Gizmos.DrawLine(new Vector3(bounds.center.x, bounds.center.y, bounds.min.z), new Vector3(bounds.center.x, bounds.center.y, bounds.max.z));
        }

        // UnityEditor code draws a label with the dimensions of the bounding box
        Handles.BeginGUI();
        var view = SceneView.currentDrawingSceneView;
        var pos = view.camera.WorldToScreenPoint(bounds.center);
        var size = GUI.skin.label.CalcSize(new GUIContent(bounds.ToString()));
        GUI.Label(new Rect(pos.x - (size.x / 2), -pos.y + view.position.height + 4, size.x, size.y), bounds.ToString());
        Handles.EndGUI();
    }
开发者ID:Maxii,项目名称:CodeEnv.Master,代码行数:29,代码来源:DrawBoundsGizmoEditor.cs

示例9: DrawProjectileStatePoints

    static void DrawProjectileStatePoints(BouncingProjectile projectile , GizmoType gizmoType)
    {
        if (projectile == null)
            return;

        if (projectile.HasPackages() == false)
            return;

        List<Projectile2DState> points = projectile.GetAllPackages();

        DrawSegment(projectile.transform.position + Vector3.up * .99f, projectile.nextPosition + Vector3.up * .99f, Color.blue, visualizationTime);

        //Vector3 ballMoveDir = projectile.transform.position - projectile.previousPosition;

        for (int i = 0; i < points.Count; i++)
        {
            // draw little + for points
            DrawCross(points[i].Position3() + Vector3.up, .2f, Color.white, visualizationTime);

            // draw little -> for points
            Color targetColor = Color.yellow;
            if (points[i].ServerVerified == false)
                targetColor = Color.cyan;

            if (i != 0)
                DrawSegment(points[i].Position3() + Vector3.up * .9f, points[i - 1].Position3() + Vector3.up * .9f, Color.green, visualizationTime);

            DrawArrow(points[i].Position3() + Vector3.up, points[i].Direction3(), .5f, targetColor, visualizationTime);
        }

        

    }
开发者ID:TamaHobbit,项目名称:DMV,代码行数:33,代码来源:BouncingProjectileEditor.cs

示例10: DrawGizmoFor

 static void DrawGizmoFor(LodeRunnerGraphBuilder target, GizmoType gizmoType)
 {
     //draw arrow map
     if (target.showArrowMap)
     {
         for (int x = 0; x < target.getWidth(); x++)
         {
             for (int y = target.getHeight() - 1; y >= 0; y--)
             {
                 byte arrow = target.getArrowMapValue(x, y);
                 if (arrow == (byte)Arrow.Dot)
                 {
                     Gizmos.DrawIcon(target.getTileCenterPositionInWorld(x, y), "arrow_dot.png", true);
                     continue;
                 }
                 if (arrow == (byte)Arrow.JumpPoint)
                 {
                     Gizmos.DrawIcon(target.getTileCenterPositionInWorld(x, y), "arrow_JP.png", true);
                     continue;
                 }
                 if (target.hasArrow(arrow, Arrow.Up))
                     Gizmos.DrawIcon(target.getTileCenterPositionInWorld(x, y), "arrow_up.png", true);
                 if (target.hasArrow(arrow, Arrow.Down))
                     Gizmos.DrawIcon(target.getTileCenterPositionInWorld(x, y), "arrow_down.png", true);
                 if (target.hasArrow(arrow, Arrow.Left))
                     Gizmos.DrawIcon(target.getTileCenterPositionInWorld(x, y), "arrow_left.png", true);
                 if (target.hasArrow(arrow, Arrow.Right))
                     Gizmos.DrawIcon(target.getTileCenterPositionInWorld(x, y), "arrow_right.png", true);
             }
         }
     }
 }
开发者ID:xiangwei71,项目名称:LodeRunner,代码行数:32,代码来源:LodeRunnerGraphBuilderGizmoDrawer.cs

示例11: Draw

    private static void Draw(GameObject gObj, GizmoType gizmoType)
    {
        GUIStyle style = new GUIStyle();

                style.alignment = TextAnchor.MiddleCenter;
                style.fontStyle = FontStyle.Bold;
                if (gObj.GetComponent<Zone> () != null) {
                        //if (!gObj.GetComponent<Zone> ().UseSlots) {
                                style.normal.textColor = Color.yellow;
                                Handles.Label(gObj.GetComponent<Collider>().bounds.center, gObj.name, style);
                                Bounds bounds = gObj.GetComponent<Collider>().bounds;

                                Gizmos.color = Color.yellow;

                                Gizmos.DrawWireCube (bounds.center, bounds.size);

                        //}

                } else if (gObj.GetComponent<Slot> () != null) {
                        if (gObj.transform.parent != null)
                        if (gObj.transform.parent.GetComponent<Zone> () != null)
                        //if (gObj.transform.parent.GetComponent<Zone> ().UseSlots) {
                                style.normal.textColor = Color.cyan;
                                Handles.Label(gObj.GetComponent<Collider>().bounds.center, gObj.name, style);
                                Bounds bounds = gObj.GetComponent<Collider>().bounds;

                                Gizmos.color = Color.cyan;

                                Gizmos.DrawWireCube (bounds.center, bounds.size);
                        //}
                }
    }
开发者ID:NachyoChez,项目名称:BookWork,代码行数:32,代码来源:SceneScripts.cs

示例12: DrawRiverLines

 static void DrawRiverLines(MapController mapController, GizmoType gizmoType)
 {
     if (mapController == null)
     {
       return;
     }
     Map map = mapController.map;
     if (map == null)
     {
       return;
     }
     Gizmos.color = Color.red;
     for (int i = 1; i < map.RiverData.Count; i++)
     {
       Gizmos.DrawLine(new Vector3(map.RiverData[i - 1].JointChannelMiddleLine, map.WaterLevel, map.RiverData[i - 1].Z), new Vector3(map.RiverData[i].JointChannelMiddleLine, map.WaterLevel, map.RiverData[i].Z));
     }
     Gizmos.color = Color.yellow;
     for (int i = 1; i < map.RiverData.Count; i++)
     {
       Gizmos.DrawLine(new Vector3(map.RiverData[i - 1].LeftChannel.LeftEdge, map.WaterLevel, map.RiverData[i - 1].Z), new Vector3(map.RiverData[i].LeftChannel.LeftEdge, map.WaterLevel, map.RiverData[i].Z));
       Gizmos.DrawLine(new Vector3(map.RiverData[i - 1].LeftChannel.MiddleLine, map.WaterLevel, map.RiverData[i - 1].Z), new Vector3(map.RiverData[i].LeftChannel.MiddleLine, map.WaterLevel, map.RiverData[i].Z));
       Gizmos.DrawLine(new Vector3(map.RiverData[i - 1].LeftChannel.RightEdge, map.WaterLevel, map.RiverData[i - 1].Z), new Vector3(map.RiverData[i].LeftChannel.RightEdge, map.WaterLevel, map.RiverData[i].Z));
     }
     Gizmos.color = Color.cyan;
     for (int i = 1; i < map.RiverData.Count; i++)
     {
       Gizmos.DrawLine(new Vector3(map.RiverData[i - 1].RightChannel.LeftEdge, map.WaterLevel, map.RiverData[i - 1].Z), new Vector3(map.RiverData[i].RightChannel.LeftEdge, map.WaterLevel, map.RiverData[i].Z));
       Gizmos.DrawLine(new Vector3(map.RiverData[i - 1].RightChannel.MiddleLine, map.WaterLevel, map.RiverData[i - 1].Z), new Vector3(map.RiverData[i].RightChannel.MiddleLine, map.WaterLevel, map.RiverData[i].Z));
       Gizmos.DrawLine(new Vector3(map.RiverData[i - 1].RightChannel.RightEdge, map.WaterLevel, map.RiverData[i - 1].Z), new Vector3(map.RiverData[i].RightChannel.RightEdge, map.WaterLevel, map.RiverData[i].Z));
     }
 }
开发者ID:jimmylarkin,项目名称:River,代码行数:31,代码来源:MapEditor.cs

示例13: DrawGizmo

    public static void DrawGizmo(PathScript scr, GizmoType gizmoType)
    {
        Vector3[] nodes = scr.GetPath();

        if (nodes.Length > 1)
            iTween.DrawPathGizmos(nodes);

        for (int i = 0; i < nodes.Length; i++)
        {
            if (scr.loops && i == nodes.Length - 1 && nodes.Length > 1)
                break;

            if (nodes.Length > 1 && scr.loops)
                Gizmos.color = Color.Lerp(Color.red, Color.blue, (float)i / (nodes.Length - 2));
            else if (nodes.Length > 1)
                Gizmos.color = Color.Lerp(Color.red, Color.blue, (float)i / (nodes.Length - 1));
            else
                Gizmos.color = Color.red;

            if ((gizmoType & GizmoType.NonSelected) > 0)
                Gizmos.DrawWireSphere(nodes[i], 0.25f);
            else
                Gizmos.DrawSphere(nodes[i], 0.5f);

            Vector3 screenPoint = Camera.current.WorldToScreenPoint(nodes[i]);
            GUI.TextField(new Rect(screenPoint.x, screenPoint.y, 20, 20), i.ToString());

        }
    }
开发者ID:Clavus,项目名称:Tank,代码行数:29,代码来源:PathScriptGizmoDrawer.cs

示例14: RenderGizmo

	static void RenderGizmo (LegController legC, GizmoType gizmoType) {
		if (Application.isPlaying || AnimationUtility.InAnimationMode())
			return;
		
		Vector3 up = legC.transform.up;
		Vector3 forward = legC.transform.forward;
		Vector3 right = legC.transform.right;
		
		// Draw cross signifying the Ground Plane Height
		Vector3 groundCenter = (
			legC.transform.position
				+ legC.groundPlaneHeight * up * legC.transform.lossyScale.y
		);
		Gizmos.color = (Color.green+Color.white)/2;
		Gizmos.DrawLine(groundCenter-forward, groundCenter+forward);
		Gizmos.DrawLine(groundCenter-right, groundCenter+right);
		
		// Draw rect showing foot boundaries
		if (legC.groundedPose==null) return;
		float scale = legC.transform.lossyScale.z;
		for (int leg=0; leg<legC.legs.Length; leg++) {
			if (legC.legs[leg].ankle==null) continue;
			if (legC.legs[leg].toe==null) continue;
			if (legC.legs[leg].footLength+legC.legs[leg].footWidth==0) continue;
			legC.InitFootData(leg);
			Vector3 heel = legC.legs[leg].ankle.TransformPoint(legC.legs[leg].ankleHeelVector);
			Vector3 toetip = legC.legs[leg].toe.TransformPoint(legC.legs[leg].toeToetipVector);
			Vector3 side = (Quaternion.AngleAxis(90,up) * (toetip-heel)).normalized * legC.legs[leg].footWidth * scale;
			Gizmos.DrawLine(heel+side/2, toetip+side/2);
			Gizmos.DrawLine(heel-side/2, toetip-side/2);
			Gizmos.DrawLine(heel-side/2, heel+side/2);
			Gizmos.DrawLine(toetip-side/2, toetip+side/2);
		}
	}
开发者ID:VentorLee,项目名称:unity,代码行数:34,代码来源:LocomotionEditorClass.cs

示例15: RenderLightGizmo

 static void RenderLightGizmo(GameObject gameObject, GizmoType gizmoType)
 {
     if (gameObject.CompareTag("SpawnPoint")) {
         Gizmos.color = Color.red;
         Gizmos.DrawSphere(gameObject.transform.position, 0.5f);
     }
 }
开发者ID:LoganBarnett,项目名称:Droids,代码行数:7,代码来源:DroidSpawnGizmo.cs


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