Did you know your editor scripts can acquire a preview texture for an asset? Check out the members of the AssetPreview class.


My CBX.GridMapping tool for Unity has been accepted to the asset store! *Does the happy dance*  CBX.GridMapping is a in editor tool for unity that assists you in the creation of worlds that are based around a grid.

The current version of this tool does not contain a grid or tile mapping/management system. It is a in-editor creation tool only. A future update will include editor & runtime management API's.

*Temporary Homepage: http://www.createdbyx.com/page/CBXGridMapping.aspx
Google+ page: https://plus.google.com/100290581403134799105
Demonstration video: Getting started
Unity Forums Link: Unity Forums

Image tile sets are from Ari Feldman's SpriteLib (Common Public License) and are not included with this package.

The initial version that is on the asset store is a minimal v1.0 implementation. I am currently in the process of finalizing v1.2 features and documentation. v1.2 should be released some time in the first week of Jan 2013.

v1.2 features will include

  • Almost everything has a setting giving you the ability to customize how the tool looks and operates
  • Mouse wheel can be used to change layers
  • You can rotate the map object and draw v1.0 did not allow this.
  • Comes with mesh to code utility to convert simple meshes into C# code for procedural mesh generation
  • The quick prefab list is now categorized with a drop down menu
  • Many more prefab shapes both procedural and mesh based
  • 'Auto Center' drawing helper correctly takes into account a prefabs pivot point and positions a prefab centered to a grid cell
  • Will support multiple prefab definition files
  • Fully commented C# source code (xml documentation comments & inline code comments)
  • 95+% Of the code complies with the default StyleCop formatting settings.
  • All strings have been localized (English) with a custom built localization system

v1.0 and the up coming v1.2 are lacking certain features that are found in other popular tile mapping systems found on the asset store.

In time CBX.GridMapping will also include these list of features ...

  • A system to automatically change surrounding prefabs if certain conditions are met (Must take into account different prefab shapes)
  • A system to automatically change only the materials of surrounding prefabs if certain conditions are met
  • Formal API for developers to access and manipulate the map.
  • Ability to control where tools appear weather it be in scene view or in the inspector window
  • Integration with quick tools. A menu system I wrote that pops up a menu located around the mouse cursor.

I am also planning on making a few videos comparing UniTile, Tidy Tile Mapper, and CBX.GridMapping. The videos are intended to measure speed of the workflow for each tool and compare them when creating a specific map. This will help users decide for themselves if CBX.GridMapping is worth spending there monies on.

I have been keeping a list of about 60+ features that still need to be added to the CBX.GridMapping tool. Some are small some are large features so there is still a whole lot of work yet to do.

xDocs finally has a download

Published 12/31/2012 by createdbyx in News
Tags: ,

I created the xDocs page July 11, 2008 and I am only now realizing that I had never provided an actual download to the control.  I r phail saucie  QQ

Jebus I’m bad for doing that! I can’t believe how much stuff I have started on this site only to have it never completed.

if you have MonoBehavior code that you want to run while in the unity editor you can use the ExecuteInEditMode attribute and your mono behavior will run as though it was in play mode.

SEO's are the devils play things

Published 12/21/2012 by createdbyx in News
Tags: ,

Recently I sent my brother (who dabbles in SEO) a email about some numbers I was thinking about relating to my CBX.GridMapping project for Unity. I was trying to come up with very small very reasonable numbers that I thought would be possible to achieve. Below is a copy of how the conversation went.

I sent my brother this first email ...

The goal: To sell 2500 copies of CBX.GridMapping tools at $10 over the course of 5 years earning me an average $291 month in income.


1,000,000+ registered users as of april 2012
0.25% of the 1,000,000 users = 2500 users
2500 users times $10 = $25,000 in gross sales earnings
minus unity's take of 30% = $7,500 asset stores take
$25,000 - $7,500 = $17,500 in net earings

$17,500 by 60 months (5 year time span) = $291 a month

Given unity's rate growth and expansion into new markets this seems like an achieveable goal. The question is wether 0.25% of the registered
unity users are interested in my tool and if they are willing to spend $10 for it. $10 price point makes it the cheapest on the asset store
for paid tile/grid mapping tools. Other similar tools cost $25 to $50 & CBX.GridMapping will eventually contain a similar feature set. 

==== He responded with this email ... ====

You made a common mistake, based upon your calculations your assuming one million people are going to view your product (or 100% of unity members) and 0.25% or 25,000 of them are going to buy your product, you can aim for a 1% conversion rate on sales but if unity only has one million registered members your looking at the following calculation.

1,000,000 unity members
2% or 20,000 members see your product
1% or 200 members purchase your product
$10 x 200 = $2,000 sales
$2,000 - 30% unity take = $600
$600 unity take - $2,000 in sales = $1,400

