예제 #1
0
        private Sprite GetZoneSprite(AZone zone, ZoneParams zoneParams)
        {
            var path    = ZONE_PATH + zone.Type.ToString();
            var sprites = Resources.LoadAll(path);
            var roll    = ListUtil <int> .GetRandomElement(zoneParams.Sprites);

            return(sprites[roll] as Sprite);
        }
예제 #2
0
 private ZoneData GetZoneData(AZone zone)
 {
     if (zone.GetType().Equals(typeof(AZone)))
     {
         return(new ZoneData());
     }
     else
     {
         return(null);
     }
 }
예제 #3
0
        public AZone Build(AZone zone)
        {
            var zoneParams = ZoneTable.Instance.Table[zone.Type];
            var data       = this.GetZoneData(zone);

            data.Handle = new GameObject();
            var renderer = data.Handle.AddComponent <SpriteRenderer>();

            renderer.sprite = this.GetZoneSprite(zone, zoneParams);
            return(zone);
        }