RPS.Config.getRandomEffect C# (CSharp) Method

getRandomEffect() public method

public getRandomEffect ( ) : string
return string
        public string getRandomEffect()
        {
            string json = null;
            if (this.getPersistantBool("useTransitions") && this.effects != null) {
                jsonFolder effect = jsonFolder.getRandomSelected(this.effects.children);
                jsonFolder direction = null;
                if (effect == null) {
                    json = "{\"effect\":\"fade\", \"duration\":100}";
                } else {
                    json += "{\"effect\":\"" + effect.key + "\"";
                    if (effect.children.Count > 0) {
                        direction = jsonFolder.getRandomSelected(effect.children);
                        if (direction != null) json += ", \"direction\":\"" + direction.title.ToLower() + "\"";
                    }
                    json += ", \"duration\":1000}";
                }
            }
            return json;
        }