public static Texture2D EncodeAndCreateAsset(Texture2D texture2D, string path) { var bytes = texture2D.EncodeToPNG(); File.WriteAllBytes($"{Application.dataPath}/{path}", bytes); return(AssetQuerying.FindAssetAtPath <Texture2D>(path)); }
private void Awake() { if (assetShortCuts.Count == 0) { assetShortCuts.Add(AssetQuerying.FindAssetAtPath <Object>("Resources/Global Item Index.asset")); assetShortCuts.Add(AssetQuerying.FindAssetAtPath <Object>("ScriptableObjects")); assetShortCuts.Add(AssetQuerying.FindAssetAtPath <Object>("Scripts")); } if (favouriteScenes.Count == 0) { favouriteScenes.Add(AssetQuerying.FindAssetAtPath <SceneAsset>("Scenes/PreloadScene.unity")); favouriteScenes.Add(AssetQuerying.FindAssetAtPath <SceneAsset>("Scenes/Art/HUB/Hub.unity")); favouriteScenes.Add(AssetQuerying.FindAssetAtPath <SceneAsset>("Scenes/Art/Fishing Scene.unity")); } }