Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We’re making changes to the Unity Runtime Fee pricing policy that we announced on September 12th. Access our latest thread for more information!
    Dismiss Notice
  3. Dismiss Notice

X The Extention Thing for Unity Beta version

Discussion in 'Immediate Mode GUI (IMGUI)' started by bloodtiger10, Nov 13, 2008.

?

Is this script helpful for your games

  1. yes

    0 vote(s)
    0.0%
  2. no

    0 vote(s)
    0.0%
  1. bloodtiger10

    bloodtiger10

    Joined:
    Nov 9, 2008
    Posts:
    619
    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
     
  2. S.T.

    S.T.

    Joined:
    Sep 10, 2008
    Posts:
    40
  3. S.T.

    S.T.

    Joined:
    Sep 10, 2008
    Posts:
    40
    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.
     
  4. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,376
    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

    Code (csharp):
    1. static function MousePosition ()
    2. {
    3.     return Input.mousePosition;
    4. }
    ? Doesn't serve any purpose. This is meant as constructive criticism, not bashing.

    --Eric
     
  5. bloodtiger10

    bloodtiger10

    Joined:
    Nov 9, 2008
    Posts:
    619
    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
     
  6. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,376
    I'm sure an attitude like that will result in an overwhelming outpouring of help for you. Bye bye.

    --Eric
     
  7. bloodtiger10

    bloodtiger10

    Joined:
    Nov 9, 2008
    Posts:
    619
    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:
     
  8. S.T.

    S.T.

    Joined:
    Sep 10, 2008
    Posts:
    40
    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...

    Code (csharp):
    1.  
    2.  
    3. class MyGameSpecificSettings
    4. {
    5.   var myGameSpecificString : String = "default";
    6.   var myGameSpecificBool : boolean = true; // default
    7.   var myGameSpecificInt : int = 1; // default
    8.  
    9.   function MyGameSpecificSettings() // constructor
    10.   {
    11.     myGameSpecificString = PlayerPrefs.GetString("myGameSpecificString");
    12.     myGameSpecificBool = boolean.Parse(PlayerPrefs.GetString("myGameSpecificBool");
    13.     myGameSpecificInt = PlayerPrefs.GetInt("myGameSpecificInt");
    14.   }
    15.  
    16.   function Save()
    17.   {
    18.     PlayerPrefs.SetString("myGameSpecificString", myGameSpecificString);
    19.     PlayerPrefs.SetString("myGameSpecificBool", myGameSpecificBool.ToString());
    20.     PlayerPrefs.SetInt("myGameSpecificInt", myGameSpecificInt);
    21.  
    22.   }
    23. }
    24.  
    When new player initially arrives you would do something like:

    Code (csharp):
    1.  
    2. var settings : MyGameSpecificSettings = new MyGameSpecificSettings(); // Initializes default settings
    3.  


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

    Code (csharp):
    1.  
    2. settings.myGameSpecificString = "new_value";
    3. settings.myGameSpecificInt = 10;
    4. settings.myGameSpecificBool = false;
    5.  
    6.  
    And finally when user approves all the changes you would do:

    Code (csharp):
    1.  
    2. settings.Save();
    3.  
    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! :)

    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 ;)