示例#1
0
        private static HatBehaviour CreateHat(string name)
        {
            System.Console.WriteLine($"Creating Hat {name}");
            var sprite = TownOfUs.CreateSprite($"TownOfUs.Resources.Hats.{name}.png", true);
            var newHat = ScriptableObject.CreateInstance <HatBehaviour>();

            newHat.MainImage = sprite;
            newHat.ProductId = name;
            newHat.Order     = -1;
            newHat.InFront   = true;
            newHat.NoBounce  = false;

            return(newHat);
        }
示例#2
0
        private static HatBehaviour CreateHat(HatData hat, int id)
        {
            System.Console.WriteLine($"Creating Hat {hat.name}");
            var sprite = TownOfUs.CreateSprite($"TownOfUs.Resources.Hats.hat_{hat.name}.png", true);
            var newHat = ScriptableObject.CreateInstance <HatBehaviour>();

            newHat.MainImage  = sprite;
            newHat.ProductId  = hat.name;
            newHat.Order      = 99 + id;
            newHat.InFront    = true;
            newHat.NoBounce   = !hat.bounce;
            newHat.ChipOffset = hat.offset;

            return(newHat);
        }