Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
add some summary in script
  • Loading branch information
yuzuka4573 committed Jul 21, 2019
1 parent 9912fb6 commit 956d0e1
Show file tree
Hide file tree
Showing 12 changed files with 92 additions and 21 deletions.
Empty file.
Binary file added .vs/VRPN2/v15/Server/sqlite3/storage.ide
Binary file not shown.
Binary file added .vs/VRPN2/v15/Server/sqlite3/storage.ide-shm
Binary file not shown.
Binary file added .vs/VRPN2/v15/Server/sqlite3/storage.ide-wal
Binary file not shown.
4 changes: 2 additions & 2 deletions Assets/VRPN2/Scripts/Live2DC3/Live2DListLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ public class Live2DProfile
/// </summary>
/// <param name="name">model name</param>
/// <param name="filePaht">DB path</param>
public Live2DProfile(string name, string filePaht)
public Live2DProfile(string name, string filePath)
{
modelName = name;
path = filePaht;
path = filePath;
}
}

Expand Down
31 changes: 25 additions & 6 deletions Assets/VRPN2/Scripts/Live2DC3/Live2DUploader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ public Live2DUploader(string targetURL, string targetDBURL)
Storage = FirebaseStorage.GetInstance(targetURL);
Storage_ref = Storage.GetReferenceFromUrl(targetURL);
}

/// <summary>
/// upload the Live2D model to server
/// </summary>
/// <param name="filepath">Current live2D model.json file</param>
public async Task UploadLive2D(string filepath)
{
var fileType = new MetadataChange();
Expand Down Expand Up @@ -80,12 +83,18 @@ await moc3Path.PutBytesAsync(System.Text.Encoding.UTF8.GetBytes(data), fileType)
isUploading = false;
});
}

/// <summary>
/// upload model status getter
/// </summary>
/// <returns></returns>
public bool GetUploadState()
{
return isUploading;
}

/// <summary>
/// Set the user authed data
/// </summary>
/// <param name="user">authed user data</param>
public void SetUserData(FirebaseUser user)
{
try
Expand All @@ -98,19 +107,29 @@ public void SetUserData(FirebaseUser user)
Debug.Log(e);
}
}

/// <summary>
/// Set the server storage url
/// </summary>
/// <param name="url">storage url</param>
public void SetStorage(string url)
{
Storage = FirebaseStorage.GetInstance(url);
Storage_ref = Storage.GetReferenceFromUrl(url);
}

/// <summary>
/// set the server database url
/// </summary>
/// <param name="url">database url</param>
public void SetDataBase(string url)
{
FirebaseApp.DefaultInstance.SetEditorDatabaseUrl(url);
DB_ref = FirebaseDatabase.DefaultInstance.RootReference;
}

/// <summary>
/// get model list data from server DB
/// </summary>
/// <param name="location">DB locations</param>
/// <returns>DB data</returns>
async Task LoadDBData(DatabaseReference location)
{
var dataPair = new Dictionary<string, string>();
Expand Down
6 changes: 5 additions & 1 deletion Assets/VRPN2/Scripts/VRM/VRMListLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ await FirebaseDatabase.DefaultInstance.RootReference.Child("VRP").Child(user.Use
return VRMProfiles;
}


/// <summary>
/// get the model thumnail from base64 data
/// </summary>
/// <param name="base64Data">base64 encoded thumnail data</param>
/// <returns>Texture2D thumnail data</returns>
public Texture2D GetVRMThumnail(string base64Data)
{
Texture2D convertedImg = new Texture2D(1, 1);
Expand Down
29 changes: 25 additions & 4 deletions Assets/VRPN2/Scripts/VRM/VRMUploader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ public VRMUploader(string targetURL, string targetDBURL)
Storage = FirebaseStorage.GetInstance(targetURL);
Storage_ref = Storage.GetReferenceFromUrl(targetURL);
}

/// <summary>
/// upload VRM file to server
/// </summary>
/// <param name="filepath">Current VRM model path</param>
public async Task UploadVRM(string filepath)
{
var fileType = new MetadataChange();
Expand Down Expand Up @@ -101,12 +104,18 @@ await vrmPath.PutBytesAsync(vrmByte, fileType).ContinueWith((Task<StorageMetadat
});

}

/// <summary>
/// Get VRM upload status
/// </summary>
/// <returns>current upload status</returns>
public bool GetUploadState()
{
return isUploading;
}

/// <summary>
/// set authed user data
/// </summary>
/// <param name="user">Authed user data</param>
public void SetUserData(FirebaseUser user)
{
try
Expand All @@ -118,19 +127,31 @@ public void SetUserData(FirebaseUser user)
Debug.Log(e);
}
}

/// <summary>
/// set Server storage url
/// </summary>
/// <param name="url">storage url</param>
public void SetStorage(string url)
{
Storage = FirebaseStorage.GetInstance(url);
Storage_ref = Storage.GetReferenceFromUrl(url);
}

/// <summary>
/// set Server DB url
/// </summary>
/// <param name="url">DB url</param>
public void SetDataBase(string url)
{
FirebaseApp.DefaultInstance.SetEditorDatabaseUrl(url);
DB_ref = FirebaseDatabase.DefaultInstance.RootReference;
}

