コード例 #1
0
        public static GameObject CreateTile(Logic.EProtalDirection direction, uint dst_lv, Logic.TilePosition dst_pos)
        {
            var obj = new GameObject(direction == Logic.EProtalDirection.Down ? "stair_down" : "stair_up");

            obj.layer = 1;

            var renderer = obj.AddComponent <SpriteRenderer>();

            renderer.sprite = GetSprite(direction);

            var tile = obj.AddComponent <EditorData.Tile>();

            tile.TileType = Logic.Tile.EType.Portal;
            tile.Properties["Direction"] = direction;
            tile.Properties["DestLevel"] = dst_lv;
            tile.Properties["DestPos"]   = dst_pos;

            return(obj);
        }
コード例 #2
0
 public static Sprite GetSprite(Logic.EProtalDirection direction)
 {
     return(SpriteSheetManager.Instance[direction == Logic.EProtalDirection.Down ? "stair_down" : "stair_up"]);
 }