Skip to content

Commit

Permalink
Merge pull request #175 from Wet-Boys/Sigma-Male-Branch
Browse files Browse the repository at this point in the history
fix for mode replacement fixes #174
  • Loading branch information
ToastedOven authored May 10, 2024
2 parents 3305537 + 810a1c7 commit 7ea6b25
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 13 deletions.
40 changes: 28 additions & 12 deletions CustomEmotesAPI/Core/BoneMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1398,20 +1398,36 @@ public void LockCameraStuff(bool thirdPersonLock)
if (Settings.rootMotionType.Value != RootMotionType.None &&
(currentClip.lockType == AnimationClipParams.LockType.rootMotion || Settings.rootMotionType.Value == RootMotionType.All || currentClip.lockType == AnimationClipParams.LockType.lockHead))
{
foreach (var item in cameraConstraints)
{
item.ActivateConstraints();
}
StartCoroutine(ActivateCameraConstraintsAfterFrame(false));
}
else if (currentClip.lockType == AnimationClipParams.LockType.headBobbing && Settings.rootMotionType.Value != RootMotionType.None)
{
foreach (var item in cameraConstraints)
StartCoroutine(ActivateCameraConstraintsAfterFrame(true));
}
}
}
IEnumerator ActivateCameraConstraintsAfterFrame(bool onlyY)
{
yield return new WaitForEndOfFrame();
foreach (var item in cameraConstraints)
{
item.enabled = true;
item.ActivateConstraints();
if (onlyY && item != cameraConstraints[cameraConstraints.Count - 1])
{
item.onlyY = true; //activateconstraints turns this off automatically so make sure to do this after we turn them on
}
}
yield return new WaitForEndOfFrame();
foreach (var item in cameraConstraints)
{
if (!item.enabled)
{
item.enabled = true;
item.ActivateConstraints();
if (onlyY && item != cameraConstraints[cameraConstraints.Count - 1])
{
item.ActivateConstraints();
if (item != cameraConstraints[cameraConstraints.Count - 1])
{
item.onlyY = true; //activateconstraints turns this off automatically so make sure to do this after we turn them on
}
item.onlyY = true; //activateconstraints turns this off automatically so make sure to do this after we turn them on
}
}
}
Expand All @@ -1435,7 +1451,7 @@ public void TurnOnThirdPerson()
needToTurnOffShadows = false;
}
playerController.thisPlayerModel.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.On;
//playerController.thisPlayerModelArms.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.ShadowsOnly;
playerController.thisPlayerModelArms.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.ShadowsOnly;
if (originalLayer == -1)
{
originalLayer = playerController.thisPlayerModel.gameObject.layer;
Expand Down Expand Up @@ -1481,7 +1497,7 @@ public void DeThirdPerson()
playerController.thisPlayerModel.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.ShadowsOnly;
}
needToTurnOffShadows = true;
//playerController.thisPlayerModelArms.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.On;
playerController.thisPlayerModelArms.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off;
playerController.localVisor.gameObject.SetActive(true);
playerController.thisPlayerModel.gameObject.layer = originalLayer;
playerController.grabDistance = 3f;
Expand Down
2 changes: 1 addition & 1 deletion CustomEmotesAPI/CustomEmotesAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class CustomEmotesAPI : BaseUnityPlugin

public const string PluginName = "Custom Emotes API";

public const string VERSION = "1.12.2";
public const string VERSION = "1.12.3";
public struct NameTokenWithSprite
{
public string nameToken;
Expand Down

0 comments on commit 7ea6b25

Please # to comment.