Compare commits

..

No commits in common. "main" and "v0.1.20" have entirely different histories.

38 changed files with 59 additions and 775 deletions

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: f5f43322334040eda82a02238038c637
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 210 KiB

View File

@ -1,89 +0,0 @@
fileFormatVersion: 2
guid: 07da6f60b8c84789bc7ee4602f68d356
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 256
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings: []
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 202 KiB

View File

@ -1,89 +0,0 @@
fileFormatVersion: 2
guid: 8f25ac2c42604ab79638fbe063e38a1e
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 256
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings: []
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 317 KiB

View File

@ -1,89 +0,0 @@
fileFormatVersion: 2
guid: 0c84e46fbbf5438d8099a052a0afc864
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 256
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings: []
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 209 KiB

View File

@ -1,89 +0,0 @@
fileFormatVersion: 2
guid: 07856e0ad4ad45cea23acd5143fd834a
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 256
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings: []
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 KiB

View File

@ -1,89 +0,0 @@
fileFormatVersion: 2
guid: 9f06836401f24edab7eb10cfa8cc366c
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 256
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings: []
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 190 KiB

View File

@ -1,89 +0,0 @@
fileFormatVersion: 2
guid: cb343fa7887e4c33841ba7c34114ba1b
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 256
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings: []
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 324 KiB

View File

@ -1,89 +0,0 @@
fileFormatVersion: 2
guid: 6e8f1bdf638d4772bde06d7d0eeb8af3
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 256
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings: []
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,69 +0,0 @@
using System;
using System.Linq;
using Streamingle.Utils.LerpConstraints;
using UnityEditor;
using UnityEngine;
namespace Streamingle.Utils.LerpConstraintsEditor
{
[InitializeOnLoad]
internal static class LerpConstraintIconInstaller
{
private const string IconDirectory = "Packages/com.streamingle.utilities/Editor/Constraints/Icons";
private static readonly IconDefinition[] IconDefinitions =
{
new IconDefinition(typeof(LerpAimConstraint), "LerpAimConstraintIcon"),
new IconDefinition(typeof(LerpLookAtConstraint), "LerpLookAtConstraintIcon"),
new IconDefinition(typeof(LerpParentConstraint), "LerpParentConstraintIcon"),
new IconDefinition(typeof(LerpPositionConstraint), "LerpPositionConstraintIcon"),
new IconDefinition(typeof(LerpRotationConstraint), "LerpRotationConstraintIcon"),
new IconDefinition(typeof(LerpScaleConstraint), "LerpScaleConstraintIcon")
};
static LerpConstraintIconInstaller()
{
EditorApplication.delayCall += ApplyIcons;
}
private static void ApplyIcons()
{
string[] scriptGuids = AssetDatabase.FindAssets(
"t:MonoScript",
new[] { "Packages/com.streamingle.utilities/Runtime/Constraints" });
foreach (IconDefinition definition in IconDefinitions)
{
Texture2D icon = AssetDatabase.LoadAssetAtPath<Texture2D>(
$"{IconDirectory}/{definition.IconName}.png");
if (icon == null)
{
continue;
}
MonoScript script = scriptGuids
.Select(AssetDatabase.GUIDToAssetPath)
.Select(AssetDatabase.LoadAssetAtPath<MonoScript>)
.FirstOrDefault(candidate => candidate != null && candidate.GetClass() == definition.ConstraintType);
if (script != null)
{
EditorGUIUtility.SetIconForObject(script, icon);
}
}
}
private readonly struct IconDefinition
{
public IconDefinition(Type constraintType, string iconName)
{
ConstraintType = constraintType;
IconName = iconName;
}
public Type ConstraintType { get; }
public string IconName { get; }
}
}
}

View File

@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 97633b0c6f0f4ca0a862c50e6de6f70b

View File

