Chatterer.chatterer.radio_check C# (CSharp) Method

radio_check() private method

private radio_check ( ) : void
return void
        private void radio_check()
        {
            foreach (char c in Input.inputString)
            {
                //backspace char
                if (c == "\b"[0])
                {
                    if (yep_yep.Length != 0)
                    {
                        yep_yep = yep_yep.Substring(0, yep_yep.Length - 1);
                    }
                }
                else
                {
                    //if (c == "\n"[0] || c == "\r"[0])
                    //{
                    //print("User entered his name: " + yep_yep);
                    //}
                    //else
                    // {
                    yep_yep += c;
                    //}
                }
            }

            if (yep_yep.Length > 5) yep_yep = yep_yep.Substring(1, 5);  //only keep 5 chars, get rid of the first

            if (http_update_check && yep_yep == "radio" && yep_yepsource.isPlaying == false)
            {
                if (debugging) Debug.Log("[CHATR] play radio");

                //need a bool that radio_yepyep is loaded ok
                if (yep_yep_loaded == false)
                {
                    load_radio();
                }

                //Play "radio"
                yep_yepsource.Play();
                yep_yep = "";
            }
        }
chatterer