Looking for the best datatype for a data storing problem
If i had a bunch of values that were possibly non-linear but ordered: 1, 3, 8, 12 and i added a new one, say 5 whats the best collection type (speed over anything else) that would store it between 3...
View ArticleTracking Turns in Turn Based Game Loop
I'm trying to keep track of what number turn it is in this turn based game I'm building. The game focuses a lot on simulation, and is expected to run for weeks, months, possibly years. Each "turn"...
View ArticleHow to name a GameObject that is set active
Hi there guys. I would like to know how to name a GameObject that has been set active. To better explain: In this line of code : `GameObject room = (GameObject)Instantiate (availableRooms...
View ArticleMonodevelop doesn't recognize Vector3 and Transform (C#)
Hi guys, I have this problem with Unity. I used Unity before, but with JS. Now, I want to create some scripts using C#, yet Monodevelop doesn't recognize Unity data type like Vector3 and Transform
View ArticleSetting up a New Data Type - Am I Doing Something Wrong?
In my current project, I'm trying to set up a new data type so I can get a script off a game object and enable/disable it on a keystroke. All of my syntax seems to be correct, except for the fact that...
View ArticleHow to change the data type used in a slider object?
Simply put, is there a way to change the minvalue, maxvalue, and value fields in a Slider gameobject to be doubles instead of floats? I need the capacity for larger numbers.
View ArticleButton OnClick() function stops working after instantiating the prefab.
I'm working on a level editor system that uses an addon package called "SerializeHelper" (forgot the author's name, not my own work), and in my scene I have a Button that returns an integer to the...
View ArticleData types and explictly stating
In the Lerpz tutorial, they have the following in a script: private var levelStateMachine : LevelStatus;LevelStatus is the name of a script, not a data type, so can somebody help me understand what...
View ArticlePrimitive data types (for code, not modeling)
I'm trying to find a list of Unity's primitive data types. As I'm searching I'm running into a conceptual collision between modeling primitives and code primitives, two very different subjects.Examples...
View ArticleSong pattern format
Hi. I try to implement a basic sequencer for my game. I have some samples, all in the same bpm. They are grouped after their time length in three categories: 1/4 measure, 1/2 measure, 1 measure. I have...
View ArticleLogic and datatype existential problem
The title might sound scary but I have just a question about data types. Quite simply, I would need something like this: public class myclass { int myint = 0; string mystring = ""; public myclass(int...
View Article#pragma strict and NotificatonCenterGenerics
Hi guys, I have some code that plays nicely with http://www.unifycommunity.com/wiki/index.php?title=NotificationCenterGenerics as long as my code isn't set to #pragma strict. Here is the code: function...
View ArticleWhat is the best datatype for an ID?
I want to have an ID to store dynamically created items in a dictionary. Technically I think a ulong would be way more than enough for what I need, but I was wondering if there was technically another...
View Articlewhy function datatype i.e. function foo() : int {
I just found an answer on the forum where the guy defines the data type for a function, and returns a value at the end of the function,it goes like this: function MaxValue (intArray : int[]) : int {...
View Articlefunction that will return the name of the data type of a variable?
Is there some function I can use that will return the name of the data type of a variable? I need to know this so I can call a function out of two functions I made that use different datatypes. I hope...
View ArticleUnity iPhone plugin - what data type to use?
I'm integrating Countly iOS plugin with Unity. I'm following http://docs.unity3d.com/Documentation/Manual/PluginsForIOS.html and its example:...
View ArticleHow to equate (link) 2 different data types?
I've been a bit confused about this for a while now. Say you have a gameobject and a int, and you want that specific game object to be represented as a int id how would you do that? I'm delving into...
View Articlecginc definitions vs Docs
In "Lighting.cginc" the "SurfaceOutput" struct (its elements) is defined using "fixed" datatype, but the Unity documentation talks about "half" datatype. According to the docs, "half" is 16bit, "fixed"...
View ArticleUnity API not supporting longs (64 bit int)?
Hi all, I would like to use longs in my game, but I'm running into trouble when I try to use it with the Unity API. For instance `Mathf.RoundToLong()` doesn't exist and neither does...
View ArticleUsing Short over Int
Is there any noticable benefit to using the short data type instead of an int? Would their be any performance increase or anywhere where they behave differently?
View Article