@ -1,13 +1,13 @@
using Streamingle.Utils.LerpConstraints; using Streamingle.Utils.RoughConstraints;
using UnityEditor; using UnityEditor;
using UnityEditorInternal; using UnityEditorInternal;
using UnityEngine; using UnityEngine;
namespace Streamingle.Utils.LerpConstraintsEditor namespace Streamingle.Utils.RoughConstraintsEditor
{ {
[CustomEditor(typeof(LerpConstraintBase), true)] [CustomEditor(typeof(RoughConstraintBase), true)]
[CanEditMultipleObjects] [CanEditMultipleObjects]
public sealed class LerpConstraintEditor : UnityEditor.Editor public sealed class RoughConstraintEditor : UnityEditor.Editor
{ {
private SerializedProperty constraintActive; private SerializedProperty constraintActive;
private SerializedProperty locked; private SerializedProperty locked;
@ -18,7 +18,7 @@ namespace Streamingle.Utils.LerpConstraintsEditor
private SerializedProperty useUnscaledTime; private SerializedProperty useUnscaledTime;
private SerializedProperty snapOnEnable; private SerializedProperty snapOnEnable;
private ReorderableList sourceList; private ReorderableList sourceList;
private bool lerpFollowFoldout = true; private bool roughFollowFoldout = true;
private bool settingsFoldout = true; private bool settingsFoldout = true;
private void OnEnable() private void OnEnable()
@ -62,7 +62,7 @@ namespace Streamingle.Utils.LerpConstraintsEditor
GUILayout.FlexibleSpace(); GUILayout.FlexibleSpace();
if (GUILayout.Button("Activate", EditorStyles.miniButton, GUILayout.Width(72f))) if (GUILayout.Button("Activate", EditorStyles.miniButton, GUILayout.Width(72f)))
{ {
ApplyAction("Activate Lerp Constraint", ActivateConstraint); ApplyAction("Activate Rough Constraint", ActivateConstraint);
} }
if (GUILayout.Button("Zero", EditorStyles.miniButton, GUILayout.Width(56f))) if (GUILayout.Button("Zero", EditorStyles.miniButton, GUILayout.Width(56f)))
@ -84,8 +84,8 @@ namespace Streamingle.Utils.LerpConstraintsEditor
serializedObject.ApplyModifiedProperties(); serializedObject.ApplyModifiedProperties();
foreach (var selectedTarget in targets) foreach (var selectedTarget in targets)
{ {
var constraint = (LerpConstraintBase)selectedTarget; var constraint = (RoughConstraintBase)selectedTarget;
Undo.RecordObject(constraint, "Change Lerp Constraint Lock"); Undo.RecordObject(constraint, "Change Rough Constraint Lock");
constraint.SetLocked(newValue); constraint.SetLocked(newValue);
EditorUtility.SetDirty(constraint); EditorUtility.SetDirty(constraint);
} }
@ -102,8 +102,8 @@ namespace Streamingle.Utils.LerpConstraintsEditor
private void DrawTypeSettings() private void DrawTypeSettings()
{ {
lerpFollowFoldout = EditorGUILayout.Foldout(lerpFollowFoldout, "Lerp Follow", true); roughFollowFoldout = EditorGUILayout.Foldout(roughFollowFoldout, "Rough Follow", true);
if (lerpFollowFoldout) if (roughFollowFoldout)
{ {
using (new EditorGUI.IndentLevelScope()) using (new EditorGUI.IndentLevelScope())
{ {
@ -128,27 +128,27 @@ namespace Streamingle.Utils.LerpConstraintsEditor
private void DrawTypeProperties() private void DrawTypeProperties()
{ {
if (target is LerpPositionConstraint) if (target is RoughPositionConstraint)
{ {
DrawProperties("constrainedAxis", "positionOffset", "offsetInSourceSpace"); DrawProperties("constrainedAxis", "positionOffset", "offsetInSourceSpace");
} }
else if (target is LerpRotationConstraint) else if (target is RoughRotationConstraint)
{ {
DrawProperties("constrainedAxis", "rotationOffset"); DrawProperties("constrainedAxis", "rotationOffset");
} }
else if (target is LerpScaleConstraint) else if (target is RoughScaleConstraint)
{ {
DrawProperties("constrainedAxis", "scaleOffset"); DrawProperties("constrainedAxis", "scaleOffset");
} }
else if (target is LerpParentConstraint) else if (target is RoughParentConstraint)
{ {
DrawProperties("constrainedPositionAxis", "positionOffset", "positionOffsetInSourceSpace", "constrainedRotationAxis", "rotationOffset"); DrawProperties("constrainedPositionAxis", "positionOffset", "positionOffsetInSourceSpace", "constrainedRotationAxis", "rotationOffset");
} }
else if (target is LerpAimConstraint) else if (target is RoughAimConstraint)
{ {
DrawProperties("aimAxis", "upAxis", "worldUpVector", "rotationOffset"); DrawProperties("aimAxis", "upAxis", "worldUpVector", "rotationOffset");
} }
else if (target is LerpLookAtConstraint) else if (target is RoughLookAtConstraint)
{ {
DrawProperties("forwardAxis", "worldUpVector", "targetPositionOffset", "rotationOffset"); DrawProperties("forwardAxis", "worldUpVector", "targetPositionOffset", "rotationOffset");
} }
@ -166,22 +166,22 @@ namespace Streamingle.Utils.LerpConstraintsEditor
} }
} }
private void ApplyAction(string undoName, System.Action<LerpConstraintBase> action) private void ApplyAction(string undoName, System.Action<RoughConstraintBase> action)
{ {
serializedObject.ApplyModifiedProperties(); serializedObject.ApplyModifiedProperties();
foreach (var selectedTarget in targets) foreach (var selectedTarget in targets)
{ {
var constraint = (LerpConstraintBase)selectedTarget; var constraint = (RoughConstraintBase)selectedTarget;
Undo.RecordObject(constraint.transform, undoName); Undo.RecordObject(constraint.transform, undoName);
action(constraint); action(constraint);
EditorUtility.SetDirty(constraint.transform); EditorUtility.SetDirty(constraint.transform);
} }
} }
private void ActivateConstraint(LerpConstraintBase constraint) private void ActivateConstraint(RoughConstraintBase constraint)
{ {
Undo.RecordObject(constraint, "Activate Lerp Constraint"); Undo.RecordObject(constraint, "Activate Rough Constraint");
constraint.ActivateConstraint(); constraint.ActivateConstraint();
EditorUtility.SetDirty(constraint); EditorUtility.SetDirty(constraint);
} }
@ -189,7 +189,7 @@ namespace Streamingle.Utils.LerpConstraintsEditor
private void ZeroOffsets() private void ZeroOffsets()
{ {
serializedObject.ApplyModifiedProperties(); serializedObject.ApplyModifiedProperties();
Undo.RecordObjects(targets, "Zero Lerp Constraint Offsets"); Undo.RecordObjects(targets, "Zero Rough Constraint Offsets");
SetVector3IfExists("positionOffset", Vector3.zero); SetVector3IfExists("positionOffset", Vector3.zero);
SetVector3IfExists("rotationOffset", Vector3.zero); SetVector3IfExists("rotationOffset", Vector3.zero);
@ -261,13 +261,13 @@ namespace Streamingle.Utils.LerpConstraintsEditor
private string GetSettingsTitle() private string GetSettingsTitle()
{ {
if (target is LerpLookAtConstraint) if (target is RoughLookAtConstraint)
{ {
return "Look At"; return "Look At";
} }
var name = target.GetType().Name; var name = target.GetType().Name;
name = name.Replace("Lerp", string.Empty).Replace("Constraint", string.Empty); name = name.Replace("Rough", string.Empty).Replace("Constraint", string.Empty);
return ObjectNames.NicifyVariableName(name); return ObjectNames.NicifyVariableName(name);
} }
} }

View File

@ -1,8 +1,8 @@
using Streamingle.Utils.LerpConstraints; using Streamingle.Utils.RoughConstraints;
using UnityEditor; using UnityEditor;
using UnityEngine; using UnityEngine;
namespace Streamingle.Utils.LerpConstraintsEditor namespace Streamingle.Utils.RoughConstraintsEditor
{ {
[CustomPropertyDrawer(typeof(Vector3Bool))] [CustomPropertyDrawer(typeof(Vector3Bool))]
public sealed class Vector3BoolDrawer : UnityEditor.PropertyDrawer public sealed class Vector3BoolDrawer : UnityEditor.PropertyDrawer

View File

@ -1,12 +1,10 @@
using UnityEngine; using UnityEngine;
using UnityEngine.Scripting.APIUpdating;
namespace Streamingle.Utils.LerpConstraints namespace Streamingle.Utils.RoughConstraints
{ {
[MovedFrom(true, "Streamingle.Utils.RoughConstraints", "Assembly-CSharp", "RoughAimConstraint")]
[ExecuteAlways] [ExecuteAlways]
[AddComponentMenu("Streamingle Utilities/Constraints/Lerp Aim Constraint")] [AddComponentMenu("Streamingle Utilities/Constraints/Rough Aim Constraint")]
public class LerpAimConstraint : LerpConstraintBase public class RoughAimConstraint : RoughConstraintBase
{ {
[Header("Aim")] [Header("Aim")]
public Vector3 aimAxis = Vector3.forward; public Vector3 aimAxis = Vector3.forward;

View File

@ -1,13 +1,12 @@
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using UnityEngine.Scripting.APIUpdating;
#if UNITY_EDITOR #if UNITY_EDITOR
using UnityEditor; using UnityEditor;
#endif #endif
namespace Streamingle.Utils.LerpConstraints namespace Streamingle.Utils.RoughConstraints
{ {
public enum LerpConstraintUpdateMode public enum RoughConstraintUpdateMode
{ {
Update, Update,
LateUpdate, LateUpdate,
@ -15,9 +14,8 @@ namespace Streamingle.Utils.LerpConstraints
Manual Manual
} }
[MovedFrom(true, "Streamingle.Utils.RoughConstraints", "Assembly-CSharp", "RoughConstraintBase")]
[ExecuteAlways] [ExecuteAlways]
public abstract class LerpConstraintBase : MonoBehaviour public abstract class RoughConstraintBase : MonoBehaviour
{ {
[Header("Constraint")] [Header("Constraint")]
public bool constraintActive = true; public bool constraintActive = true;
@ -26,13 +24,13 @@ namespace Streamingle.Utils.LerpConstraints
[Range(0f, 1f)] [Range(0f, 1f)]
public float weight = 1f; public float weight = 1f;
public List<LerpConstraintSource> sources = new List<LerpConstraintSource>(); public List<RoughConstraintSource> sources = new List<RoughConstraintSource>();
[Header("Lerp Follow")] [Header("Rough Follow")]
[Min(0f)] [Min(0f)]
public float damping = 12f; public float damping = 12f;
public LerpConstraintUpdateMode updateMode = LerpConstraintUpdateMode.LateUpdate; public RoughConstraintUpdateMode updateMode = RoughConstraintUpdateMode.LateUpdate;
public bool useUnscaledTime; public bool useUnscaledTime;
public bool snapOnEnable = true; public bool snapOnEnable = true;
@ -49,7 +47,7 @@ namespace Streamingle.Utils.LerpConstraints
return 1f / 60f; return 1f / 60f;
} }
if (updateMode == LerpConstraintUpdateMode.FixedUpdate) if (updateMode == RoughConstraintUpdateMode.FixedUpdate)
{ {
return useUnscaledTime ? Time.fixedUnscaledDeltaTime : Time.fixedDeltaTime; return useUnscaledTime ? Time.fixedUnscaledDeltaTime : Time.fixedDeltaTime;
} }
@ -96,7 +94,7 @@ namespace Streamingle.Utils.LerpConstraints
{ {
if (!Application.isPlaying) if (!Application.isPlaying)
{ {
if (updateMode != LerpConstraintUpdateMode.Manual) if (updateMode != RoughConstraintUpdateMode.Manual)
{ {
Evaluate(); Evaluate();
} }
@ -104,7 +102,7 @@ namespace Streamingle.Utils.LerpConstraints
return; return;
} }
if (updateMode == LerpConstraintUpdateMode.Update) if (updateMode == RoughConstraintUpdateMode.Update)
{ {
Evaluate(); Evaluate();
} }
@ -117,7 +115,7 @@ namespace Streamingle.Utils.LerpConstraints
return; return;
} }
if (updateMode == LerpConstraintUpdateMode.LateUpdate) if (updateMode == RoughConstraintUpdateMode.LateUpdate)
{ {
Evaluate(); Evaluate();
} }
@ -130,7 +128,7 @@ namespace Streamingle.Utils.LerpConstraints
return; return;
} }
if (updateMode == LerpConstraintUpdateMode.FixedUpdate) if (updateMode == RoughConstraintUpdateMode.FixedUpdate)
{ {
Evaluate(); Evaluate();
} }
@ -167,7 +165,7 @@ namespace Streamingle.Utils.LerpConstraints
return; return;
} }
if (Application.isPlaying || updateMode == LerpConstraintUpdateMode.Manual) if (Application.isPlaying || updateMode == RoughConstraintUpdateMode.Manual)
{ {
return; return;
} }

View File

@ -1,10 +1,10 @@
using System; using System;
using UnityEngine; using UnityEngine;
namespace Streamingle.Utils.LerpConstraints namespace Streamingle.Utils.RoughConstraints
{ {
[Serializable] [Serializable]
public struct LerpConstraintSource public struct RoughConstraintSource
{ {
public Transform sourceTransform; public Transform sourceTransform;

View File

@ -1,12 +1,10 @@
using UnityEngine; using UnityEngine;
using UnityEngine.Scripting.APIUpdating;
namespace Streamingle.Utils.LerpConstraints namespace Streamingle.Utils.RoughConstraints
{ {
[MovedFrom(true, "Streamingle.Utils.RoughConstraints", "Assembly-CSharp", "RoughLookAtConstraint")]
[ExecuteAlways] [ExecuteAlways]
[AddComponentMenu("Streamingle Utilities/Constraints/Lerp Look At Constraint")] [AddComponentMenu("Streamingle Utilities/Constraints/Rough Look At Constraint")]
public class LerpLookAtConstraint : LerpConstraintBase public class RoughLookAtConstraint : RoughConstraintBase
{ {
[Header("Look At")] [Header("Look At")]
public Vector3 forwardAxis = Vector3.forward; public Vector3 forwardAxis = Vector3.forward;

View File

@ -1,12 +1,10 @@
using UnityEngine; using UnityEngine;
using UnityEngine.Scripting.APIUpdating;
namespace Streamingle.Utils.LerpConstraints namespace Streamingle.Utils.RoughConstraints
{ {
[MovedFrom(true, "Streamingle.Utils.RoughConstraints", "Assembly-CSharp", "RoughParentConstraint")]
[ExecuteAlways] [ExecuteAlways]
[AddComponentMenu("Streamingle Utilities/Constraints/Lerp Parent Constraint")] [AddComponentMenu("Streamingle Utilities/Constraints/Rough Parent Constraint")]
public class LerpParentConstraint : LerpConstraintBase public class RoughParentConstraint : RoughConstraintBase
{ {
[Header("Position")] [Header("Position")]
public Vector3Bool constrainedPositionAxis = Vector3Bool.All; public Vector3Bool constrainedPositionAxis = Vector3Bool.All;

View File

@ -1,12 +1,10 @@
using UnityEngine; using UnityEngine;
using UnityEngine.Scripting.APIUpdating;
namespace Streamingle.Utils.LerpConstraints namespace Streamingle.Utils.RoughConstraints
{ {
[MovedFrom(true, "Streamingle.Utils.RoughConstraints", "Assembly-CSharp", "RoughPositionConstraint")]
[ExecuteAlways] [ExecuteAlways]
[AddComponentMenu("Streamingle Utilities/Constraints/Lerp Position Constraint")] [AddComponentMenu("Streamingle Utilities/Constraints/Rough Position Constraint")]
public class LerpPositionConstraint : LerpConstraintBase public class RoughPositionConstraint : RoughConstraintBase
{ {
[Header("Position")] [Header("Position")]
public Vector3Bool constrainedAxis = Vector3Bool.All; public Vector3Bool constrainedAxis = Vector3Bool.All;

View File

@ -1,12 +1,10 @@
using UnityEngine; using UnityEngine;
using UnityEngine.Scripting.APIUpdating;
namespace Streamingle.Utils.LerpConstraints namespace Streamingle.Utils.RoughConstraints
{ {
[MovedFrom(true, "Streamingle.Utils.RoughConstraints", "Assembly-CSharp", "RoughRotationConstraint")]
[ExecuteAlways] [ExecuteAlways]
[AddComponentMenu("Streamingle Utilities/Constraints/Lerp Rotation Constraint")] [AddComponentMenu("Streamingle Utilities/Constraints/Rough Rotation Constraint")]
public class LerpRotationConstraint : LerpConstraintBase public class RoughRotationConstraint : RoughConstraintBase
{ {
[Header("Rotation")] [Header("Rotation")]
public Vector3Bool constrainedAxis = Vector3Bool.All; public Vector3Bool constrainedAxis = Vector3Bool.All;

View File

@ -1,12 +1,10 @@
using UnityEngine; using UnityEngine;
using UnityEngine.Scripting.APIUpdating;
namespace Streamingle.Utils.LerpConstraints namespace Streamingle.Utils.RoughConstraints
{ {
[MovedFrom(true, "Streamingle.Utils.RoughConstraints", "Assembly-CSharp", "RoughScaleConstraint")]
[ExecuteAlways] [ExecuteAlways]
[AddComponentMenu("Streamingle Utilities/Constraints/Lerp Scale Constraint")] [AddComponentMenu("Streamingle Utilities/Constraints/Rough Scale Constraint")]
public class LerpScaleConstraint : LerpConstraintBase public class RoughScaleConstraint : RoughConstraintBase
{ {
[Header("Scale")] [Header("Scale")]
public Vector3Bool constrainedAxis = Vector3Bool.All; public Vector3Bool constrainedAxis = Vector3Bool.All;

View File

@ -1,6 +1,6 @@
using System; using System;
namespace Streamingle.Utils.LerpConstraints namespace Streamingle.Utils.RoughConstraints
{ {
[Serializable] [Serializable]
public struct Vector3Bool public struct Vector3Bool

View File

@ -1,7 +1,7 @@
{ {
"name": "com.streamingle.utilities", "name": "com.streamingle.utilities",
"displayName": "Streamingle Utilities", "displayName": "Streamingle Utilities",
"version": "0.1.22", "version": "0.1.7",
"unity": "6000.0", "unity": "6000.0",
"description": "Reusable Streamingle runtime components and Unity editor utilities.", "description": "Reusable Streamingle runtime components and Unity editor utilities.",
"keywords": [ "keywords": [