Пример #1
0
    /// <summary>
    /// Creates a TutorialCallbacks asset and shows it in the Project window.
    /// </summary>
    /// <param name="assetPath">
    /// A relative path to the project's root. If not provided, the Project window's currently active folder path is used.
    /// </param>
    /// <returns>The created asset</returns>
    public static ScriptableObject CreateAndShowAsset(string assetPath = null)
    {
        assetPath = assetPath ?? $"{TutorialEditorUtils.GetActiveFolderPath()}/{DefaultFileName}.asset";
        var asset = CreateInstance <TutorialCallbacks>();

        AssetDatabase.CreateAsset(asset, AssetDatabase.GenerateUniqueAssetPath(assetPath));
        EditorUtility.FocusProjectWindow(); // needed in order to make the selection of newly created asset to really work
        Selection.activeObject = asset;
        return(asset);
    }
 public bool IsUnityUrlRequiringAuthentication_ReturnsTrueForUnityURLs(string url)
 {
     return(TutorialEditorUtils.IsUnityUrlRequiringAuthentication(url));
 }
 public string RemoveHTTPProtocolPrefix_AlwaysFiltersURLProperly(string url)
 {
     return(TutorialEditorUtils.RemoveHttpProtocolPrefix(url));
 }