Unity Community


Showing Results 1 to 25 of 500 results for Type: Posts; User: tonyd
Search took 0.19 seconds.

Page 1 of 20 1 2 3 4

Results  

Scrolling inventory

Or you could do it the easy way, and just use GUILayout and BeginScrollView:

http://docs.unity3d.com/Documentation/ScriptReference/GUILayout.html

12:31 PM
Why did you pick unity over any other game engine?

I picked Unity because it supported multiple programming languages, was multi-platform, and had a powerful built-in GUI system.



One of my few complaints with Unity is that they never released...

06:56 AM
Component oriented programming and Unity

Yes, get rid of the monobehaviour inheritance. You don't need it unless your script gets attached to an object, or unless you need to call Monobehaviour functions.

Then in your main script, create...

06:11 AM
Unity NGUI

As simple as your GUI is, there is really no reason not to use the built-in GUI system in Unity.

http://docs.unity3d.com/Documentation/Components/GUIScriptingGuide.html
...

06:53 AM
[UNITYSCRIPT] Formatting an XML Doc and Reading in data to a 2D Array?

You can use System.IO for this sort of thing:

http://msdn.microsoft.com/en-us/library/system.io.aspx

But the easiest way is probably a Text Asset:


var asset : TextAsset;
var myArray = new...

04:50 AM
I've created a set of Boo tutorials.

Looks great, you might want to post this info in the Boo Scripting thread:

http://forum.unity3d.com/threads/72458-Official-Boo-Scripting-Resource-Thread

04:44 AM
File Handling in unity

Easiest method is to use PlayerPrefs:

http://docs.unity3d.com/Documentation/ScriptReference/PlayerPrefs.html

But you can also use System.IO:
...

04:30 AM
Identify selected variable from array

Your array contains Objects, not variables, but if you just want the name of the object, you can get that via the name property (yourObject.name).

See the example below. And note that JavaScript...

06:32 AM
Help with GUILayout (c#)

Here is an example of how to use GUILayout and tooltips (you'll need to assign your inventory text and tips in the inspector):


using UnityEngine;
using System.Collections;

public class...

06:14 AM
Problem with a simple Script

In a perfect world, everyone would search Unity Answers (as well as the Unity Script Reference) before posting, but this forum is still the quickest way to get answers to scripting questions.

09:05 AM
objects derive from monobehaviour is equal

Seems to work fine to me. Boo test below.


import UnityEngine

class MakeObjects (MonoBehaviour):
def Start():
person = gameObject.AddComponent(Person)
animal =...

06:20 AM
Problem with a simple Script

That actually wasn't aimed at you ;), but I do suggest reading the FAQ.

If you are new to scripting, you might want to visit this link:
...

06:12 AM
Problem with a simple Script

And I suggest you read the scripting forum FAQ:



There is nothing wrong with asking scripting questions in the scripting forum

05:56 AM
ScrollView problem, Please help.

There are plenty of people using the built-in GUI. Why?

Because it's easy to use; you can't get much easier than this:


if GUILayout.Button("Show Menu"): displayMenu = true

It's...

05:48 AM
Prevent an editor-assigned texture from loading into memory, load it on-demand later?

Put your textures in a folder called 'Resources', and then use Resources.Load to load them when needed.

http://docs.unity3d.com/Documentation/ScriptReference/Resources.html

11:07 AM
move object with slide

Try the following code. You'll need to attach it to the object you want to move.

If you wish to keep the object on-screen, you'll need to tweak the min and max values, or use some other method.
...

09:42 AM
Preventing use class variables

http://docs.unity3d.com/Documentation/ScriptReference/index.Accessing_Other_Game_Objects.html

http://answers.unity3d.com/questions/50466/get-variables-from-other-scripts.html

07:20 AM
True or False Bug?

You're trying to access CarStats_Player in line 52 when the name of your script is Car_Stats_Player.

06:45 AM
Codes broken after conversion from c# to javascript

You should be getting a whole bunch of errors in the console... you just need to fix them all.

You should start by removing the first pair of leading and trailing braces, as you don't need those....

08:34 AM
Alot of txt files

Yes, but you'd have to specify the path.


string folderName = "folder1/";

And load folderName + fileName.

04:11 PM
Alot of txt files

It should be in a folder called 'Resources'.

03:42 PM
Alot of txt files

You could load a text file based on the object name.

Something like:


string fileName = this.name + "_text"; //--so if the name was object1, it would set the fileName to 'object1_text'...

03:36 PM
gui label

There are several different ways you could do this. One is to use GUI Groups:


var hudPos : Rect;
var hudImage : Texture2D;
var bulletsLeft = 6;
var magazines = 2;

function OnGUI(){
...

02:29 PM
split path at 'Assets'

You could also use string slicing, here is a UnityScript example:


function Start(){
var fullPath = "X:/Projects/4604-Renovation/Unity/4604_02/Assets/Models/FullBuildin g/Materials";
...

05:02 AM
I'm trying to create a script that'll make an object float back and forth. (No luck)

First, you need to properly indent your code and format it as code when posting it here (otherwise it is very difficult to read).

Press 'Go Advanced' on the bottom right hand corner of the Reply...

01:21 PM
 
Page 1 of 20 1 2 3 4