Category Archives: Unity

Procedural BarChart Substance Material

Hey,

today we submitted a new asset for the Unity asset store. We’ve been using Substance Designer for quite a while now and are happy to announce the publication of a nice material we’ve been using internally for some project.

You can check out the video on YouTube or Vimeo!

Basically, we wanted to display a bar chart inside the 3D world without building the chart elements out of game objects. This is where the procedural materials are very useful. We created a substance that does allow for lots of tweaking.

Here are some screenshots of the game window:

Screenshot 1

Screenshot 2

For example you can display up to 8 bars, change the width and some other visual settings. You can edit the texture inside the editor to generate just what you need, or you can change the texture via script to adjust values, colors, and any other property. You can even use a GUI texture to display charts on your HUD and update it, e.g. for a simple health bar.

Here is a screenshot to show you the tweaks:

Screenshot

To make it actually useful, we added some example scenes to get you started, in case you are not already fully familiar with using substances inside Unity. Here is an example script that does change all values randomly:


///-----------------------
/// Sample script to set the bar values randomly
/// ----------------------
using UnityEngine;
using System.Collections;

public class RandomBars : MonoBehaviour
{
public ProceduralMaterial bar; // reference to the bar chart substance

void OnMouseDown() // this is called when the object is clicked (here the display)
{
for (int i = 1; i < 9; i++)
bar.SetProceduralFloat("Val" + i, Random.Range(0.1f, 0.9f)); // set all values to some random value

bar.RebuildTextures(); // update the procedural material
}
}

Happy charting!

Editor Plugin DisableScript

You probably already did ask yourself this question: Why can’t I disable editor scripts? Well, there’s the simple solution. We decided to publish our little tool to disable any Unity script right from inside the editor. Just select the script in the project view, right click, and select disable script. Can’t get any easier.

DisableScript

You can find the tool very soon in the asset store.
Happy scripting!

Editor Plugin UGroup

We decided to publish a little editor tool to simplify grouping of objects inside the hierarchy. It does create an empty game object and places all the selected objects inside. You can also ungroup the items again. The tool uses the standard shortcuts for grouping (Ctrl+Shift+G for PCs or Command+Shift+G on a Mac) and ungrouping (Ctrl+Shift+H for PCs and Command+Shift+H on a Mac).

Check out our video for a little demonstration:


 

You can find the tool in the asset store.
Happy grouping!

Edit:

A tiny update for requested features has been posted today (5/8/12) in the asset store…
Version 1.2:
– Changed the group wizzard into an editor window
– Replaced the tag option with a tag drop down menu
– Added option to center the group relative to the selected objects
– After grouping automatically select the group object