12 第1页 | 共2 页下一页
返回列表 发新帖
查看: 2863|回复: 14
打印 上一主题 下一主题

A tileset selector (一)

[复制链接]

5552

主题

2

听众

8万

积分

首席设计师

Rank: 8Rank: 8

纳金币
-1
精华
11

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

跳转到指定楼层
楼主
发表于 2011-11-18 15:13:00 |只看该作者 |倒序浏览


           When building a sprite-based game, you often must take a tileset and find some way to split it into the hundred smaller sprites used in your game. If you're using Unity, a 3D game editor, then there is no easy way to do this. The task will take you so many hours with photoshop that you'll develop carpal tunnel syndrome and a burn-in of the ps UI.
         

           Lo, behold the Tile Selector, a system that takes a tileset and chops it up into bite-sized pieces that you specify, using a custom editor that makes the process easy. It even generates all the materials and textures you need, stores them discreetly, and applies them to your object as necessary.
         

           Usage
           

           The TileSet comprises three scripts. TileManagerEditor and TileSelectorEditor are Editor scripts and must be placed in the Editor folder of your project hierarchy. TileManager is the base script that kicks off the magic, and is a component attached to the sprite you want to texture.
         




           Step 1
           

           Create a GameObject (frequently a plane) and attach a material (frequently with a Transparent Cutout shader) to it. The GameObject must have a material and the TileManager (below) script attached to it, or the Tile Selector won't work.
         

           Step 2
           

           Attach this script to the GameObject:
         

           /*
           

                   Copyright 2010 CJ Currie
           

                   @Date: October 2010
           

                   @Contact:
           
            CJCurrie@BlackStormsStudios.com
           


                   @Script: A storage class for the tile selector.
           

                   @Connections:
           

                   @TODO:
           

           */
           

           using UnityEngine;
           

           using UnityEditor;
           

            
           

           public class TileManager : MonoBehaviour {  
           

            
           

             public int[] lastTile = new int[4];
           

                   public Texture currentTile = new Texture();
           

                   public string uniquePath = "";
           

                   public string uniqueID = "";
           

           }
           

           Note that this is a storage class. If you want to pull data from the custom editor, store it here.
         
分享到: QQ好友和群QQ好友和群 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
转播转播0 分享淘帖0 收藏收藏0 支持支持0 反对反对0
回复

使用道具 举报

tc    

5089

主题

1

听众

33万

积分

首席设计师

Rank: 8Rank: 8

纳金币
-1
精华
0

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

沙发
发表于 2012-3-5 23:23:03 |只看该作者
呵呵,很漂亮啊
回复

使用道具 举报

tc    

5089

主题

1

听众

33万

积分

首席设计师

Rank: 8Rank: 8

纳金币
-1
精华
0

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

板凳
发表于 2012-3-21 23:26:49 |只看该作者
我来顶个
回复

使用道具 举报

1023

主题

3

听众

359

积分

设计实习生

Rank: 2

纳金币
335582
精华
0

最佳新人

地板
发表于 2012-3-26 23:24:30 |只看该作者
呵呵,很漂亮啊
回复

使用道具 举报

5969

主题

1

听众

39万

积分

首席设计师

Rank: 8Rank: 8

纳金币
-1
精华
0

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

5#
发表于 2012-3-27 23:24:07 |只看该作者
提醒猪猪,千万不能让你看见
回复

使用道具 举报

tc    

5089

主题

1

听众

33万

积分

首席设计师

Rank: 8Rank: 8

纳金币
-1
精华
0

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

6#
发表于 2012-4-3 13:08:50 |只看该作者
你们都躲开,我来顶
回复

使用道具 举报

5969

主题

1

听众

39万

积分

首席设计师

Rank: 8Rank: 8

纳金币
-1
精华
0

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

7#
发表于 2012-4-16 23:21:55 |只看该作者
都闪开,介个帖子,偶来顶
回复

使用道具 举报

1023

主题

3

听众

359

积分

设计实习生

Rank: 2

纳金币
335582
精华
0

最佳新人

8#
发表于 2012-4-19 23:25:48 |只看该作者
发了那么多,我都不知道该用哪个给你回帖了,呵呵
回复

使用道具 举报

tc    

5089

主题

1

听众

33万

积分

首席设计师

Rank: 8Rank: 8

纳金币
-1
精华
0

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

9#
发表于 2012-4-27 23:22:36 |只看该作者
人过留名!
回复

使用道具 举报

   

671

主题

1

听众

3247

积分

中级设计师

Rank: 5Rank: 5

纳金币
324742
精华
0

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

10#
发表于 2012-5-10 23:18:51 |只看该作者
真是不错啊
回复

使用道具 举报

12 第1页 | 共2 页下一页
返回列表 发新帖
您需要登录后才可以回帖 登录 | 立即注册

手机版|纳金网 ( 闽ICP备2021016425号-2/3

GMT+8, 2025-7-20 02:35 , Processed in 0.117944 second(s), 29 queries .

Powered by Discuz!-创意设计 X2.5

© 2008-2019 Narkii Inc.

回顶部