com.wallstop-studios.unity-helpers 2.0.0-rc75.1 → 2.0.0-rc75.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -711,48 +711,6 @@
|
|
|
711
711
|
Repaint();
|
|
712
712
|
}
|
|
713
713
|
|
|
714
|
-
private static string GetRelativeAssetPath(string fullPath)
|
|
715
|
-
{
|
|
716
|
-
if (string.IsNullOrWhiteSpace(fullPath))
|
|
717
|
-
{
|
|
718
|
-
return null;
|
|
719
|
-
}
|
|
720
|
-
|
|
721
|
-
fullPath = fullPath.SanitizePath();
|
|
722
|
-
if (
|
|
723
|
-
fullPath.EndsWith("/Assets", StringComparison.OrdinalIgnoreCase)
|
|
724
|
-
&& Path.GetFileName(fullPath).Equals("Assets", StringComparison.OrdinalIgnoreCase)
|
|
725
|
-
)
|
|
726
|
-
{
|
|
727
|
-
return "Assets";
|
|
728
|
-
}
|
|
729
|
-
|
|
730
|
-
string assetsPath = Application.dataPath.SanitizePath();
|
|
731
|
-
if (fullPath.StartsWith(assetsPath, StringComparison.OrdinalIgnoreCase))
|
|
732
|
-
{
|
|
733
|
-
if (fullPath.Length == assetsPath.Length)
|
|
734
|
-
{
|
|
735
|
-
return "Assets";
|
|
736
|
-
}
|
|
737
|
-
|
|
738
|
-
int startIndex = assetsPath.Length;
|
|
739
|
-
if (fullPath.Length > startIndex && fullPath[startIndex] == '/')
|
|
740
|
-
{
|
|
741
|
-
startIndex++;
|
|
742
|
-
}
|
|
743
|
-
|
|
744
|
-
return "Assets/" + fullPath.Substring(startIndex);
|
|
745
|
-
}
|
|
746
|
-
|
|
747
|
-
int assetIndex = fullPath.IndexOf("/Assets/", StringComparison.OrdinalIgnoreCase);
|
|
748
|
-
if (assetIndex >= 0)
|
|
749
|
-
{
|
|
750
|
-
return fullPath.Substring(assetIndex + 1);
|
|
751
|
-
}
|
|
752
|
-
|
|
753
|
-
return null;
|
|
754
|
-
}
|
|
755
|
-
|
|
756
714
|
private static string GetFullPathFromRelative(string relativePath)
|
|
757
715
|
{
|
|
758
716
|
if (string.IsNullOrWhiteSpace(relativePath))
|
|
@@ -804,10 +762,10 @@
|
|
|
804
762
|
{
|
|
805
763
|
try
|
|
806
764
|
{
|
|
807
|
-
using
|
|
765
|
+
using SHA256 hashProvider = SHA256.Create();
|
|
808
766
|
using FileStream stream = File.OpenRead(filePath);
|
|
809
|
-
byte[]
|
|
810
|
-
return BitConverter.ToString(
|
|
767
|
+
byte[] hash = hashProvider.ComputeHash(stream);
|
|
768
|
+
return BitConverter.ToString(hash).Replace("-", "").ToLowerInvariant();
|
|
811
769
|
}
|
|
812
770
|
catch (IOException ioEx)
|
|
813
771
|
{
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
[Serializable]
|
|
17
17
|
public sealed class AnimationData
|
|
18
18
|
{
|
|
19
|
-
public const
|
|
19
|
+
public const float DefaultFramesPerSecond = 12;
|
|
20
20
|
|
|
21
21
|
public List<Sprite> frames = new();
|
|
22
|
-
public
|
|
22
|
+
public float framesPerSecond = DefaultFramesPerSecond;
|
|
23
23
|
public string animationName = string.Empty;
|
|
24
24
|
public bool isCreatedFromAutoParse;
|
|
25
25
|
public bool loop;
|
|
@@ -457,7 +457,7 @@
|
|
|
457
457
|
(float)currentAnimationIndex / totalAnimations
|
|
458
458
|
);
|
|
459
459
|
|
|
460
|
-
|
|
460
|
+
float framesPerSecond = data.framesPerSecond;
|
|
461
461
|
if (framesPerSecond <= 0)
|
|
462
462
|
{
|
|
463
463
|
this.LogWarn(
|
package/package.json
CHANGED