更新到0.6.0.2

This commit is contained in:
2026-07-06 08:47:33 +08:00
parent e29a5178b7
commit 97d41a1385
473 changed files with 156342 additions and 5 deletions
@@ -0,0 +1,55 @@
namespace DrawXXL
{
using UnityEngine;
public class LineFrom_fadeableAnimSpeed_screenspace : ParentOf_Lines_fadeableAnimSpeed_screenspace
{
public Vector2 start = Vector2.zero;
public Vector2 direction = Vector2.one;
public Color endColor = default(Color); //Can be ignored if the line should have only one color. If it is specified then the line will have a fading color transition, starting with "color"(link) at the start of the line and ending with "endColor" at the end of the line
public DrawBasics.LineStyle style = DrawBasics.LineStyle.solid;
public float stylePatternScaleFactor = 1.0f;
public bool interpretDirectionAsUnwarped = false;
public float alphaFadeOutLength_0to1 = 0.0f;
public float enlargeSmallTextToThisMinRelTextSize = DrawScreenspace.minTextSize_relToViewportHeight;
public LineFrom_fadeableAnimSpeed_screenspace(Vector2 start, Vector2 direction)
{
this.start = start;
this.direction = direction;
}
public override void Draw()
{
if (DXXLWrapperForUntiysBuildInDrawLines.CheckIfDrawingIsCurrentlySkipped()) { return; }
if (TryFetchCamera("LineFrom_fadeableAnimSpeed_screenspace.Draw") == false) { return; }
if (DrawXXL_LinesManager.instance.noteAllScreenspaceDrawsToSheduler_insteadOfImmediatelyDrawingThem)
{
DrawXXL_LinesManager.instance.listOfSheduled_ParentOf_Lines_fadeableAnimSpeed_screenspace.Add(this);
return;
}
if (UtilitiesDXXL_Colors.IsDefaultColor(endColor))
{
lineAnimationProgress = InternalDraw(targetCamera, start, direction, color, width_relToViewportHeight, text, interpretDirectionAsUnwarped, style, stylePatternScaleFactor, animationSpeed, lineAnimationProgress, endPlatesSize_relToViewportHeight, alphaFadeOutLength_0to1, enlargeSmallTextToThisMinRelTextSize, durationInSec);
}
else
{
lineAnimationProgress = InternalDraw_withColorFade(targetCamera, start, direction, color, endColor, width_relToViewportHeight, text, interpretDirectionAsUnwarped, style, stylePatternScaleFactor, animationSpeed, lineAnimationProgress, endPlatesSize_relToViewportHeight, alphaFadeOutLength_0to1, enlargeSmallTextToThisMinRelTextSize, durationInSec);
}
}
public static LineAnimationProgress InternalDraw(Camera targetCamera, Vector2 start, Vector2 direction, Color color, float width_relToViewportHeight, string text, bool interpretDirectionAsUnwarped, DrawBasics.LineStyle style, float stylePatternScaleFactor, float animationSpeed, LineAnimationProgress precedingLineAnimationProgress, float endPlatesSize_relToViewportHeight, float alphaFadeOutLength_0to1, float enlargeSmallTextToThisMinRelTextSize, float durationInSec)
{
return Ray_fadeableAnimSpeed_screenspace.InternalDraw(targetCamera, start, direction, color, width_relToViewportHeight, text, interpretDirectionAsUnwarped, style, stylePatternScaleFactor, animationSpeed, precedingLineAnimationProgress, endPlatesSize_relToViewportHeight, alphaFadeOutLength_0to1, enlargeSmallTextToThisMinRelTextSize, durationInSec);
}
public static LineAnimationProgress InternalDraw_withColorFade(Camera targetCamera, Vector2 start, Vector2 direction, Color startColor, Color endColor, float width_relToViewportHeight, string text, bool interpretDirectionAsUnwarped, DrawBasics.LineStyle style, float stylePatternScaleFactor, float animationSpeed, LineAnimationProgress precedingLineAnimationProgress, float endPlatesSize_relToViewportHeight, float alphaFadeOutLength_0to1, float enlargeSmallTextToThisMinRelTextSize, float durationInSec)
{
return Ray_fadeableAnimSpeed_screenspace.InternalDrawColorFade(targetCamera, start, direction, startColor, endColor, width_relToViewportHeight, text, interpretDirectionAsUnwarped, style, stylePatternScaleFactor, animationSpeed, precedingLineAnimationProgress, endPlatesSize_relToViewportHeight, alphaFadeOutLength_0to1, enlargeSmallTextToThisMinRelTextSize, durationInSec);
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 2b46f03e70807374dba929743dfa98b4
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,61 @@
namespace DrawXXL
{
using UnityEngine;
public class LineTo_fadeableAnimSpeed_screenspace : ParentOf_Lines_fadeableAnimSpeed_screenspace
{
public Vector2 direction = Vector2.one;
public Vector2 end = Vector2.one;
public Color endColor = default(Color); //Can be ignored if the line should have only one color. If it is specified then the line will have a fading color transition, starting with "color"(link) at the start of the line and ending with "endColor" at the end of the line
public DrawBasics.LineStyle style = DrawBasics.LineStyle.solid;
public float stylePatternScaleFactor = 1.0f;
public bool interpretDirectionAsUnwarped = false;
public float alphaFadeOutLength_0to1 = 0.0f;
public float enlargeSmallTextToThisMinRelTextSize = DrawScreenspace.minTextSize_relToViewportHeight;
public LineTo_fadeableAnimSpeed_screenspace(Vector2 direction, Vector2 end)
{
this.direction = direction;
this.end = end;
}
public override void Draw()
{
if (DXXLWrapperForUntiysBuildInDrawLines.CheckIfDrawingIsCurrentlySkipped()) { return; }
if (TryFetchCamera("LineTo_fadeableAnimSpeed_screenspace.Draw") == false) { return; }
if (DrawXXL_LinesManager.instance.noteAllScreenspaceDrawsToSheduler_insteadOfImmediatelyDrawingThem)
{
DrawXXL_LinesManager.instance.listOfSheduled_ParentOf_Lines_fadeableAnimSpeed_screenspace.Add(this);
return;
}
if (UtilitiesDXXL_Colors.IsDefaultColor(endColor))
{
lineAnimationProgress = InternalDraw(targetCamera, direction, end, color, width_relToViewportHeight, text, interpretDirectionAsUnwarped, style, stylePatternScaleFactor, animationSpeed, lineAnimationProgress, endPlatesSize_relToViewportHeight, alphaFadeOutLength_0to1, enlargeSmallTextToThisMinRelTextSize, durationInSec);
}
else
{
lineAnimationProgress = InternalDraw_withColorFade(targetCamera, direction, end, color, endColor, width_relToViewportHeight, text, interpretDirectionAsUnwarped, style, stylePatternScaleFactor, animationSpeed, lineAnimationProgress, endPlatesSize_relToViewportHeight, alphaFadeOutLength_0to1, enlargeSmallTextToThisMinRelTextSize, durationInSec);
}
}
public static LineAnimationProgress InternalDraw(Camera targetCamera, Vector2 direction, Vector2 end, Color color, float width_relToViewportHeight, string text, bool interpretDirectionAsUnwarped, DrawBasics.LineStyle style, float stylePatternScaleFactor, float animationSpeed, LineAnimationProgress precedingLineAnimationProgress, float endPlatesSize_relToViewportHeight, float alphaFadeOutLength_0to1, float enlargeSmallTextToThisMinRelTextSize, float durationInSec)
{
if (DXXLWrapperForUntiysBuildInDrawLines.CheckIfDrawingIsCurrentlySkipped()) { return null; }
if (UtilitiesDXXL_Log.ErrorLogForInvalidVectors(end, "end")) { return null; }
if (UtilitiesDXXL_Log.ErrorLogForInvalidVectors(direction, "direction")) { return null; }
return Ray_fadeableAnimSpeed_screenspace.InternalDraw(targetCamera, end - direction, direction, color, width_relToViewportHeight, text, interpretDirectionAsUnwarped, style, stylePatternScaleFactor, animationSpeed, precedingLineAnimationProgress, endPlatesSize_relToViewportHeight, alphaFadeOutLength_0to1, enlargeSmallTextToThisMinRelTextSize, durationInSec);
}
public static LineAnimationProgress InternalDraw_withColorFade(Camera targetCamera, Vector2 direction, Vector2 end, Color startColor, Color endColor, float width_relToViewportHeight, string text, bool interpretDirectionAsUnwarped, DrawBasics.LineStyle style, float stylePatternScaleFactor, float animationSpeed, LineAnimationProgress precedingLineAnimationProgress, float endPlatesSize_relToViewportHeight, float alphaFadeOutLength_0to1, float enlargeSmallTextToThisMinRelTextSize, float durationInSec)
{
if (DXXLWrapperForUntiysBuildInDrawLines.CheckIfDrawingIsCurrentlySkipped()) { return null; }
if (UtilitiesDXXL_Log.ErrorLogForInvalidVectors(end, "end")) { return null; }
if (UtilitiesDXXL_Log.ErrorLogForInvalidVectors(direction, "direction")) { return null; }
return Ray_fadeableAnimSpeed_screenspace.InternalDrawColorFade(targetCamera, end - direction, direction, startColor, endColor, width_relToViewportHeight, text, interpretDirectionAsUnwarped, style, stylePatternScaleFactor, animationSpeed, precedingLineAnimationProgress, endPlatesSize_relToViewportHeight, alphaFadeOutLength_0to1, enlargeSmallTextToThisMinRelTextSize, durationInSec);
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 958c9ceb6f9f09d4ba0987f6e0b03f4d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,81 @@
namespace DrawXXL
{
using UnityEngine;
public class LineWithAlternatingColors_fadeableAnimSpeed_screenspace : ParentOf_Lines_fadeableAnimSpeed_screenspace
{
public Vector2 start = Vector2.zero;
public Vector2 end = Vector2.one;
public Color alternatingColor = DrawBasics.defaultColor2_ofAlternatingColorLines;
public float lengthOfStripes_relToViewportHeight = 0.03f;
public float alphaFadeOutLength_0to1 = 0.0f;
public LineWithAlternatingColors_fadeableAnimSpeed_screenspace(Vector2 start, Vector2 end)
{
this.start = start;
this.end = end;
}
public override void Draw()
{
if (DXXLWrapperForUntiysBuildInDrawLines.CheckIfDrawingIsCurrentlySkipped()) { return; }
if (TryFetchCamera("LineWithAlternatingColors_fadeableAnimSpeed_screenspace.Draw") == false) { return; }
if (DrawXXL_LinesManager.instance.noteAllScreenspaceDrawsToSheduler_insteadOfImmediatelyDrawingThem)
{
DrawXXL_LinesManager.instance.listOfSheduled_ParentOf_Lines_fadeableAnimSpeed_screenspace.Add(this);
return;
}
lineAnimationProgress = InternalDraw(targetCamera, start, end, color, alternatingColor, width_relToViewportHeight, lengthOfStripes_relToViewportHeight, text, animationSpeed, lineAnimationProgress, endPlatesSize_relToViewportHeight, alphaFadeOutLength_0to1, durationInSec);
}
public static LineAnimationProgress InternalDraw(Camera targetCamera, Vector2 start, Vector2 end, Color color1, Color color2, float lineWidth_relToViewportHeight, float lengthOfStripes_relToViewportHeight, string text, float animationSpeed, LineAnimationProgress precedingLineAnimationProgress, float endPlatesSize_relToViewportHeight, float alphaFadeOutLength_0to1, float durationInSec)
{
//Lines drawn with this function have a higher likelyhood of accidentially using up high numbers of drawnLinePerFrame, because "lengthOfStripes" can be set manually instead of beeing determined by the lineStyle-code
if (DXXLWrapperForUntiysBuildInDrawLines.CheckIfDrawingIsCurrentlySkipped()) { return null; }
if (UtilitiesDXXL_Log.ErrorLogForNullUnityObjects(targetCamera, "targetCamera")) { return null; }
if (UtilitiesDXXL_Screenspace.CheckIfViewportIsTooSmall(targetCamera)) { return null; }
if (UtilitiesDXXL_Log.ErrorLogForInvalidFloats(lineWidth_relToViewportHeight, "lineWidth_relToViewportHeight")) { return null; }
if (UtilitiesDXXL_Log.ErrorLogForInvalidFloats(lengthOfStripes_relToViewportHeight, "lengthOfStripes_relToViewportHeight")) { return null; }
if (UtilitiesDXXL_Log.ErrorLogForInvalidFloats(animationSpeed, "animationSpeed")) { return null; }
if (UtilitiesDXXL_Log.ErrorLogForInvalidVectors(start, "start")) { return null; }
if (UtilitiesDXXL_Log.ErrorLogForInvalidVectors(end, "end")) { return null; }
Vector3 start_worldSpace = UtilitiesDXXL_Screenspace.ViewportSpacePos_to_WorldPosOnDrawPlane(targetCamera, start, false);
Vector3 end_worldSpace = UtilitiesDXXL_Screenspace.ViewportSpacePos_to_WorldPosOnDrawPlane(targetCamera, end, false);
Vector2 lineCenter = 0.5f * (start + end);
UtilitiesDXXL_Screenspace.camPlane.Recreate(start_worldSpace, targetCamera.transform.forward);
lineWidth_relToViewportHeight = UtilitiesDXXL_Math.AbsNonZeroValue(lineWidth_relToViewportHeight);
float lineWidth_worldSpace = UtilitiesDXXL_Math.ApproximatelyZero(lineWidth_relToViewportHeight) ? 0.0f : UtilitiesDXXL_Screenspace.VertExtentInsideViewportSpace_to_WorldSpaceExtentOnDrawPlane(targetCamera, lineCenter, true, lineWidth_relToViewportHeight);
float animationDirection = Mathf.Sign(animationSpeed);
animationSpeed = UtilitiesDXXL_Screenspace.animationSpeedConversionFactor_viewportToWorldSpace * animationSpeed;
float animationSpeed_worldSpace = UtilitiesDXXL_Math.ApproximatelyZero(animationSpeed) ? 0.0f : UtilitiesDXXL_Screenspace.VertExtentInsideViewportSpace_to_WorldSpaceExtentOnDrawPlane(targetCamera, lineCenter, true, animationSpeed);
animationSpeed_worldSpace = animationSpeed_worldSpace * animationDirection;
float minTextSize_worldSpace = UtilitiesDXXL_Screenspace.VertExtentInsideViewportSpace_to_WorldSpaceExtentOnDrawPlane(targetCamera, lineCenter, true, DrawScreenspace.minTextSize_relToViewportHeight);
lengthOfStripes_relToViewportHeight = Mathf.Max(lengthOfStripes_relToViewportHeight, UtilitiesDXXL_DrawBasics.min_lengthOfStripes_ofAlternatingColorLine);
float lengthOfStripes_worldSpace = UtilitiesDXXL_Screenspace.VertExtentInsideViewportSpace_to_WorldSpaceExtentOnDrawPlane(targetCamera, lineCenter, true, lengthOfStripes_relToViewportHeight);
UtilitiesDXXL_LineStyles.curr_dashLength_forAlternatingColorStripesLine = lengthOfStripes_worldSpace;
Color prev_defaultAlternateColorOfStripedLines = DrawBasics.defaultColor2_ofAlternatingColorLines;
if (UtilitiesDXXL_Colors.IsDefaultColor(color2) == false)
{
DrawBasics.defaultColor2_ofAlternatingColorLines = color2;
}
float endPlatesSize_inAbsoluteWorldSpaceUnits = UtilitiesDXXL_Math.ApproximatelyZero(endPlatesSize_relToViewportHeight) ? 0.0f : UtilitiesDXXL_Screenspace.VertExtentInsideViewportSpace_to_WorldSpaceExtentOnDrawPlane(targetCamera, lineCenter, true, endPlatesSize_relToViewportHeight);
UtilitiesDXXL_DrawBasics.Set_endPlates_sizeInterpretation_reversible(DrawBasics.LengthInterpretation.absoluteUnits);
LineAnimationProgress lineAnimProgressAfterDrawing = UtilitiesDXXL_DrawBasics.Line(start_worldSpace, end_worldSpace, color1, lineWidth_worldSpace, text, DrawBasics.LineStyle.alternatingColorStripes, 1.0f, animationSpeed_worldSpace, precedingLineAnimationProgress, UtilitiesDXXL_Screenspace.camPlane, true, alphaFadeOutLength_0to1, minTextSize_worldSpace, durationInSec, false, false, false, targetCamera, false, endPlatesSize_inAbsoluteWorldSpaceUnits);
UtilitiesDXXL_DrawBasics.Reverse_endPlates_sizeInterpretation();
UtilitiesDXXL_LineStyles.curr_dashLength_forAlternatingColorStripesLine = UtilitiesDXXL_LineStyles.default_dashLength_forAlternatingColorStripesLine;
DrawBasics.defaultColor2_ofAlternatingColorLines = prev_defaultAlternateColorOfStripedLines;
return lineAnimProgressAfterDrawing;
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a001dca73c1baac489f438f94e052e8d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,84 @@
namespace DrawXXL
{
using UnityEngine;
public class Line_fadeableAnimSpeed_screenspace : ParentOf_Lines_fadeableAnimSpeed_screenspace
{
public Vector2 start = Vector2.zero;
public Vector2 end = Vector2.one;
public Color endColor = default(Color); //Can be ignored if the line should have only one color. If it is specified then the line will have a fading color transition, starting with "color"(link) at the start of the line and ending with "endColor" at the end of the line
public DrawBasics.LineStyle style = DrawBasics.LineStyle.solid;
public float stylePatternScaleFactor = 1.0f;
public float alphaFadeOutLength_0to1 = 0.0f;
public float enlargeSmallTextToThisMinRelTextSize = DrawScreenspace.minTextSize_relToViewportHeight;
public Line_fadeableAnimSpeed_screenspace(Vector2 start, Vector2 end)
{
this.start = start;
this.end = end;
}
public override void Draw()
{
if (DXXLWrapperForUntiysBuildInDrawLines.CheckIfDrawingIsCurrentlySkipped()) { return; }
if (TryFetchCamera("Line_fadeableAnimSpeed_screenspace.Draw") == false) { return; }
if (DrawXXL_LinesManager.instance.noteAllScreenspaceDrawsToSheduler_insteadOfImmediatelyDrawingThem)
{
DrawXXL_LinesManager.instance.listOfSheduled_ParentOf_Lines_fadeableAnimSpeed_screenspace.Add(this);
return;
}
if (UtilitiesDXXL_Colors.IsDefaultColor(endColor))
{
lineAnimationProgress = InternalDraw(targetCamera, start, end, color, width_relToViewportHeight, text, style, stylePatternScaleFactor, animationSpeed, lineAnimationProgress, endPlatesSize_relToViewportHeight, alphaFadeOutLength_0to1, enlargeSmallTextToThisMinRelTextSize, durationInSec);
}
else
{
lineAnimationProgress = InternalDrawColorFade(targetCamera, start, end, color, endColor, width_relToViewportHeight, text, style, stylePatternScaleFactor, animationSpeed, lineAnimationProgress, endPlatesSize_relToViewportHeight, alphaFadeOutLength_0to1, enlargeSmallTextToThisMinRelTextSize, durationInSec);
}
}
public static LineAnimationProgress InternalDraw(Camera targetCamera, Vector2 start, Vector2 end, Color color, float width_relToViewportHeight, string text, DrawBasics.LineStyle style, float stylePatternScaleFactor, float animationSpeed, LineAnimationProgress precedingLineAnimationProgress, float endPlatesSize_relToViewportHeight, float alphaFadeOutLength_0to1, float enlargeSmallTextToThisMinRelTextSize, float durationInSec)
{
if (DXXLWrapperForUntiysBuildInDrawLines.CheckIfDrawingIsCurrentlySkipped()) { return null; }
if (UtilitiesDXXL_Log.ErrorLogForNullUnityObjects(targetCamera, "targetCamera")) { return null; }
if (UtilitiesDXXL_Screenspace.CheckIfViewportIsTooSmall(targetCamera)) { return null; }
InternalDXXL_LineParamsFromCamViewportSpace lineParams = UtilitiesDXXL_Screenspace.GetLineParamsFromCamViewportSpace(targetCamera, start, end, width_relToViewportHeight, style, stylePatternScaleFactor, enlargeSmallTextToThisMinRelTextSize, animationSpeed, endPlatesSize_relToViewportHeight);
if (lineParams == null)
{
return null;
}
else
{
UtilitiesDXXL_DrawBasics.Set_endPlates_sizeInterpretation_reversible(DrawBasics.LengthInterpretation.absoluteUnits);
LineAnimationProgress returned_lineAnimationProgress = UtilitiesDXXL_DrawBasics.Line(lineParams.startAnchor_worldSpace, lineParams.endAnchor_worldSpace, color, lineParams.width_worldSpace, text, lineParams.lineStyleForcedTo2D, lineParams.patternScaleFactor_worldSpace, lineParams.animationSpeed_worldSpace, precedingLineAnimationProgress, lineParams.camPlane, true, alphaFadeOutLength_0to1, lineParams.enlargeSmallTextToThisMinTextSize_worldSpace, durationInSec, false, false, false, targetCamera, false, lineParams.endPlatesSize_inAbsoluteWorldSpaceUnits);
UtilitiesDXXL_DrawBasics.Reverse_endPlates_sizeInterpretation();
return returned_lineAnimationProgress;
}
}
public static LineAnimationProgress InternalDrawColorFade(Camera targetCamera, Vector2 start, Vector2 end, Color startColor, Color endColor, float width_relToViewportHeight, string text, DrawBasics.LineStyle style, float stylePatternScaleFactor, float animationSpeed, LineAnimationProgress precedingLineAnimationProgress, float endPlatesSize_relToViewportHeight, float alphaFadeOutLength_0to1, float enlargeSmallTextToThisMinRelTextSize, float durationInSec)
{
if (DXXLWrapperForUntiysBuildInDrawLines.CheckIfDrawingIsCurrentlySkipped()) { return null; }
if (UtilitiesDXXL_Log.ErrorLogForNullUnityObjects(targetCamera, "targetCamera")) { return null; }
if (UtilitiesDXXL_Screenspace.CheckIfViewportIsTooSmall(targetCamera)) { return null; }
InternalDXXL_LineParamsFromCamViewportSpace lineParams = UtilitiesDXXL_Screenspace.GetLineParamsFromCamViewportSpace(targetCamera, start, end, width_relToViewportHeight, style, stylePatternScaleFactor, enlargeSmallTextToThisMinRelTextSize, animationSpeed, endPlatesSize_relToViewportHeight);
if (lineParams == null)
{
return null;
}
else
{
UtilitiesDXXL_DrawBasics.Set_endPlates_sizeInterpretation_reversible(DrawBasics.LengthInterpretation.absoluteUnits);
LineAnimationProgress returned_lineAnimationProgress = UtilitiesDXXL_DrawBasics.LineColorFade(lineParams.startAnchor_worldSpace, lineParams.endAnchor_worldSpace, startColor, endColor, lineParams.width_worldSpace, text, lineParams.lineStyleForcedTo2D, lineParams.patternScaleFactor_worldSpace, lineParams.animationSpeed_worldSpace, precedingLineAnimationProgress, lineParams.camPlane, true, alphaFadeOutLength_0to1, lineParams.enlargeSmallTextToThisMinTextSize_worldSpace, durationInSec, false, false, false, targetCamera, false, lineParams.endPlatesSize_inAbsoluteWorldSpaceUnits, 1.0f);
UtilitiesDXXL_DrawBasics.Reverse_endPlates_sizeInterpretation();
return returned_lineAnimationProgress;
}
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d28f5ea6fc8f1b24485cb5b66fee04da
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,100 @@
namespace DrawXXL
{
using UnityEngine;
public class MovingArrowsLine_fadeableAnimSpeed_screenspace : ParentOf_Lines_fadeableAnimSpeed_screenspace
{
public Vector2 start = Vector2.zero;
public Vector2 end = Vector2.one;
public float distanceBetweenArrows_relToViewportHeight = 0.11f;
public float lengthOfArrows_relToViewportHeight = 0.05f;
public bool backwardAnimationFlipsArrowDirection = true;
public MovingArrowsLine_fadeableAnimSpeed_screenspace(Vector2 start, Vector2 end)
{
this.start = start;
this.end = end;
width_relToViewportHeight = 0.016f;
animationSpeed = 0.5f;
}
public override void Draw()
{
if (DXXLWrapperForUntiysBuildInDrawLines.CheckIfDrawingIsCurrentlySkipped()) { return; }
if (TryFetchCamera("MovingArrowsLine_fadeableAnimSpeed_screenspace.Draw") == false) { return; }
if (DrawXXL_LinesManager.instance.noteAllScreenspaceDrawsToSheduler_insteadOfImmediatelyDrawingThem)
{
DrawXXL_LinesManager.instance.listOfSheduled_ParentOf_Lines_fadeableAnimSpeed_screenspace.Add(this);
return;
}
lineAnimationProgress = InternalDraw(targetCamera, start, end, color, width_relToViewportHeight, distanceBetweenArrows_relToViewportHeight, lengthOfArrows_relToViewportHeight, text, animationSpeed, lineAnimationProgress, backwardAnimationFlipsArrowDirection, endPlatesSize_relToViewportHeight, durationInSec);
}
public static LineAnimationProgress InternalDraw(Camera targetCamera, Vector2 start, Vector2 end, Color color, float lineWidth_relToViewportHeight, float distanceBetweenArrows_relToViewportHeight, float lengthOfArrows_relToViewportHeight, string text, float animationSpeed, LineAnimationProgress precedingLineAnimationProgress, bool backwardAnimationFlipsArrowDirection, float endPlatesSize_relToViewportHeight, float durationInSec)
{
//"lengthOfArrows_relToViewportHeight" and "distanceBetweenArrows_relToViewportHeight": Very small (or very big) values may get rounded up (down) internally to prevent an explosive raise of drawn lines, see also "DrawBasics.MaxAllowedDrawnLinesPerFrame" (link).
//Lines drawn with this function have a higher likelyhood of accidentially using up high numbers of drawnLinePerFrame, because "distanceBetweenArrows_relToViewportHeight" and "lengthOfArrows_relToViewportHeight" can be set manually instead of beeing determined by the lineStyle-code
if (DXXLWrapperForUntiysBuildInDrawLines.CheckIfDrawingIsCurrentlySkipped()) { return null; }
if (UtilitiesDXXL_Log.ErrorLogForNullUnityObjects(targetCamera, "targetCamera")) { return null; }
if (UtilitiesDXXL_Screenspace.CheckIfViewportIsTooSmall(targetCamera)) { return null; }
if (UtilitiesDXXL_Log.ErrorLogForInvalidFloats(lineWidth_relToViewportHeight, "lineWidth_relToViewportHeight")) { return null; }
if (UtilitiesDXXL_Log.ErrorLogForInvalidFloats(distanceBetweenArrows_relToViewportHeight, "distanceBetweenArrows_relToViewportHeight")) { return null; }
if (UtilitiesDXXL_Log.ErrorLogForInvalidFloats(lengthOfArrows_relToViewportHeight, "lengthOfArrows_relToViewportHeight")) { return null; }
if (UtilitiesDXXL_Log.ErrorLogForInvalidFloats(animationSpeed, "animationSpeed")) { return null; }
if (UtilitiesDXXL_Log.ErrorLogForInvalidVectors(start, "start")) { return null; }
if (UtilitiesDXXL_Log.ErrorLogForInvalidVectors(end, "end")) { return null; }
Vector3 start_worldSpace = UtilitiesDXXL_Screenspace.ViewportSpacePos_to_WorldPosOnDrawPlane(targetCamera, start, false);
Vector3 end_worldSpace = UtilitiesDXXL_Screenspace.ViewportSpacePos_to_WorldPosOnDrawPlane(targetCamera, end, false);
Vector2 lineCenter = 0.5f * (start + end);
UtilitiesDXXL_Screenspace.camPlane.Recreate(start_worldSpace, targetCamera.transform.forward);
lineWidth_relToViewportHeight = UtilitiesDXXL_Math.AbsNonZeroValue(lineWidth_relToViewportHeight);
float lineWidth_worldSpace = UtilitiesDXXL_Math.ApproximatelyZero(lineWidth_relToViewportHeight) ? 0.0f : UtilitiesDXXL_Screenspace.VertExtentInsideViewportSpace_to_WorldSpaceExtentOnDrawPlane(targetCamera, lineCenter, true, lineWidth_relToViewportHeight);
//small or big values of "distanceBetweenArrows" and "lengthOfArrows" may additionally get changed in "UtilitiesDXXL_LineStyles" inside the "skipPatternEnlargementFor*Lines == false" mechanic.
distanceBetweenArrows_relToViewportHeight = Mathf.Max(distanceBetweenArrows_relToViewportHeight, 0.0002f);
lengthOfArrows_relToViewportHeight = Mathf.Min(lengthOfArrows_relToViewportHeight, 0.9f * distanceBetweenArrows_relToViewportHeight);
lengthOfArrows_relToViewportHeight = Mathf.Max(lengthOfArrows_relToViewportHeight, 0.0001f);
float distanceBetweenArrows_worldSpace = UtilitiesDXXL_Screenspace.VertExtentInsideViewportSpace_to_WorldSpaceExtentOnDrawPlane(targetCamera, lineCenter, true, distanceBetweenArrows_relToViewportHeight);
float lengthOfArrows_worldSpace = UtilitiesDXXL_Screenspace.VertExtentInsideViewportSpace_to_WorldSpaceExtentOnDrawPlane(targetCamera, lineCenter, true, lengthOfArrows_relToViewportHeight);
float animationDirection = Mathf.Sign(animationSpeed);
animationSpeed = UtilitiesDXXL_Screenspace.animationSpeedConversionFactor_viewportToWorldSpace * animationSpeed;
float animationSpeed_worldSpace = UtilitiesDXXL_Math.ApproximatelyZero(animationSpeed) ? 0.0f : UtilitiesDXXL_Screenspace.VertExtentInsideViewportSpace_to_WorldSpaceExtentOnDrawPlane(targetCamera, lineCenter, true, animationSpeed);
animationSpeed_worldSpace = animationSpeed_worldSpace * animationDirection;
float minTextSize_worldSpace = UtilitiesDXXL_Screenspace.VertExtentInsideViewportSpace_to_WorldSpaceExtentOnDrawPlane(targetCamera, lineCenter, true, DrawScreenspace.minTextSize_relToViewportHeight);
float lengthOfEmptySpaces_worldSpace = distanceBetweenArrows_worldSpace - lengthOfArrows_worldSpace;
float endPlatesSize_inAbsoluteWorldSpaceUnits = UtilitiesDXXL_Math.ApproximatelyZero(endPlatesSize_relToViewportHeight) ? 0.0f : UtilitiesDXXL_Screenspace.VertExtentInsideViewportSpace_to_WorldSpaceExtentOnDrawPlane(targetCamera, lineCenter, true, endPlatesSize_relToViewportHeight);
LineAnimationProgress lineAnimProgressAfterDrawing = null;
UtilitiesDXXL_LineStyles.curr_pointersDirAlongAnimationDir = backwardAnimationFlipsArrowDirection;
UtilitiesDXXL_DrawBasics.Set_endPlates_sizeInterpretation_reversible(DrawBasics.LengthInterpretation.absoluteUnits);
try
{
UtilitiesDXXL_LineStyles.curr_dashLength_forArrowLine = lengthOfArrows_worldSpace;
if (UtilitiesDXXL_Math.ApproximatelyZero(lineWidth_worldSpace) == false)
{
UtilitiesDXXL_LineStyles.curr_minRatio_for_dashLengthToLineWidth_forArrowLine = lengthOfArrows_worldSpace / lineWidth_worldSpace;
}
UtilitiesDXXL_LineStyles.curr_spaceToDash_ratio_forArrowLine = lengthOfEmptySpaces_worldSpace / lengthOfArrows_worldSpace;
UtilitiesDXXL_LineStyles.curr_minEmptySpacesLength_forArrowLine = lengthOfEmptySpaces_worldSpace;
lineAnimProgressAfterDrawing = UtilitiesDXXL_DrawBasics.Line(start_worldSpace, end_worldSpace, color, lineWidth_worldSpace, text, DrawBasics.LineStyle.arrows, 1.0f, animationSpeed_worldSpace, precedingLineAnimationProgress, UtilitiesDXXL_Screenspace.camPlane, true, 0.0f, minTextSize_worldSpace, durationInSec, false, false, false, targetCamera, false, endPlatesSize_inAbsoluteWorldSpaceUnits);
}
catch { }
UtilitiesDXXL_DrawBasics.Reverse_endPlates_sizeInterpretation();
UtilitiesDXXL_LineStyles.curr_pointersDirAlongAnimationDir = UtilitiesDXXL_LineStyles.default_pointersDirAlongAnimationDir;
UtilitiesDXXL_LineStyles.curr_dashLength_forArrowLine = UtilitiesDXXL_LineStyles.default_dashLength_forArrowLine;
UtilitiesDXXL_LineStyles.curr_minRatio_for_dashLengthToLineWidth_forArrowLine = UtilitiesDXXL_LineStyles.default_minRatio_for_dashLengthToLineWidth_forArrowLine;
UtilitiesDXXL_LineStyles.curr_spaceToDash_ratio_forArrowLine = UtilitiesDXXL_LineStyles.default_spaceToDash_ratio_forArrowLine;
UtilitiesDXXL_LineStyles.curr_minEmptySpacesLength_forArrowLine = UtilitiesDXXL_LineStyles.default_minEmptySpacesLength_forArrowLine;
return lineAnimProgressAfterDrawing;
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 1378d0e5f4f25aa43977ca4b06c8c47d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,49 @@
namespace DrawXXL
{
using UnityEngine;
public class MovingArrowsRay_fadeableAnimSpeed_screenspace : ParentOf_Lines_fadeableAnimSpeed_screenspace
{
public Vector2 start = Vector2.zero;
public Vector2 direction = Vector2.one;
public bool interpretDirectionAsUnwarped = false;
public bool backwardAnimationFlipsArrowDirection = true;
public float distanceBetweenArrows_relToViewportHeight = 0.11f;
public float lengthOfArrows_relToViewportHeight = 0.05f;
public MovingArrowsRay_fadeableAnimSpeed_screenspace(Vector2 start, Vector2 direction)
{
this.start = start;
this.direction = direction;
width_relToViewportHeight = 0.016f;
animationSpeed = 0.5f;
}
public override void Draw()
{
if (DXXLWrapperForUntiysBuildInDrawLines.CheckIfDrawingIsCurrentlySkipped()) { return; }
if (TryFetchCamera("MovingArrowsRay_fadeableAnimSpeed_screenspace.Draw") == false) { return; }
if (DrawXXL_LinesManager.instance.noteAllScreenspaceDrawsToSheduler_insteadOfImmediatelyDrawingThem)
{
DrawXXL_LinesManager.instance.listOfSheduled_ParentOf_Lines_fadeableAnimSpeed_screenspace.Add(this);
return;
}
lineAnimationProgress = InternalDraw(targetCamera, start, direction, color, width_relToViewportHeight, distanceBetweenArrows_relToViewportHeight, lengthOfArrows_relToViewportHeight, text, animationSpeed, lineAnimationProgress, backwardAnimationFlipsArrowDirection, interpretDirectionAsUnwarped, endPlatesSize_relToViewportHeight, durationInSec);
}
public static LineAnimationProgress InternalDraw(Camera targetCamera, Vector2 start, Vector2 direction, Color color, float lineWidth_relToViewportHeight, float distanceBetweenArrows_relToViewportHeight, float lengthOfArrows_relToViewportHeight, string text, float animationSpeed, LineAnimationProgress precedingLineAnimationProgress, bool backwardAnimationFlipsArrowDirection, bool interpretDirectionAsUnwarped, float endPlatesSize_relToViewportHeight, float durationInSec)
{
if (DXXLWrapperForUntiysBuildInDrawLines.CheckIfDrawingIsCurrentlySkipped()) { return null; }
if (UtilitiesDXXL_Log.ErrorLogForInvalidVectors(start, "start")) { return null; }
if (UtilitiesDXXL_Log.ErrorLogForInvalidVectors(direction, "direction")) { return null; }
Vector2 direction_inNonSquareViewportSpace = interpretDirectionAsUnwarped ? DrawScreenspace.DirectionInUnitsOfUnwarpedSpace_to_sameLookingDirectionInUnitsOfWarpedSpace(direction, targetCamera) : direction;
Vector2 end = start + direction_inNonSquareViewportSpace;
return MovingArrowsLine_fadeableAnimSpeed_screenspace.InternalDraw(targetCamera, start, end, color, lineWidth_relToViewportHeight, distanceBetweenArrows_relToViewportHeight, lengthOfArrows_relToViewportHeight, text, animationSpeed, precedingLineAnimationProgress, backwardAnimationFlipsArrowDirection, endPlatesSize_relToViewportHeight, durationInSec);
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 87f5af2fd65f47e479a0e60eb63b07a7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,46 @@
namespace DrawXXL
{
using UnityEngine;
public class RayWithAlternatingColors_fadeableAnimSpeed_screenspace : ParentOf_Lines_fadeableAnimSpeed_screenspace
{
public Vector2 start = Vector2.zero;
public Vector2 direction = Vector2.one;
public Color alternatingColor = DrawBasics.defaultColor2_ofAlternatingColorLines;
public float lengthOfStripes_relToViewportHeight = 0.03f;
public bool interpretDirectionAsUnwarped = false;
public float alphaFadeOutLength_0to1 = 0.0f;
public RayWithAlternatingColors_fadeableAnimSpeed_screenspace(Vector2 start, Vector2 direction)
{
this.start = start;
this.direction = direction;
}
public override void Draw()
{
if (DXXLWrapperForUntiysBuildInDrawLines.CheckIfDrawingIsCurrentlySkipped()) { return; }
if (TryFetchCamera("RayWithAlternatingColors_fadeableAnimSpeed_screenspace.Draw") == false) { return; }
if (DrawXXL_LinesManager.instance.noteAllScreenspaceDrawsToSheduler_insteadOfImmediatelyDrawingThem)
{
DrawXXL_LinesManager.instance.listOfSheduled_ParentOf_Lines_fadeableAnimSpeed_screenspace.Add(this);
return;
}
lineAnimationProgress = InternalDraw(targetCamera, start, direction, color, alternatingColor, width_relToViewportHeight, lengthOfStripes_relToViewportHeight, text, interpretDirectionAsUnwarped, animationSpeed, lineAnimationProgress, endPlatesSize_relToViewportHeight, alphaFadeOutLength_0to1, durationInSec);
}
public static LineAnimationProgress InternalDraw(Camera targetCamera, Vector2 start, Vector2 direction, Color color1, Color color2, float lineWidth_relToViewportHeight, float lengthOfStripes_relToViewportHeight, string text, bool interpretDirectionAsUnwarped, float animationSpeed, LineAnimationProgress precedingLineAnimationProgress, float endPlatesSize_relToViewportHeight, float alphaFadeOutLength_0to1, float durationInSec)
{
if (DXXLWrapperForUntiysBuildInDrawLines.CheckIfDrawingIsCurrentlySkipped()) { return null; }
if (UtilitiesDXXL_Log.ErrorLogForInvalidVectors(start, "start")) { return null; }
if (UtilitiesDXXL_Log.ErrorLogForInvalidVectors(direction, "direction")) { return null; }
Vector2 direction_inNonSquareViewportSpace = interpretDirectionAsUnwarped ? DrawScreenspace.DirectionInUnitsOfUnwarpedSpace_to_sameLookingDirectionInUnitsOfWarpedSpace(direction, targetCamera) : direction;
Vector2 end = start + direction_inNonSquareViewportSpace;
return LineWithAlternatingColors_fadeableAnimSpeed_screenspace.InternalDraw(targetCamera, start, end, color1, color2, lineWidth_relToViewportHeight, lengthOfStripes_relToViewportHeight, text, animationSpeed, precedingLineAnimationProgress, endPlatesSize_relToViewportHeight, alphaFadeOutLength_0to1, durationInSec);
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 7c8699cd8b2a1a6428b13f97fc20917e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,64 @@
namespace DrawXXL
{
using UnityEngine;
public class Ray_fadeableAnimSpeed_screenspace : ParentOf_Lines_fadeableAnimSpeed_screenspace
{
public Vector2 start = Vector2.zero;
public Vector2 direction = Vector2.one;
public Color endColor = default(Color); //Can be ignored if the line should have only one color. If it is specified then the line will have a fading color transition, starting with "color"(link) at the start of the line and ending with "endColor" at the end of the line
public DrawBasics.LineStyle style = DrawBasics.LineStyle.solid;
public float stylePatternScaleFactor = 1.0f;
public bool interpretDirectionAsUnwarped = false;
public float alphaFadeOutLength_0to1 = 0.0f;
public float enlargeSmallTextToThisMinRelTextSize = DrawScreenspace.minTextSize_relToViewportHeight;
public Ray_fadeableAnimSpeed_screenspace(Vector2 start, Vector2 direction)
{
this.start = start;
this.direction = direction;
}
public override void Draw()
{
if (DXXLWrapperForUntiysBuildInDrawLines.CheckIfDrawingIsCurrentlySkipped()) { return; }
if (TryFetchCamera("Ray_fadeableAnimSpeed_screenspace.Draw") == false) { return; }
if (DrawXXL_LinesManager.instance.noteAllScreenspaceDrawsToSheduler_insteadOfImmediatelyDrawingThem)
{
DrawXXL_LinesManager.instance.listOfSheduled_ParentOf_Lines_fadeableAnimSpeed_screenspace.Add(this);
return;
}
if (UtilitiesDXXL_Colors.IsDefaultColor(endColor))
{
lineAnimationProgress = InternalDraw(targetCamera, start, direction, color, width_relToViewportHeight, text, interpretDirectionAsUnwarped, style, stylePatternScaleFactor, animationSpeed, lineAnimationProgress, endPlatesSize_relToViewportHeight, alphaFadeOutLength_0to1, enlargeSmallTextToThisMinRelTextSize, durationInSec);
}
else
{
lineAnimationProgress = InternalDrawColorFade(targetCamera, start, direction, color, endColor, width_relToViewportHeight, text, interpretDirectionAsUnwarped, style, stylePatternScaleFactor, animationSpeed, lineAnimationProgress, endPlatesSize_relToViewportHeight, alphaFadeOutLength_0to1, enlargeSmallTextToThisMinRelTextSize, durationInSec);
}
}
public static LineAnimationProgress InternalDraw(Camera targetCamera, Vector2 start, Vector2 direction, Color color, float width_relToViewportHeight, string text, bool interpretDirectionAsUnwarped, DrawBasics.LineStyle style, float stylePatternScaleFactor, float animationSpeed, LineAnimationProgress precedingLineAnimationProgress, float endPlatesSize_relToViewportHeight, float alphaFadeOutLength_0to1, float enlargeSmallTextToThisMinRelTextSize, float durationInSec)
{
if (DXXLWrapperForUntiysBuildInDrawLines.CheckIfDrawingIsCurrentlySkipped()) { return null; }
if (UtilitiesDXXL_Log.ErrorLogForInvalidVectors(start, "start")) { return null; }
if (UtilitiesDXXL_Log.ErrorLogForInvalidVectors(direction, "direction")) { return null; }
Vector2 direction_inNonSquareViewportSpace = interpretDirectionAsUnwarped ? DrawScreenspace.DirectionInUnitsOfUnwarpedSpace_to_sameLookingDirectionInUnitsOfWarpedSpace(direction, targetCamera) : direction;
return Line_fadeableAnimSpeed_screenspace.InternalDraw(targetCamera, start, start + direction_inNonSquareViewportSpace, color, width_relToViewportHeight, text, style, stylePatternScaleFactor, animationSpeed, precedingLineAnimationProgress, endPlatesSize_relToViewportHeight, alphaFadeOutLength_0to1, enlargeSmallTextToThisMinRelTextSize, durationInSec);
}
public static LineAnimationProgress InternalDrawColorFade(Camera targetCamera, Vector2 start, Vector2 direction, Color startColor, Color endColor, float width_relToViewportHeight, string text, bool interpretDirectionAsUnwarped, DrawBasics.LineStyle style, float stylePatternScaleFactor, float animationSpeed, LineAnimationProgress precedingLineAnimationProgress, float endPlatesSize_relToViewportHeight, float alphaFadeOutLength_0to1, float enlargeSmallTextToThisMinRelTextSize, float durationInSec)
{
if (DXXLWrapperForUntiysBuildInDrawLines.CheckIfDrawingIsCurrentlySkipped()) { return null; }
if (UtilitiesDXXL_Log.ErrorLogForInvalidVectors(start, "start")) { return null; }
if (UtilitiesDXXL_Log.ErrorLogForInvalidVectors(direction, "direction")) { return null; }
Vector2 direction_inNonSquareViewportSpace = interpretDirectionAsUnwarped ? DrawScreenspace.DirectionInUnitsOfUnwarpedSpace_to_sameLookingDirectionInUnitsOfWarpedSpace(direction, targetCamera) : direction;
return Line_fadeableAnimSpeed_screenspace.InternalDrawColorFade(targetCamera, start, start + direction_inNonSquareViewportSpace, startColor, endColor, width_relToViewportHeight, text, style, stylePatternScaleFactor, animationSpeed, precedingLineAnimationProgress, endPlatesSize_relToViewportHeight, alphaFadeOutLength_0to1, enlargeSmallTextToThisMinRelTextSize, durationInSec);
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 067eade0a87557b48a82173e65ff05c3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: