X The Extention Thing for Unity Beta version

hey guys just to let you guys know I am working on a new thing for unity X.js adds the GUIx matfx and other functions to unity

still only in a beta version though so can u guys test this out for me and reply with any bugs you have

functions

SetBool
GetBool
SetColor
GetColor
SetColorRGB
GetColorRGB
matfx functions
GUIx functions
and more

tell of any more you want and any bugs you have

use at own risk and if game is commerial MUST INCLUDE - Some Code By Dreamer Code www.dreamer.tk

just use this because only beta and also because of how much work I did in converting and making this code

also any ways to simplify script is welcome

Dreamer Code the best coders

I read few first methods of the script…

If you have need for this kind of parse methods, you can do this (C#)

(edit: typo)
String qlStr = “Fast”;
QualityLevel ql = (QualityLevel)Enum.Parse(typeof(QualityLevel), qlStr);

string bStr = “true”;
boolean b = boolean.Parse(bStr);

I am not exactly sure how to do this in UnityScript, but should be doable there too.

Edit: see:

Same in UnityScript:

var ql : QualityLevel = System.Enum.Parse(QualityLevel, “Fast”);
var b = boolean.Parse(“true”);

Please stop bashing in code and posting everything and study bit instead… Seriously.

I’m afraid I have to agree…also, a huge mishmash of functions in a single script like that isn’t very useful, especially with a non-descriptive name like “X”. What’s with code like

static function MousePosition ()
{
	return Input.mousePosition;
}

? Doesn’t serve any purpose. This is meant as constructive criticism, not bashing.

–Eric

here can I say one thing, this is only a beta and there are still expected to be problems like this, also this only beta 1, thank you for your suggestion

I’m sure an attitude like that will result in an overwhelming outpouring of help for you. Bye bye.

–Eric

yeah I know this was a bad idea from the start I should really just include the playerprefs things because those would be somewhat helpful .Setbool .GetBool :cry: :cry: :cry: soory but yeah I created this to serve no real purpose except to make it somewhat useful for my game Skway racer check out the website www.dreamerco.tk

thanks any way no more posts if this is it… :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry:

Someone, please correct me if I am wrong but because I haven’t actually used PlayerPrefs yet… But having worked with .config files and similar in java and .NET, I really dislike reading/writing the values from external file freely anywhere in the code.

For one PlayerPrefs is stored into a file. Maybe each access does not read/write to the file but still does not seem to me a good idea to overuse this possibility…

So, I would see one way to do this would be to have a GameSettings class that is initialized at Game start and saved when player has changed and finally approved those settings.

Something like…

class MyGameSpecificSettings
{
  var myGameSpecificString : String = "default";
  var myGameSpecificBool : boolean = true; // default
  var myGameSpecificInt : int = 1; // default

  function MyGameSpecificSettings() // constructor
  {
    myGameSpecificString = PlayerPrefs.GetString("myGameSpecificString");
    myGameSpecificBool = boolean.Parse(PlayerPrefs.GetString("myGameSpecificBool");
    myGameSpecificInt = PlayerPrefs.GetInt("myGameSpecificInt");
  }

  function Save()
  {
    PlayerPrefs.SetString("myGameSpecificString", myGameSpecificString);
    PlayerPrefs.SetString("myGameSpecificBool", myGameSpecificBool.ToString());
    PlayerPrefs.SetInt("myGameSpecificInt", myGameSpecificInt);

  }
}

When new player initially arrives you would do something like:

var settings : MyGameSpecificSettings = new MyGameSpecificSettings(); // Initializes default settings

Then somewhere for example in your game where player updates his ship you can do

settings.myGameSpecificString = "new_value";
settings.myGameSpecificInt = 10;
settings.myGameSpecificBool = false;

And finally when user approves all the changes you would do:

settings.Save();

Unity is an excellent Game Development Tool. Create your Settings file and use it smartly then focus on the actual game mechanics of your game and Have Fun! :slight_smile:

edit: Sorry, I did not compile and test this code, just wrote from top of my head. But I am sure you get the idea.

edit2: Made the pseudo code bit more javascripty :wink: