Initial Commit
This commit is contained in:
34
Behaviour.cs
Normal file
34
Behaviour.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
|
||||
using BepInEx.Unity.IL2CPP.UnityEngine;
|
||||
using MyBox;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AutoPriceUpdater;
|
||||
public class Behaviour : MonoBehaviour
|
||||
{
|
||||
private static bool Once = false;
|
||||
private void Start()
|
||||
{
|
||||
Plugin.Log.LogInfo("AutoPriceUpdater Behaviour started.");
|
||||
int num = Singleton<IDManager>.Instance.Products.Count - Singleton<SaveManager>.Instance.Price.PricesSetByPlayer.Count;
|
||||
if (num > 0)
|
||||
{
|
||||
Plugin.Log.LogWarning($"There are {num} products without player-set prices. Updating prices...");
|
||||
Plugin.SetMissingPrices();
|
||||
}
|
||||
Plugin.UpdatePrice();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if(Input.GetKeyInt(Plugin.UpdateKey.Value) && !Once)
|
||||
{
|
||||
Plugin.UpdatePrice();
|
||||
Once = true;
|
||||
}
|
||||
else if(!Input.GetKeyInt(Plugin.UpdateKey.Value) && Once)
|
||||
{
|
||||
Once = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user