/// <summary>
/// Get model list from DB
/// </summary>
/// <param name="location">DB path</param>
/// <returns>model List</returns>
async Task LoadDBData(DatabaseReference location)
{
var dataPair = new Dictionary<string, string>();
Expand Down
18 changes: 14 additions & 4 deletions Assets/VRPN2/Scripts/debug/NodeLauncher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,31 @@ public class NodeLauncher : MonoBehaviour
Text type;
Button launcher;
TestScript test;

/// <summary>
/// setup the VRM information
/// </summary>
/// <param name="data">current VRM model profile</param>
public void SetupVRM(VRMProfile data)
{
test = GameObject.Find("EventObject").GetComponent<TestScript>();
vrm = data;
fileType = "VRM";
SetupNode();
}

/// <summary>
/// setup the Live2D information
/// </summary>
/// <param name="data">current Live2D model profile></param>
public void SetupLive2D(Live2DProfile data)
{
test = GameObject.Find("EventObject").GetComponent<TestScript>();
live2d = data;
fileType = "Live2D";
SetupNode();
}

/// <summary>
/// Load model information to Node
/// </summary>
void SetupNode()
{
name = GameObject.Find("Canvas/Scroll View/Viewport/Content/" + gameObject.name + "/Name").GetComponent<Text>();
Expand All @@ -43,7 +51,9 @@ void SetupNode()
launcher.onClick.AddListener(LoadModel);

}

/// <summary>
/// Load trigger with model format
/// </summary>
public void LoadModel()
{
switch (fileType)
Expand Down
4 changes: 3 additions & 1 deletion Assets/VRPN2/Scripts/debug/ObjectMover.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ private void Start()
{
target = gameObject.transform;
}
// Update is called once per frame
/// <summary>
/// Camera control with AWSD
/// </summary>
void Update()
{
if (Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift)) {
Expand Down
21 changes: 18 additions & 3 deletions Assets/VRPN2/Scripts/debug/TestScript.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using Crosstales.FB;
/*
using CVVTuber;
using CVVTuber.Live2DCubism3;
*/
using Live2D.Cubism.Core;
using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -54,6 +56,7 @@ public class TestScript : MonoBehaviour

List<VRMProfile> VRMProfiles;
List<Live2DProfile> Live2DProfiles;
/*
[SerializeField]
GameObject live2DcvLoader;
[SerializeField]
Expand All @@ -63,6 +66,7 @@ public class TestScript : MonoBehaviour
Live2DCubism3HeadRotationController HRC;
Live2DCubism3FaceAnimationController FAC;
CVVTuberControllManager CVVCM;
*/
VRMLoader vrnloader;

private void Awake()
Expand Down Expand Up @@ -104,7 +108,9 @@ void Start()

}

// Update is called once per frame
/// <summary>
/// Update Live2D or VRM model to server
/// </summary>
public async void Runner()
{

Expand Down Expand Up @@ -140,7 +146,9 @@ public async void Runner()
else Debug.LogError("uploader still running");
}


/// <summary>
/// Email-password Auth test
/// </summary>
public async void AuthTest()
{
UpdateEmail();
Expand Down Expand Up @@ -190,7 +198,9 @@ public void UpdatePass()
{
pass = p.text;
}

/// <summary>
/// Commpressed Live2D loading test
/// </summary>
public void LoadingTest()
{

Expand Down Expand Up @@ -309,10 +319,12 @@ await Task.Run(() =>
CubismModel target = GameObject.FindGameObjectWithTag("Player").GetComponent<CubismModel>();
target.gameObject.AddComponent<ObjectMover>();
target.gameObject.AddComponent<LookAround>();
/*
target.gameObject.GetComponent<Animator>().runtimeAnimatorController = animation;
target.transform.Translate(0, 1.5f, 0);
var loader = Instantiate(live2DcvLoader);
loader.name = live2DcvLoader.name;
HRC = GameObject.Find("Live2DCubism3CVVTuberExample/Live2DCubism3HeadRotationController").GetComponent<Live2DCubism3HeadRotationController>();
FAC = GameObject.Find("Live2DCubism3CVVTuberExample/Live2DCubism3FaceAnimationController").GetComponent<Live2DCubism3FaceAnimationController>();
CVVCM = GameObject.Find("Live2DCubism3CVVTuberExample/Live2DCubism3ControllManager").GetComponent<CVVTuberControllManager>();
Expand All @@ -321,18 +333,21 @@ await Task.Run(() =>
FAC.live2DCubism3Model = target;
GameObject.Find("Live2DCubism3CVVTuberExample/Live2DCubism3KeyInputExpressionController").GetComponent<Live2DCubism3KeyInputExpressionController>().target = target.gameObject.GetComponent<Animator>();
GameObject.Find("Live2DCubism3CVVTuberExample/Live2DCubism3ControllManager").GetComponent<CVVTuberControllManager>().enabled = true;
*/
}
else if (data.Type == "application/vrm")
{
Debug.Log("Stasrt loading VRM");
await vrmloader.LoadVRM(data.File);
/*
var Instance = Instantiate(VRMcvLoader);
Instance.name = VRMcvLoader.name;
var currentGameObject = GameObject.Find("VRMCVVTuberExample/VRMControllManager");
var loader = currentGameObject.GetComponent<CVVTuber.VRM.VRMLoader>();
loader.meta = GameObject.FindGameObjectWithTag("Player").GetComponent<VRM.VRMMeta>();
GameObject.Find("VRMCVVTuberExample/DlibFaceLandmarkGetter").GetComponent<DlibFaceLandmarkGetter>().screen = GameObject.Find("Canvas/RawImage").GetComponent<RawImage>();
currentGameObject.GetComponent<CVVTuber.VRM.VRMCVVTuberControllManager>().enabled = true;
*/
}
}
else
Expand Down
Binary file modified Assets/VRPN2/VRMDemo/VRMDemoScene.unity
Binary file not shown.

0 comments on commit 956d0e1

Please sign in to comment.