Skip navigation

Combo boxes

Combo boxes: Advanced Unity 3D Game Programming
Combo boxes: Advanced Unity 3D Game Programming

Join for an in-depth discussion in this video Combo boxes, part of Advanced Unity 3D Game Programming.

Resume Transcript Auto-Scroll
Skill Level Advanced
3h 45m
Duration
177,078
Views
Show More Show Less

Q: In the Chapter 3 file EntityLoader.cs, I get an error: DirectoryNotFoundException: Directory 'Assets\' not found. Removing the backslash after 'Assets' fixes it, but then I run into a different error. How do I fix this?
 

A: Some operating systems (like Mac OS X) use different directory separator characters. To make the code more compatible with different OSs, use ` Path.DirectorySeparatorChar` instead of `\` in all instances in this code. The replacements result in the following code:
 
string dataFolder = @"Assets" + Path.DirectorySeparatorChar;
Dictionary<string, CustomPrefab> prefabs = new Dictionary<string,
CustomPrefab>();
// Use this for initializationvoid Start () {
foreach(string dataFile in Directory.GetFiles(dataFolder, "*.data",
SearchOption.AllDirectories)) {
string[] lines = File.ReadAllLines(dataFile);
string name =
dataFile.Substring(dataFile.LastIndexOf(Path.DirectorySeparatorChar)+1,
dataFile.LastIndexOf(".") -
(dataFile.LastIndexOf(Path.DirectorySeparatorChar)+1));
prefabs.Add(name, new CustomPrefab(name, lines));
}}

Q: What version of Unity does this course cover?

A:  This course requires Unity 4.5.5. The newer versions of Unity have done away with the GUI system used in this course, so the interfaces included for many of the scenes will not work with 4.6 and higher. You can download Unity 4.5.5 at http://unity3d.com/get-unity/download/archive.

Q: The game object in the first chapter's Mouse Input Raycasting sample doesn't appear to follow the mouse. What's wrong?

A: Please enable the Box Collider component (by activating the checkbox next to the component name) on the game object. This is not explicitly mentioned in the video, but it will ensure the raycasts collide with the game object.

Skills covered in this course
3D + Animation Developer Games Game Development Unity

Continue Assessment

You started this assessment previously and didn't complete it. You can pick up where you left off, or start over.

Start Your Free Trial Now

Start your free trial now, and begin learning software, business and creative skills—anytime, anywhere—with video instruction from recognized industry experts.

Start Your Free Trial Now