private static void BuffPlus(Sprite image) { BuffDisplayAPI.Buff buff = new BuffDisplayAPI.Buff { sprite = image, type = typeof(Counting) }; BuffDisplayAPI.CustomBuffs.Add(buff); }
private static void BuffPlus(Sprite image) { //var buffType = typeof(BuffDisplayAPI.Buff)?.Assembly?.GetType("BuffPlus.Buff", true); //object instance = Activator.CreateInstance(buffType); //buffType.GetField("sprite").SetValue(instance, image); //buffType.GetField("type").SetValue(instance, typeof(Counting)); //var list = typeof(BuffDisplayAPI.Buff)?.Assembly?.GetType("BuffDisplayAPI.CustomBuffDisplay", true)?.GetField("buffs").GetValue(null); //((IList)list).Add(instance); BuffDisplayAPI.Buff buff = new BuffDisplayAPI.Buff { sprite = image, type = typeof(Counting) }; BuffDisplayAPI.CustomBuffs.Add(buff); }