Archive for the ‘ Unity Editor ’ Category

SoundCanvas Introduction – Managing Audio in Unity5


During the production of our internal game project at DreamSocket, I started creating a tool to bridge the gap between the new audio Mixer technology in Unity5 and the audio clips themselves.  The mixer and snapshots features of Unity5 are brilliant for designing your sound in a scene – everything you could ever want to really bring the sound design of your game to life.

The problem is, and has been for along time with Unity, how to manage a scene’s audio clips?  These are clips that *have* to be added to an object or scene physically rather than programmatically.  I say *have* to, but that’s really not the case from a developers point of view.  We can add sound and design the sound programmatically to our hearts content.

The problem is, we’re the ONLY ones who can work with the sound in a scene at that point and a sound designer is essentially at our mercy to implement his work accurately.  And to be honest, doing sound design with a “listen/stop/adjust code/play/repeat” model isn’t going to probably yield the best results.  Being able to mix and manage at design time in the editor is by far a much better solution.

This is where SoundCanvas comes in.

SoundCanvas is not only an audio API for controlling your game’s sound, but a Unity editor extension that allows you (or anyone else on your team) to design your scene’s audio in a central, easy to use, interface.

Some of the features:

  • Easy to use API for controlling sound playback, use snapshots for transitions and globally manage your games audio
  • Assign single audio clips to multiple game objects using tags
  • Assign multiple audio clips to single or multiple game objects
  • An easy way to marry audio clips with mixer groups
  • Change the target of an audio clip by simply changing what tags it targets
  • Creates and manages it’s own enum file for easy of use with the sound API

Currently, SoundCanvas is in development, but our goal is to release it via the Unity Asset Store as a free Editor Extension.  So until then, we’d love to hear feedback and reaction to what we have so far.

Have a bandit day!

Showing camera view frustrum in Scene view

We’ve been working on a 2D game in Unity3D and I’d written this a while back to show the view frustrum of the camera in the scene view and had been meaning to post it:

Yellow wireframe outlines view frustrum. Top is scene view, bottom is game view

Create a new c# script in Unity and call it “DrawCameraViewFrustrum.cs”.  Copy/paste the code below and attach it to your camera object in your scene.

using UnityEngine;
using System.Collections;

public class DrawCameraViewFrustrum : MonoBehaviour
	public Color clr = new Color(0.1f, 0.14f, 0.8f, 0.5f);
	public void OnDrawGizmos()
		Gizmos.color = clr;
		Gizmos.DrawWireCube(transform.position, new Vector3((camera.orthographicSize*camera.aspect)*2, camera.orthographicSize*2, 10));