protected override void DrawAdvanced() { base.DrawAdvanced(); Separator(); P3dPointConnector_Editor.Draw(); }
protected override void OnInspector() { TARGET tgt; TARGET[] tgts; GetTargets(out tgt, out tgts); BeginDisabled(true); EditorGUILayout.TextField("Emit", "Points In 3D", EditorStyles.popup); EndDisabled(); Draw("paintIn", "Where in the game loop should this component hit?"); Draw("interval", "The time in seconds between each hit.\n\n0 = Every frame.\n\n-1 = Manual only."); Separator(); Draw("preview", "Should the applied paint be applied as a preview?"); Draw("pressure", "This allows you to control the pressure of the painting. This could be controlled by a VR trigger or similar for more advanced effects."); Separator(); if (DrawFoldout("Advanced", "Show advanced settings?") == true) { BeginIndent(); P3dPointConnector_Editor.Draw(); Separator(); Draw("priority", "This allows you to override the order this paint gets applied to the object during the current frame."); EndIndent(); } Separator(); var point = true; var line = tgt.Connector.ConnectHits == true; tgt.Connector.HitCache.Inspector(tgt.gameObject, point: point, line: line); }
protected override void OnInspector() { TARGET tgt; TARGET[] tgts; GetTargets(out tgt, out tgts); Draw("emit", "This allows you to control the hit data this component sends out.\n\nPointsIn3D = Point drawing in 3D.\n\nPointsOnUV = Point drawing on UV (requires non-convex MeshCollider).\n\nTrianglesIn3D = Triangle drawing in 3D."); BeginError(Any(tgts, t => t.Layers == 0)); Draw("layers", "The layers you want the raycast to hit."); EndError(); Draw("paintIn", "Where in the game loop should this component hit?"); Draw("interval", "The time in seconds between each raycast.\n\n0 = Every Frame\n\n-1 = Manual Only"); Separator(); BeginError(Any(tgts, t => t.PointA == null)); Draw("pointA", "The start point of the raycast."); EndError(); BeginError(Any(tgts, t => t.PointB == null)); Draw("pointB", "The end point of the raycast."); EndError(); Draw("orientation", "How should the hit point be oriented?\n\nWorldUp = It will be rotated to the normal, where the up vector is world up.\n\nCameraUp = It will be rotated to the normal, where the up vector is world up."); BeginIndent(); if (Any(tgts, t => t.Orientation == P3dHitBetween.OrientationType.CameraUp)) { Draw("_camera", "Orient to a specific camera?\nNone = MainCamera."); } EndIndent(); Draw("normal", "Which normal should the hit point rotation be based on?"); Separator(); Draw("preview", "Should the applied paint be applied as a preview?"); Draw("pressure", "This allows you to control the pressure of the painting. This could be controlled by a VR trigger or similar for more advanced effects."); Separator(); if (DrawFoldout("Advanced", "Show advanced settings?") == true) { BeginIndent(); Draw("priority", "This allows you to override the order this paint gets applied to the object during the current frame."); Draw("offset", "If you want the raycast hit point to be offset from the surface a bit, this allows you to set by how much in world space."); Separator(); P3dPointConnector_Editor.Draw(); Separator(); Draw("point", "If you want to display something at the hit point (e.g. particles), you can specify the Transform here."); Draw("line", "If you want to draw a line between the start point and the his point then you can set the line here"); EndIndent(); } Separator(); var point = tgt.Draw == P3dHitBetween.EmitType.PointsIn3D; var line = tgt.Draw == P3dHitBetween.EmitType.PointsIn3D && tgt.Connector.ConnectHits == true; var triangle = tgt.Draw == P3dHitBetween.EmitType.TrianglesIn3D; var coord = tgt.Draw == P3dHitBetween.EmitType.PointsOnUV; tgt.Connector.HitCache.Inspector(tgt.gameObject, point: point, line: line, triangle: triangle, coord: coord); }