From 766cdff5ffa72b65d7f106658d1603f47739b2ba Mon Sep 17 00:00:00 2001 From: chai <215380520@qq.com> Date: Fri, 27 Oct 2023 11:05:14 +0800 Subject: + init --- GameCode/PlayerAudioModifyers.cs | 50 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 GameCode/PlayerAudioModifyers.cs (limited to 'GameCode/PlayerAudioModifyers.cs') diff --git a/GameCode/PlayerAudioModifyers.cs b/GameCode/PlayerAudioModifyers.cs new file mode 100644 index 0000000..7f82b58 --- /dev/null +++ b/GameCode/PlayerAudioModifyers.cs @@ -0,0 +1,50 @@ +using System.Collections.Generic; +using UnityEngine; + +public class PlayerAudioModifyers : MonoBehaviour +{ + public List modifyers = new List(); + + public static List activeModifyer = new List(); + + public void AddToStack(CardAudioModifier mod) + { + int num = -1; + for (int i = 0; i < modifyers.Count; i++) + { + if (modifyers[i].modifier.stackName == mod.stackName) + { + num = i; + break; + } + } + if (num != -1) + { + modifyers[num].stacks++; + return; + } + AudioModifyer audioModifyer = new AudioModifyer(); + audioModifyer.modifier = new CardAudioModifier(); + audioModifyer.modifier.stackName = mod.stackName; + audioModifyer.modifier.stackType = mod.stackType; + audioModifyer.stacks = 1; + activeModifyer.Add(audioModifyer.modifier); + modifyers.Add(audioModifyer); + } + + public void SetStacks() + { + for (int i = 0; i < activeModifyer.Count; i++) + { + _ = activeModifyer[i].stackType; + _ = 1; + _ = activeModifyer[i].stackType; + } + for (int j = 0; j < modifyers.Count; j++) + { + _ = modifyers[j].modifier.stackType; + _ = 1; + _ = modifyers[j].modifier.stackType; + } + } +} -- cgit v1.1-26-g67d0