Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
using System.Collections.Generic; using System.Linq; using UnityEngine; using WallstopStudios.UnityHelpers.Tags; namespace MB6 { [CreateAssetMenu(menuName = "Wallstop Studios/Unity Helpers/Attribute Effect Registry")] public class EffectRegistry : ScriptableObject { [SerializeField] private List
_effects = new(); private Dictionary
_effectRegistry = new Dictionary
(); public void OnEnable() { _effectRegistry = _effects.ToDictionary(e=> e.name, e => e); } public void AddEffect(AttributeEffect effect) => _effects.Add(effect); public void RemoveEffect(string lookupName) => _effects.RemoveAll(x => x.name == lookupName); public AttributeEffect GetEffect(string lookupName) => _effectRegistry.TryGetValue(lookupName, out var effect) ? effect : null; public IEnumerable
GetEffects() => _effects; } }
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)