I'm using UnityScript with a Unity3D game project. I've written about 400 lines of code for the Player script, and then I decided maybe it'd be a good idea to include
#pragma strict
at the start of the script, since I was told it's a good practice.So I braced myself for the multitudes of errors coming my way, and now I'm stuck on a set of errors. The problem is that I have an array called 'skills' which I declare as so:
public var skills = new Array();
The only objects being added to skills are those of a class named Skill:
class Skill
{
var Hotkey:String;
var dub:String;
var Script:Skills;
}
Note: Script is typed to Skills, which is the name of a .js script. It's what causes the functionality of the skills.
Anyway, I use the skills array to handle all of the player's skills, so I refer to the variables in Skill. For example, I use this piece of code at one point:
if (Input.GetKeyDown(skills.Hotkey))
It's in a for loop, hence the 'i'. Lines like this, which refer specifically to variables that are a part of the Skill class, come up with the error stating that "Hotkey is not a member of Object". I suppose it's because the skills array is just an array. I can't use built-in Unity arrays because they've got other problems that I can't seem to get around.
Is there any way I could tell the compiler that I'm not going to assign an object in skills to anything other than a Skill class, or am I going to have to find a way around it by changing the way I check for hotkeys and such? Should I just not use #pragma strict..?
Thanks!