changeset | 要提交的变更集。 |
assets | 要提交的资源。 |
如果提交资源是有效操作,则返回 true。
Do note that the task will always return true if the changeset parameter is set to an existing changeset.
using System.Collections.Generic; using UnityEditor; using UnityEditor.VersionControl; using UnityEngine;
public class EditorScript : MonoBehaviour { [MenuItem("Version Control/SubmitIsValid")] public static void ExampleSubmitIsValid() { AssetList assets = new AssetList(); assets.Add(Provider.GetAssetByPath("Assets/ExampleAsset.cs")); Debug.Log(Provider.SubmitIsValid(null, assets)); } }