[ChromaSDK] Unity3D plugin - Now available!

Discussion in 'Razer Chroma' started by njbmartin, Mar 7, 2015.

Thread Status:
Not open for further replies.
  1. njbmartin

    njbmartin Developer of Awesome

    Here we go!

    https://www.dropbox.com/s/nycck9ru5zl7gx6/ChromaticUnity-0.01a.zip?dl=0

    Note that this uses a custom C# library for the ChromaSDK which is not as feature rich as the Colore library.
    • You will need have the ChromaSDK enabled first, as well as synapse disabled
    • You then need to add this to your Unity Project's Assets folder
    • Have a look through ChromaticUnitySample.cs which will show you how to consume and make use of the C# Library.
    • Also remember to attach the script to something in the scene
    Any problems or questions let me know.
     
    Last edited: Jun 3, 2015
    Spri and St3alth like this.
  2. njbmartin

    njbmartin Developer of Awesome

    @Boredgamerz and @Spri Please let me know how you get on and I'd be happy to assist you. Feel free to add me on Skype: movura
     
  3. casthitWheat653

    casthitWheat653 New Member

    I'm going to try it tomorrow ! :)
     
  4. Zalmez

    Zalmez New Member

    @njbmartin Thanku so much! I love it, but kinda confused x3 not 100% awesome with programming but this helps alot! I'm just playing around right and trying to make a health function to make the keyboard go from green to red. I will probally figure it out in the end :D Keep up the good work!!!

    And I wondered if it works to use it in the update function? Will the colors change say like if the health goes under 10 health?

    EDIT:

    Nvm, Got it working ^^
     
    Last edited: Jun 7, 2015
  5. njbmartin

    njbmartin Developer of Awesome

    yay! I need to get another Chroma keyboard. I took it to work a few weeks ago and it hasn't been back since.
     
  6. Zalmez

    Zalmez New Member

    I found myself a color table :D This can make things easier to find the color you want on the keyboard ^^
     
  7. njbmartin

    njbmartin Developer of Awesome

    Nice find!
     
  8. Zalmez

    Zalmez New Member

    @njbmartin I'm kinda confused. How do i use the effect types? I'm not so good with programming yet, but i still get most of it since I read the example. If i'm not blind i haven't seen a example of just using the normal effect types. in this case I was thinking of a breathing effect

    So any suggestions? I'm just currently playing around ^^

    Code:
       public void Health(int healthLeft)
        {
    
            if (effects == null)
            {
                customKeys();
            }
            List<Keyboard.CUSTOM_EFFECT_TYPE> keyeffect = new List<Keyboard.CUSTOM_EFFECT_TYPE>();
            if (healthLeft > 51)
            {
                foreach (Keyboard.CUSTOM_EFFECT_TYPE effect in effects)
                {
                    Keyboard.CUSTOM_EFFECT_TYPE newEffect = effect;
    
                    newEffect.Color = new Color(0, 100, 0);
                    keyeffect.Add(newEffect);
                }
            }else
            if (healthLeft < 50)
            {
                foreach (Keyboard.CUSTOM_EFFECT_TYPE effect in effects)
                {
                    Keyboard.CUSTOM_EFFECT_TYPE newEffect = effect;
    
                    newEffect.Color = new Color(100, 0, 0);
                    keyeffect.Add(newEffect);
                 }
            }
    
            CreateCustomEffect(keyeffect.Count, keyeffect.ToArray());
        }
    EDIT:
    Sorry if I'm asking to much questions :/
     
  9. njbmartin

    njbmartin Developer of Awesome

    It currently doesn't support the standard effect types. My initial thinking was to ensure that people can create a completely custom keyboard experience. Of course, there's plenty of room for improvement.

    Feel free to add me on Skype and I'll help you out where I can! :)
     
  10. Zalmez

    Zalmez New Member

    I see ^^ I just added you on skype :) I have no complaints or anything at all ^^ It's alot work so I just wondered :D

    Thanks again for making this for unity ^^ This will make some of my games become awesome not just for me, but my friends aswell :D
     
  11. njbmartin

    njbmartin Developer of Awesome

    Thanks to @Boredgamerz for reminding me, this is a 64-bit only plugin for now. Your Unity build setting must be set to x86_64 in order to function correctly.
     
Thread Status:
Not open for further replies.
Sign In with Razer ID >


Don't have a Razer ID yet?
Get Razer ID >