public override void Init(SfbInternal fileBrowser)
        {
            this.fileBrowser = fileBrowser;
            SetListeners();

            // Init because the start function won't be called until next frame if it's just been instantiated
            inputField.Init();
            var text = inputField.GetText();

            Stopwatch sw    = Stopwatch.StartNew();
            int       count = 1;

            while (fileBrowser.DirectoryExistsInCurrentDirectory(text))
            {
                if (sw.ElapsedMilliseconds > 500)
                {
                    text = inputField.GetText();
                    Debug.Log("Checking existing directories took too long, break.");
                    break;
                }

                text = inputField.GetText() + " (" + count + ")";
                count++;
            }

            inputField.SetText(text);
        }
Example #2
0
        public bool PromtSubmitInputField(SfbInputField inputField)
        {
            if (SubmitNewFolderInputField(inputField.GetText()))
            {
                return(true);
            }

            return(false);
        }
        public bool PromtSubmitInputField(SfbInputField inputField)
        {
            if (SubmitNewFolderInputField(inputField.GetText())) {
                return true;
            }

            return false;
        }