Exemplo n.º 1
0
        public CursorSequence(SpriteLoader loader, string cursorSrc, string palette, MiniYaml info)
        {
            sprites = loader.LoadAllSprites(cursorSrc);
            var d = info.ToDictionary();

            start        = Exts.ParseIntegerInvariant(d["start"].Value);
            this.palette = palette;

            if ((d.ContainsKey("length") && d["length"].Value == "*") || (d.ContainsKey("end") && d["end"].Value == "*"))
            {
                length = sprites.Length - start;
            }
            else if (d.ContainsKey("length"))
            {
                length = Exts.ParseIntegerInvariant(d["length"].Value);
            }
            else if (d.ContainsKey("end"))
            {
                length = Exts.ParseIntegerInvariant(d["end"].Value) - start;
            }
            else
            {
                length = 1;
            }

            if (d.ContainsKey("x"))
            {
                Exts.TryParseIntegerInvariant(d["x"].Value, out Hotspot.X);
            }
            if (d.ContainsKey("y"))
            {
                Exts.TryParseIntegerInvariant(d["y"].Value, out Hotspot.Y);
            }
        }
Exemplo n.º 2
0
		public CursorSequence(SpriteLoader loader, string cursorSrc, string palette, MiniYaml info)
		{
			sprites = loader.LoadAllSprites(cursorSrc);
			var d = info.ToDictionary();

			start = Exts.ParseIntegerInvariant(d["start"].Value);
			this.palette = palette;

			if ((d.ContainsKey("length") && d["length"].Value == "*") || (d.ContainsKey("end") && d["end"].Value == "*"))
				length = sprites.Length - start;
			else if (d.ContainsKey("length"))
				length = Exts.ParseIntegerInvariant(d["length"].Value);
			else if (d.ContainsKey("end"))
				length = Exts.ParseIntegerInvariant(d["end"].Value) - start;
			else
				length = 1;

			if (d.ContainsKey("x"))
				Exts.TryParseIntegerInvariant(d["x"].Value, out Hotspot.X);
			if (d.ContainsKey("y"))
				Exts.TryParseIntegerInvariant(d["y"].Value, out Hotspot.Y);
		}
Exemplo n.º 3
0
 void Awake()
 {
     SpriteLoader.LoadAllSprites("OtherSprites");
     SpriteLoader.LoadAllSprites("WeaponSprite");
     SpriteLoader.LoadAllSprites("WeaponSpriteIc");
 }