Playmaker Forum

Playmaker Feedback => Action Requests => Topic started by: westingtyler on November 04, 2018, 11:53:58 PM

Title: Check if String is a Valid Hex Code (for Color Variables)
Post by: westingtyler on November 04, 2018, 11:53:58 PM
players can type a string, then the game sets the ambient color value to that. But what if they type a string that is too long, or isn't a valid color, or has weird symbols? i need an action that checks the string, then says yes or no, so I can send an event that provides a case to deal with that.
Title: Re: Check if String is a Valid Hex Code (for Color Variables)
Post by: krmko on November 05, 2018, 06:36:16 AM
Simplest way is to call TryParseHexString method: https://docs.unity3d.com/510/Documentation/ScriptReference/Color.TryParseHexString.html

No actions for this as far as i know.