示例#1
0
        private void BuffDisplay_UpdateLayout(On.RoR2.UI.BuffDisplay.orig_UpdateLayout orig, BuffDisplay self)
        {
            orig(self);
            if (self.source)
            {
                var bufficons = self.GetComponent <bufficons>();
                if (bufficons == null)
                {
                    List <BuffIcon> listbufficons = (List <BuffIcon>)icons.GetValue(self);
                    bufficons            = self.gameObject.AddComponent <bufficons>();
                    bufficons.buffIcons  = listbufficons;
                    bufficons.timedbuffs = (IList)buffs.GetValue(self.source);
                }

                checkBuffs(self, bufficons);
            }
        }
        private void BuffDisplay_UpdateLayout(On.RoR2.UI.BuffDisplay.orig_UpdateLayout orig, BuffDisplay self)
        {
            orig(self);
            //checks if it has a body, should fix ice elites
            if (self.source)
            {
                //using a component to keep track of the lists
                var bufficons = self.GetComponent <bufficons>();
                if (bufficons == null)
                {
                    List <BuffIcon> listbufficons = (List <BuffIcon>)icons.GetValue(self);
                    bufficons            = self.gameObject.AddComponent <bufficons>();
                    bufficons.buffIcons  = listbufficons;
                    bufficons.timedbuffs = (IList)buffs.GetValue(self.source);
                }

                checkBuffs(self, bufficons);
            }
        }