If this is a five year goal your looking at $23.33/month over five years not $291/mo

Now a 2% view-count on your product with no advertising may even be a touch high, however with some advertising and promotion over the course of a few month's you can increase the view-count to more than 2%, in order to reach your goal at a 1% conversion rate you'll need a view-count of at least 20 - 25 percent.

But even more you have to take into account what is the approx unity population buying this specific type of product. For example if unity has 1 million registered shoppers and only 20,000 of them shop for this specific product your sales numbers will drop even more, even my calculations above leading to the $23.33/mo figure is assuming all 1 million members look at or purchase this type of product and that simple is not true.

This is probably why the others price there products at a higher price point because they know only a fraction of the total unity members are going to buy it.

So bottom line you need to think about it slightly differently, basically the break-down is this (For selling any product)

#1 - Determine size of market (Unity = 1,000,000 members)
#2 - Estimate what size of that market are interested in your product (In your case un-known but a slightly accurate estimation can be derived if the asset store show's how many sales a particular product has or a particular user has)
#3 - Of the estimated size of the market interested in your product, determine what percentage you can get to view your product (Click-Through-Rate [http://en.wikipedia.org/wiki/Click-through_rate] can be increased via advertising, ect.. no advertising means little visability)
#4 - Of the people who see your product how many will buy your product (Conversion Rate [http://en.wikipedia.org/wiki/Conversion_rate] - For amazing product can be as high as 5 or 10% for average product it sits around 2% for product from unknown brand sit's more around 1%)
#5 - Now that you know the percentage of users who buy your product after seeing it (#4 conversion rate), you can calculate how many estimated sales your expected to achieve.

Remember those five points and apply them to every product you'll ever sell in order to get an accurate number on the income you can achieve, the more information the more accurate your numbers become.

==== And my response to that was ... ====

your math is depressing    lulz :p

The DrawGizmo attribute allows you to setup your gizmo drawing code some place other then with your MonoBehavior class. The code below shows an example of the DrawGizmo attribute used on a method within a Editor class.

    /// <summary>
    /// Provides a editor for the <see cref="TileMap"/> component
    /// </summary>
    public class TileMapEditor : Editor
        /// The RenderMapGizmo method will be called if the map is selected. 
        [DrawGizmo(GizmoType.Selected | GizmoType.Active)]
        static void RenderMapGizmo(TileMap map, GizmoType gizmoType)
            // store map width, height and position
            var mapWidth = map.Columns * map.CellWidth;
            var mapHeight = map.Rows * map.CellHeight;
            var position = map.transform.position;
            var activelayerHeight = map.ActiveLayer * map.Depth;

            if (map.drawGridLines)
                // draw layer border
                Gizmos.color = Color.white;
                    position + new Vector3(0, activelayerHeight, 0), position + new Vector3(mapWidth, activelayerHeight, 0));
                    position + new Vector3(0, activelayerHeight, 0), position + new Vector3(0, activelayerHeight, mapHeight));
                    position + new Vector3(mapWidth, activelayerHeight, 0),
                    position + new Vector3(mapWidth, activelayerHeight, mapHeight));
                    position + new Vector3(0, activelayerHeight, mapHeight),
                    position + new Vector3(mapWidth, activelayerHeight, mapHeight));
                // more draw logic here

The alternative is that you can have a method in your MonoBehavior called OnDrawGizmosSelected

    /// <summary>
    /// Provides a component for tile mapping.
    /// </summary>
    public class TileMap : MonoBehaviour
        /// <summary>
        /// When the game object is selected this will draw the gizmos
        /// </summary>
        /// <remarks>Only called when in the Unity editor.</remarks>
        private void OnDrawGizmosSelected()
            // gizmo draw code goes here            

… But since gizmo drawing logic is typically for use within the unity editor the DrawGizmo attribute allows you to place the draw logic in a more appropriate location.

I have made a few minor changes to my Tile material Creation Window.

  • Provided a download link to the second release of the tool.
  • Added inset field to tweak the selection rectangle by a small amount to help clip off any unwanted pixels bleeding over from adjacent tiles.
  • Fixed a small bug where selection rectangles were not being drawn exactly where they should be

I have created a tool to assit in creating materials from tiles in a tile set. See the Tile Material Creation Window page for *.unitypackage download and more information.

If you have private fields that are wrapped with a public property but you want the value of those private fields to be saved with your scene you can use the SerializeField attribute.

Did you know with the release of Unity 4 MonoBehaviours can now be inside namespaces! Finally we can better organize our codez!

Created by: X

Just another personal website in this crazy online world

Name of author Dean Lunz (aka Created by: X)
Computer programming nerd, and tech geek.
About Me -- Resume