-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated home window with versions + script updates
- Loading branch information
Showing
14 changed files
with
237 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using Newtonsoft.Json; | ||
|
||
namespace NFTPort.Editor | ||
{ | ||
////≧◠‿◠≦✌ _sz_ Ω //≧◠‿◠≦✌ _sz_ Ω | ||
public static class PkgInfo | ||
{ | ||
public static string GetPackageVer() | ||
{ | ||
string path = "Packages/com.nftport.nftport/package.json"; | ||
if (File.Exists(path)) | ||
{ | ||
var targetFile = File.ReadAllText(path); | ||
|
||
if (targetFile != null) | ||
{ | ||
PkgJson pkgJson = JsonConvert.DeserializeObject<PkgJson>(targetFile); | ||
return pkgJson.version; | ||
} | ||
} | ||
return null; | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.Data; | ||
using Newtonsoft.Json; | ||
using NFTPort.Internal; | ||
using UnityEngine; | ||
using UnityEngine.Events; | ||
using UnityEngine.Networking; | ||
|
||
namespace NFTPort.Editor | ||
{ | ||
#if UNITY_EDITOR | ||
public class LatestRel : MonoBehaviour | ||
{ | ||
public static bool running = false; | ||
private UnityAction<PkgJson> OnCompleteAction; | ||
////≧◠‿◠≦✌ _sz_ Ω //≧◠‿◠≦✌ _sz_ Ω | ||
public static LatestRel Initialize() | ||
{ | ||
if (!running) | ||
{ | ||
running = true; | ||
var _this = new GameObject("NFTPort initialise delete this gameobject").AddComponent<LatestRel>(); | ||
return _this; | ||
} | ||
return null; | ||
} | ||
public LatestRel OnComplete(UnityAction<PkgJson> action) | ||
{ | ||
this.OnCompleteAction = action; | ||
return this; | ||
} | ||
|
||
public void Run() | ||
{ | ||
StopAllCoroutines(); | ||
StartCoroutine(LatestReleaseversion()); | ||
StartCoroutine(ForceEnd()); | ||
} | ||
IEnumerator ForceEnd() | ||
{ | ||
yield return new WaitForSeconds(3f); | ||
End(); | ||
} | ||
|
||
private UnityWebRequest www; | ||
IEnumerator LatestReleaseversion() | ||
{ | ||
string WEB_URL = "https://raw.githubusercontent.com/nftport/nftport-unity/com.nftport.nftport/package.json"; | ||
www = UnityWebRequest.Get(WEB_URL); | ||
yield return www.SendWebRequest(); | ||
|
||
if (www.result != UnityWebRequest.Result.Success) { | ||
|
||
} | ||
else | ||
{ | ||
PkgJson pkgJson = JsonConvert.DeserializeObject<PkgJson>(www.downloadHandler.text); | ||
if(OnCompleteAction!=null) | ||
OnCompleteAction.Invoke(pkgJson); | ||
} | ||
End(); | ||
} | ||
|
||
void End() | ||
{ | ||
www.Dispose(); | ||
running = false; | ||
DestroyImmediate(gameObject); | ||
} | ||
} | ||
#endif | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
namespace NFTPort.Editor | ||
{ | ||
[Serializable] | ||
public class PkgJson | ||
{ | ||
[Serializable] | ||
public class Author | ||
{ | ||
public string name; | ||
public string email; | ||
public string url; | ||
} | ||
|
||
public string name; | ||
public string displayName; | ||
public string version; | ||
public string description; | ||
public string type; | ||
public string documentationUrl; | ||
public List<string> keywords; | ||
public Author author; | ||
public List<Sample> samples; | ||
|
||
[Serializable] | ||
public class Sample | ||
{ | ||
public string displayName; | ||
public string description; | ||
public string path; | ||
} | ||
} | ||
} | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters