Skip to content

Commit

Permalink
Merge pull request #75 from Epicguru/develop
Browse files Browse the repository at this point in the history
Release 27
  • Loading branch information
Epicguru authored Aug 26, 2024
2 parents 6e9cc5e + 7b826fd commit f39eb76
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 20 deletions.
15 changes: 4 additions & 11 deletions Source/1.5/AnimationMod/AnimRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -426,10 +426,13 @@ private void InitSweepMeshes()
sweeps = new PartWithSweep[Data.SweepDataCount];
foreach (var part in Data.PartsWithSweepData)
{
var overrideData = GetOverride(part);
var paths = Data.GetSweepPaths(part);
foreach (var path in paths)
{
sweeps[j++] = new PartWithSweep(this, part, path, new SweepMesh<PartWithSweep.Data>(), BasicSweepProvider.DefaultInstance);
float upDst = overrideData?.TweakData?.BladeEnd ?? 0.4f;
float downDst = overrideData?.TweakData?.BladeStart ?? 0.05f;
sweeps[j++] = new PartWithSweep(this, part, path, new SweepMesh<PartWithSweep.Data>(), BasicSweepProvider.DefaultInstance, upDst, downDst);
}
}
}
Expand Down Expand Up @@ -1429,16 +1432,6 @@ public bool AddPawn(Pawn pawn, int index, bool register)
if (ov.CustomRenderer != null)
ov.CustomRenderer.Item = weapon;

InitSweepMeshes();
foreach (var path in sweeps)
{
if (path.Part == itemPart)
{
path.DownDst = tweak.BladeStart;
path.UpDst = tweak.BladeEnd;
}
}

return true;
}

Expand Down
4 changes: 2 additions & 2 deletions Source/1.5/AnimationMod/Sweep/BasicSweepProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ public class BasicSweepProvider : ISweepProvider

public Color color = Color.white;
public float length = 0.15f;
public float minVel = 1f;
public float maxVel = 2f;
public float minVel = 3.5f;
public float maxVel = 7f;

public (Color low, Color high) GetTrailColors(in SweepProviderArgs args)
{
Expand Down
10 changes: 6 additions & 4 deletions Source/1.5/AnimationMod/Sweep/PartWithSweep.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using AM.Data.Model;
using UnityEngine;

Expand All @@ -10,7 +10,7 @@ public class PartWithSweep
public readonly SweepPointCollection PointCollection;
public readonly SweepMesh<Data> Mesh;
public readonly AnimRenderer Renderer;
public float DownDst, UpDst;
public readonly float DownDst, UpDst;
public bool MirrorHorizontal;
public ISweepProvider ColorProvider;

Expand All @@ -25,14 +25,16 @@ public struct Data
public float UpVel;
}

public PartWithSweep(AnimRenderer renderer, AnimPartData part, SweepPointCollection pointCollection, SweepMesh<Data> mesh, ISweepProvider colorProvider)
public PartWithSweep(AnimRenderer renderer, AnimPartData part, SweepPointCollection pointCollection, SweepMesh<Data> mesh, ISweepProvider colorProvider, float upDst, float downDst)
{
Renderer = renderer;
Part = part;
PointCollection = pointCollection;
Mesh = mesh;
points = pointCollection.CloneWithVelocities(DownDst, UpDst);
ColorProvider = colorProvider;
UpDst = upDst;
DownDst = downDst;
points = pointCollection.CloneWithVelocities(DownDst, UpDst);
}

public void Draw(float time)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
"r": 0.0,
"g": 0.0,
"b": 0.0,
"a": 0.8306667
"a": 0.6977777
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,11 @@
"ScaleY": 1.1,
"BladeStart": 0.15659982,
"BladeEnd": 0.800895154,
"MeleeWeaponType": 6
"MeleeWeaponType": 6,
"TrailTint": {
"r": 0.966666639,
"g": 0.6717687,
"b": 0.0451110676,
"a": 0.98
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,11 @@
"ScaleY": 1.1,
"BladeStart": 0.15659982,
"BladeEnd": 0.800895154,
"MeleeWeaponType": 6
"MeleeWeaponType": 6,
"TrailTint": {
"r": 0.966666639,
"g": 0.6717687,
"b": 0.0451110676,
"a": 0.98
}
}

0 comments on commit f39eb76

Please sign in to comment.