-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add animation, sound effects, and tooltip for ammo checking
- Loading branch information
Showing
6 changed files
with
100 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
# 1.1.0 | ||
|
||
- Added actual animation and sfx instead hacky workaround | ||
- Added tooltip for checking ammo | ||
- Fixed bug with interaction with buttons and doors | ||
|
||
# 1.0.0 | ||
|
||
Initial release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,45 @@ | ||
using System.Reflection; | ||
using BepInEx; | ||
using BepInEx.Logging; | ||
using HarmonyLib; | ||
using UnityEngine; | ||
using UnityEngine.Assertions; | ||
|
||
namespace LCAmmoCheck | ||
{ | ||
[BepInPlugin(GeneratedPluginInfo.Identifier, GeneratedPluginInfo.Name, GeneratedPluginInfo.Version)] | ||
public class LCAmmoCheckPlugin : BaseUnityPlugin | ||
{ | ||
public static LCAmmoCheckPlugin? Instance { get; private set; } | ||
private static Harmony? harmony; | ||
public static LCAmmoCheckPlugin? Instance { get; private set; } | ||
public static AnimationClip? ShotgunInspectClip { get; private set; } | ||
public static AudioClip? ShotgunInspectSFX { get; private set; } | ||
|
||
private static void LoadAssetBundle() | ||
{ | ||
Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("LCAmmoCheck.lcammocheck"); | ||
AssetBundle ACAssetBundle = AssetBundle.LoadFromStream(stream); | ||
ShotgunInspectClip = ACAssetBundle.LoadAsset<AnimationClip>("Assets/AnimationClip/ShotgunInspect.anim"); | ||
Assert.IsNotNull(ShotgunInspectClip); | ||
ShotgunInspectSFX = ACAssetBundle.LoadAsset<AudioClip>("Assets/AudioClip/ShotgunInspect.ogg"); | ||
Assert.IsNotNull(ShotgunInspectSFX); | ||
ShotgunInspectSFX?.LoadAudioData(); | ||
ACAssetBundle.Unload(false); | ||
} | ||
|
||
|
||
#pragma warning disable IDE0051 | ||
private void Awake() | ||
public void Awake() | ||
{ | ||
Instance = this; | ||
LoadAssetBundle(); | ||
harmony = Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), GeneratedPluginInfo.Identifier); | ||
Logger.Log(LogLevel.Message, "LCAmmoCheck loaded!"); | ||
} | ||
|
||
static private void OnDestroy() | ||
public static void OnDestroy() | ||
{ | ||
Instance = null; | ||
harmony?.UnpatchSelf(); | ||
Instance = null; | ||
harmony = null; | ||
Debug.Log("LCAmmoCheck unloaded!"); | ||
} | ||
#pragma warning restore IDE0051 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters