diff options
| author | chai <215380520@qq.com> | 2023-10-27 11:05:14 +0800 | 
|---|---|---|
| committer | chai <215380520@qq.com> | 2023-10-27 11:05:14 +0800 | 
| commit | 766cdff5ffa72b65d7f106658d1603f47739b2ba (patch) | |
| tree | 34d7799a94dfa9be182825577583c0fa6dc935f7 /GameCode/PlayerAudioModifyers.cs | |
+ init
Diffstat (limited to 'GameCode/PlayerAudioModifyers.cs')
| -rw-r--r-- | GameCode/PlayerAudioModifyers.cs | 50 | 
1 files changed, 50 insertions, 0 deletions
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<AudioModifyer> modifyers = new List<AudioModifyer>(); + +	public static List<CardAudioModifier> activeModifyer = new List<CardAudioModifier>(); + +	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; +		} +	} +}  | 
