AGS.Editor.AGSEditor.GetFirstAvailableScriptName C# (CSharp) Method

GetFirstAvailableScriptName() public method

public GetFirstAvailableScriptName ( string namePrefix ) : string
namePrefix string
return string
        public string GetFirstAvailableScriptName(string namePrefix)
        {
            int tryIndex = 1;
            string tryName = null;
            bool canUseName = false;
            while (!canUseName)
            {
                tryName = namePrefix + tryIndex;
                canUseName = !_game.IsScriptNameAlreadyUsed(tryName, null);
                if (!canUseName)
                {
                    tryIndex++;
                }
            }
            return tryName;
        }