添加插件

This commit is contained in:
2025-11-10 00:08:26 +08:00
parent 4059c207c0
commit 76f80db694
2814 changed files with 436400 additions and 178 deletions

View File

@@ -0,0 +1,33 @@
using UnityEngine;
namespace Obvious.Soap.Example
{
[CreateAssetMenu(fileName = "SoapGameParams", menuName = "Soap/Examples/ScriptableSingleton/SoapGameParams")]
public class SoapGameParams : ScriptableSingleton<SoapGameParams>
{
//You can add any Soap SO here to manipulate the game parameters
//They are also accessible from the Soap wizard, but sometimes it's convenient
//to have them in a single place for easy access
public FloatVariable PlayerHealth;
public ScriptableEventNoParam ReloadSceneEvent;
[Range(0, 100)] public int CoinSpawnedAmount = 10;
[Range(0, 1000)] public int CoinRotateSpeed = 200;
public bool RandomPlayerColorMode = false;
//You can add useful methods here to manipulate the game parameters
[ContextMenu("Heal Player")]
public void HealPlayer()
{
PlayerHealth.Value += 10;
Debug.Log("Player healed. Current health: " + PlayerHealth.Value);
}
[ContextMenu("Damage Player")]
public void DamagePlayer()
{
PlayerHealth.Value -= 10;
Debug.Log("Player took damage. Current health: " + PlayerHealth.Value);
}
}
}