Add : 치요 촬영용 배경 파일 업데이트 Vrm 파일 다운그레이드

This commit is contained in:
qsxft258@gmail.com 2025-08-18 23:55:36 +09:00
parent 8c1c0376cd
commit 770fc70fd9
1796 changed files with 61742 additions and 67740 deletions

Binary file not shown.

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 9402b207048258649b4b1c0580e1b73b
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,193 +0,0 @@
/*
* ExternalReceiver
* https://sabowl.sakura.ne.jp/gpsnmeajp/
*
* MIT License
*
* Copyright (c) 2019 gpsnmeajp
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#pragma warning disable 0414,0219
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.Profiling;
namespace EVMC4U
{
public class CameraReceiver : MonoBehaviour, IExternalReceiver
{
[Header("CameraReceiver v1.1")]
[SerializeField, Label("VMCカメラ制御同期Camera")]
public Camera VMCControlledCamera = null; //VMCカメラ制御同期
[SerializeField, Label("動作状況")]
private string StatusMessage = ""; //Inspector表示用
#if EVMC4U_JA
[Header("カメラ手ブレ補正フィルタ")]
#else
[Header("Lowpass Filter Option")]
#endif
[SerializeField, Label("カメラ位置フィルタ(手ブレ補正)")]
public bool CameraPositionFilterEnable = false; //カメラ位置フィルタ(手ブレ補正)
[SerializeField, Label("カメラ回転フィルタ(手ブレ補正)")]
public bool CameraRotationFilterEnable = false; //カメラ回転フィルタ(手ブレ補正)
[SerializeField, Label("カメラフィルタ係数")]
public float CameraFilter = 0.95f; //カメラフィルタ係数
#if EVMC4U_JA
[Header("デイジーチェーン")]
#else
[Header("Daisy Chain")]
#endif
public GameObject[] NextReceivers = new GameObject[1];
private ExternalReceiverManager externalReceiverManager = null;
bool shutdown = false;
private Vector3 cameraPosFilter = Vector3.zero;
private Quaternion cameraRotFilter = Quaternion.identity;
//メッセージ処理一時変数struct(負荷対策)
//Vector3 pos;
//Quaternion rot;
//カメラ情報のキャッシュ
Vector3 cameraPos = Vector3.zero;
Quaternion cameraRot = Quaternion.identity;
float fov = 0;
void Start()
{
externalReceiverManager = new ExternalReceiverManager(NextReceivers);
StatusMessage = "Waiting for Master...";
}
//デイジーチェーンを更新
public void UpdateDaisyChain()
{
externalReceiverManager.GetIExternalReceiver(NextReceivers);
}
void Update()
{
//カメラがセットされているならば
if (VMCControlledCamera != null && VMCControlledCamera.transform != null && fov != 0)
{
CameraFilter = Mathf.Clamp(CameraFilter, 0f, 1f);
//カメラ移動フィルタ
if (CameraPositionFilterEnable)
{
cameraPosFilter = (cameraPosFilter * CameraFilter) + cameraPos * (1.0f - CameraFilter);
VMCControlledCamera.transform.localPosition = cameraPosFilter;
}
else
{
VMCControlledCamera.transform.localPosition = cameraPos;
}
//カメラ回転フィルタ
if (CameraRotationFilterEnable)
{
cameraRotFilter = Quaternion.Slerp(cameraRotFilter, cameraRot, 1.0f - CameraFilter);
VMCControlledCamera.transform.localRotation = cameraRotFilter;
}
else
{
VMCControlledCamera.transform.localRotation = cameraRot;
}
//FOV同期
VMCControlledCamera.fieldOfView = fov;
}
}
public void MessageDaisyChain(ref uOSC.Message message, int callCount)
{
//Startされていない場合無視
if (externalReceiverManager == null || enabled == false || gameObject.activeInHierarchy == false)
{
return;
}
if (shutdown)
{
return;
}
StatusMessage = "OK";
//異常を検出して動作停止
try
{
ProcessMessage(ref message);
}
catch (Exception e)
{
StatusMessage = "Error: Exception";
Debug.LogError(" --- Communication Error ---");
Debug.LogError(e.ToString());
shutdown = true;
return;
}
if (!externalReceiverManager.SendNextReceivers(message, callCount))
{
StatusMessage = "Infinite loop detected!";
shutdown = true;
}
}
private void ProcessMessage(ref uOSC.Message message)
{
//メッセージアドレスがない、あるいはメッセージがない不正な形式の場合は処理しない
if (message.address == null || message.values == null)
{
StatusMessage = "Bad message.";
return;
}
//カメラ姿勢FOV同期 v2.1
if (message.address == "/VMC/Ext/Cam"
&& (message.values[0] is string)
&& (message.values[1] is float)
&& (message.values[2] is float)
&& (message.values[3] is float)
&& (message.values[4] is float)
&& (message.values[5] is float)
&& (message.values[6] is float)
&& (message.values[7] is float)
&& (message.values[8] is float)
)
{
cameraPos.x = (float)message.values[1];
cameraPos.y = (float)message.values[2];
cameraPos.z = (float)message.values[3];
cameraRot.x = (float)message.values[4];
cameraRot.y = (float)message.values[5];
cameraRot.z = (float)message.values[6];
cameraRot.w = (float)message.values[7];
fov = (float)message.values[8];
//受信と更新のタイミングは切り離した
}
}
}
}

View File

@ -1,256 +0,0 @@
/*
* ExternalReceiver
* https://sabowl.sakura.ne.jp/gpsnmeajp/
*
* MIT License
*
* Copyright (c) 2019 gpsnmeajp
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#pragma warning disable 0414,0219
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.Profiling;
namespace EVMC4U
{
public class CommunicationValidator : MonoBehaviour, IExternalReceiver
{
[Header("CommunicationValidator v1.2")]
[SerializeField, Label("動作状況")]
private string StatusMessage = ""; //Inspector表示用
#if EVMC4U_JA
[Header("UI オプション")]
#else
[Header("UI Option")]
#endif
[SerializeField, Label("画面上に表示する")]
public bool ShowInformation = false;
#if EVMC4U_JA
[Header("状態モニタ(表示用)")]
#else
[Header("Status Monitor(Read only)")]
#endif
[SerializeField, Label("受信処理再帰呼出し回数")]
private int CallCountMonitor = 0; //Inspector表示用
[SerializeField, Label("利用可能")]
public int Available = 0;
[SerializeField, Label("送信側Time")]
public float time = 0;
[SerializeField, Label("キャリブレーション状態")]
public CalibrationState calibrationState = 0;
[SerializeField, Label("キャリブレーションモード")]
public CalibrationMode calibrationMode = 0;
#if EVMC4U_JA
[Header("送信側受信状態(表示用)")]
#else
[Header("Receive Status(Read only)")]
#endif
[SerializeField, Label("受信許可")]
public bool ReceiveEnable = false;
[SerializeField, Label("受信ポート")]
public int ReceivePort = 0;
[SerializeField, Label("読み込み済み設定ファイルパス")]
public string LoadedConfigPath = "";
[SerializeField, Label("背景色")]
public Color backgroundColor = Color.clear;
#if EVMC4U_JA
[Header("送信側ウィンドウ属性情報")]
#else
[Header("Window Attribute Info(Read only)")]
#endif
[SerializeField, Label("最前面")]
public bool IsTopMost = false;
[SerializeField, Label("透過")]
public bool IsTransparent = false;
[SerializeField, Label("クリックスルー")]
public bool WindowClickThrough = false;
[SerializeField, Label("枠なし")]
public bool HideBorder = false;
#if EVMC4U_JA
[Header("デイジーチェーン")]
#else
[Header("Daisy Chain")]
#endif
public GameObject[] NextReceivers = new GameObject[1];
private ExternalReceiverManager externalReceiverManager = null;
bool shutdown = false;
readonly Rect rect1 = new Rect(0, 0, 120, 70);
readonly Rect rect2 = new Rect(10, 20, 100, 30);
readonly Rect rect3 = new Rect(10, 40, 100, 300);
void Start()
{
externalReceiverManager = new ExternalReceiverManager(NextReceivers);
StatusMessage = "Waiting for Master...";
}
//デイジーチェーンを更新
public void UpdateDaisyChain()
{
externalReceiverManager.GetIExternalReceiver(NextReceivers);
}
int GetAvailable()
{
return Available;
}
float GetRemoteTime()
{
return time;
}
void OnGUI()
{
if (ShowInformation)
{
GUI.TextField(rect1, "ExternalReceiver");
GUI.Label(rect2, "Available: " + GetAvailable());
GUI.Label(rect3, "Time: " + GetRemoteTime());
}
}
public void MessageDaisyChain(ref uOSC.Message message, int callCount)
{
//Startされていない場合無視
if (externalReceiverManager == null || enabled == false || gameObject.activeInHierarchy == false)
{
return;
}
if (shutdown)
{
return;
}
CallCountMonitor = callCount;
StatusMessage = "OK";
//異常を検出して動作停止
try
{
ProcessMessage(ref message);
}
catch (Exception e)
{
StatusMessage = "Error: Exception";
Debug.LogError(" --- Communication Error ---");
Debug.LogError(e.ToString());
shutdown = true;
return;
}
if (!externalReceiverManager.SendNextReceivers(message, callCount))
{
StatusMessage = "Infinite loop detected!";
shutdown = true;
}
}
private void ProcessMessage(ref uOSC.Message message)
{
//メッセージアドレスがない、あるいはメッセージがない不正な形式の場合は処理しない
if (message.address == null || message.values == null)
{
StatusMessage = "Bad message.";
return;
}
if (message.address == "/VMC/Ext/OK"
&& (message.values[0] is int))
{
Available = (int)message.values[0];
if (Available == 0)
{
StatusMessage = "Waiting for [Load VRM]";
}
else {
StatusMessage = "OK";
}
//V2.5 キャリブレーション状態(長さ3以上)
if (message.values.Length >= 3)
{
if ((message.values[1] is int) && (message.values[2] is int))
{
calibrationState = (CalibrationState)message.values[1];
calibrationMode = (CalibrationMode)message.values[2];
}
}
}
//データ送信時刻
else if (message.address == "/VMC/Ext/T"
&& (message.values[0] is float))
{
time = (float)message.values[0];
}
//V2.4 受信情報
else if (message.address == "/VMC/Ext/Rcv"
&& (message.values[0] is int)
&& (message.values[1] is int))
{
ReceiveEnable = (int)message.values[0] != 0;
ReceivePort = (int)message.values[1];
}
//V2.4 背景色情報
else if (message.address == "/VMC/Ext/Setting/Color"
&& (message.values[0] is float)
&& (message.values[1] is float)
&& (message.values[2] is float)
&& (message.values[3] is float))
{
backgroundColor = new Color((float)message.values[0], (float)message.values[1], (float)message.values[2], (float)message.values[3]);
}
//V2.4 ウィンドウ情報
else if (message.address == "/VMC/Ext/Setting/Win"
&& (message.values[0] is int)
&& (message.values[1] is int)
&& (message.values[2] is int)
&& (message.values[3] is int))
{
IsTopMost = (int)message.values[0] != 0;
IsTransparent = (int)message.values[1] != 0;
WindowClickThrough = (int)message.values[2] != 0;
HideBorder = (int)message.values[3] != 0;
}
//V2.5 読み込み済み設定ファイルパス情報
else if (message.address == "/VMC/Ext/Config"
&& (message.values[0] is string))
{
LoadedConfigPath = (string)message.values[0];
}
}
}
}

View File

@ -1,333 +0,0 @@
/*
* ExternalReceiver
* https://sabowl.sakura.ne.jp/gpsnmeajp/
*
* MIT License
*
* Copyright (c) 2019 gpsnmeajp
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#pragma warning disable 0414,0219
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.Profiling;
namespace EVMC4U
{
public class DeviceReceiver : MonoBehaviour, IExternalReceiver
{
const int arrayMax = 16;
[Header("DeviceReceiver v1.1")]
[SerializeField, Label("動作状況")]
private string StatusMessage = ""; //Inspector表示用
[SerializeField, Label("現実のトラッキング位置を反映")]
public bool RealPosition = false;
#if EVMC4U_JA
[Header("トラッキング設定")]
#else
[Header("Tracking Config")]
#endif
public string[] Serials = new string[arrayMax];
public Transform[] Transforms = new Transform[arrayMax];
#if EVMC4U_JA
[Header("トラッキングデバイス情報モニタ(表示用)")]
#else
[Header("Tracking Device Monitor")]
#endif
public string[] Types = new string[arrayMax];
public Vector3[] Vector3s = new Vector3[arrayMax];
#if EVMC4U_JA
[Header("デイジーチェーン")]
#else
[Header("Daisy Chain")]
#endif
public GameObject[] NextReceivers = new GameObject[1];
private ExternalReceiverManager externalReceiverManager = null;
bool shutdown = false;
Dictionary<string, int> SerialIndexes = new Dictionary<string, int>();
int ListIndex = 0;
//メッセージ処理一時変数struct(負荷対策)
Vector3 pos;
Quaternion rot;
void Start()
{
externalReceiverManager = new ExternalReceiverManager(NextReceivers);
StatusMessage = "Waiting for Master...";
//モニタ強制
Types = new string[Serials.Length];
Vector3s = new Vector3[Serials.Length];
//登録処理
ListIndex = 0;
for (int i = 0; i < Serials.Length; i++)
{
//nullでも空白でもない場合(対象がある場合)
if (Serials[i] != null && Serials[i] != "")
{
//辞書に登録
SerialIndexes.Add(Serials[i], ListIndex);
//インデックスを更新
ListIndex++;
}
}
}
//デイジーチェーンを更新
public void UpdateDaisyChain()
{
externalReceiverManager.GetIExternalReceiver(NextReceivers);
}
public void MessageDaisyChain(ref uOSC.Message message, int callCount)
{
//Startされていない場合無視
if (externalReceiverManager == null || enabled == false || gameObject.activeInHierarchy == false)
{
return;
}
if (shutdown)
{
return;
}
StatusMessage = "OK";
//異常を検出して動作停止
try
{
ProcessMessage(ref message);
}
catch (Exception e)
{
StatusMessage = "Error: Exception";
Debug.LogError(" --- Communication Error ---");
Debug.LogError(e.ToString());
shutdown = true;
return;
}
if (!externalReceiverManager.SendNextReceivers(message, callCount))
{
StatusMessage = "Infinite loop detected!";
shutdown = true;
}
}
private void ProcessMessage(ref uOSC.Message message)
{
//メッセージアドレスがない、あるいはメッセージがない不正な形式の場合は処理しない
if (message.address == null || message.values == null)
{
StatusMessage = "Bad message.";
return;
}
if (!RealPosition)
{
if (message.address == "/VMC/Ext/Hmd/Pos"
&& (message.values[0] is string)
&& (message.values[1] is float)
&& (message.values[2] is float)
&& (message.values[3] is float)
&& (message.values[4] is float)
&& (message.values[5] is float)
&& (message.values[6] is float)
&& (message.values[7] is float)
)
{
pos.x = (float)message.values[1];
pos.y = (float)message.values[2];
pos.z = (float)message.values[3];
rot.x = (float)message.values[4];
rot.y = (float)message.values[5];
rot.z = (float)message.values[6];
rot.w = (float)message.values[7];
devideUpdate("HMD", (string)message.values[0], pos, rot);
//Debug.Log("HMD pos " + (string)message.values[0] + " : " + pos + "/" + rot);
}
// v2.2
else if (message.address == "/VMC/Ext/Con/Pos"
&& (message.values[0] is string)
&& (message.values[1] is float)
&& (message.values[2] is float)
&& (message.values[3] is float)
&& (message.values[4] is float)
&& (message.values[5] is float)
&& (message.values[6] is float)
&& (message.values[7] is float)
)
{
pos.x = (float)message.values[1];
pos.y = (float)message.values[2];
pos.z = (float)message.values[3];
rot.x = (float)message.values[4];
rot.y = (float)message.values[5];
rot.z = (float)message.values[6];
rot.w = (float)message.values[7];
devideUpdate("Controller", (string)message.values[0], pos, rot);
//Debug.Log("Con pos " + (string)message.values[0] + " : " + pos + "/" + rot);
}
// v2.2
else if (message.address == "/VMC/Ext/Tra/Pos"
&& (message.values[0] is string)
&& (message.values[1] is float)
&& (message.values[2] is float)
&& (message.values[3] is float)
&& (message.values[4] is float)
&& (message.values[5] is float)
&& (message.values[6] is float)
&& (message.values[7] is float)
)
{
pos.x = (float)message.values[1];
pos.y = (float)message.values[2];
pos.z = (float)message.values[3];
rot.x = (float)message.values[4];
rot.y = (float)message.values[5];
rot.z = (float)message.values[6];
rot.w = (float)message.values[7];
devideUpdate("Tracker", (string)message.values[0], pos, rot);
//Debug.Log("Tra pos " + (string)message.values[0] + " : " + pos + "/" + rot);
}
}
else {
if (message.address == "/VMC/Ext/Hmd/Pos/Local"
&& (message.values[0] is string)
&& (message.values[1] is float)
&& (message.values[2] is float)
&& (message.values[3] is float)
&& (message.values[4] is float)
&& (message.values[5] is float)
&& (message.values[6] is float)
&& (message.values[7] is float)
)
{
pos.x = (float)message.values[1];
pos.y = (float)message.values[2];
pos.z = (float)message.values[3];
rot.x = (float)message.values[4];
rot.y = (float)message.values[5];
rot.z = (float)message.values[6];
rot.w = (float)message.values[7];
devideUpdate("HMD", (string)message.values[0], pos, rot);
//Debug.Log("HMD pos " + (string)message.values[0] + " : " + pos + "/" + rot);
}
// v2.2
else if (message.address == "/VMC/Ext/Con/Pos/Local"
&& (message.values[0] is string)
&& (message.values[1] is float)
&& (message.values[2] is float)
&& (message.values[3] is float)
&& (message.values[4] is float)
&& (message.values[5] is float)
&& (message.values[6] is float)
&& (message.values[7] is float)
)
{
pos.x = (float)message.values[1];
pos.y = (float)message.values[2];
pos.z = (float)message.values[3];
rot.x = (float)message.values[4];
rot.y = (float)message.values[5];
rot.z = (float)message.values[6];
rot.w = (float)message.values[7];
devideUpdate("Controller", (string)message.values[0], pos, rot);
//Debug.Log("Con pos " + (string)message.values[0] + " : " + pos + "/" + rot);
}
// v2.2
else if (message.address == "/VMC/Ext/Tra/Pos/Local"
&& (message.values[0] is string)
&& (message.values[1] is float)
&& (message.values[2] is float)
&& (message.values[3] is float)
&& (message.values[4] is float)
&& (message.values[5] is float)
&& (message.values[6] is float)
&& (message.values[7] is float)
)
{
pos.x = (float)message.values[1];
pos.y = (float)message.values[2];
pos.z = (float)message.values[3];
rot.x = (float)message.values[4];
rot.y = (float)message.values[5];
rot.z = (float)message.values[6];
rot.w = (float)message.values[7];
devideUpdate("Tracker", (string)message.values[0], pos, rot);
//Debug.Log("Tra pos " + (string)message.values[0] + " : " + pos + "/" + rot);
}
}
}
void devideUpdate(string type, string serial, Vector3 pos, Quaternion rot)
{
//辞書に登録済み
if (SerialIndexes.ContainsKey(serial))
{
int i = SerialIndexes[serial];
//配列を更新
Types[i] = type;
Vector3s[i] = pos;
if (i < Transforms.Length && Transforms[i] != null)
{
Transforms[i].localPosition = pos;
Transforms[i].localRotation = rot;
}
}
else
{
//最大を超えたら登録しない
if (ListIndex < Serials.Length)
{
//辞書に未登録
//辞書に登録
Serials[ListIndex] = serial;
SerialIndexes.Add(serial, ListIndex);
//インデックスを更新
ListIndex++;
}
}
}
}
}

View File

@ -1,158 +0,0 @@
/*
* ExternalReceiver
* https://sabowl.sakura.ne.jp/gpsnmeajp/
*
* MIT License
*
* Copyright (c) 2020 gpsnmeajp
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#pragma warning disable 0414,0219
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.Profiling;
namespace EVMC4U
{
public class DirectionalLightReceiver : MonoBehaviour, IExternalReceiver
{
[Header("DirectionalLightReceiver v1.2")]
[SerializeField, Label("VMCディレクショナルライト制御同期Light")]
public Light VMCControlledLight = null; //VMCディレクショナルライト制御同期
[SerializeField, Label("動作状況")]
private string StatusMessage = ""; //Inspector表示用
#if EVMC4U_JA
[Header("デイジーチェーン")]
#else
[Header("Daisy Chain")]
#endif
public GameObject[] NextReceivers = new GameObject[1];
private ExternalReceiverManager externalReceiverManager = null;
bool shutdown = false;
Vector3 pos;
Quaternion rot;
Color col;
void Start()
{
externalReceiverManager = new ExternalReceiverManager(NextReceivers);
StatusMessage = "Waiting for Master...";
}
//デイジーチェーンを更新
public void UpdateDaisyChain()
{
externalReceiverManager.GetIExternalReceiver(NextReceivers);
}
void Update()
{
}
public void MessageDaisyChain(ref uOSC.Message message, int callCount)
{
//Startされていない場合無視
if (externalReceiverManager == null || enabled == false || gameObject.activeInHierarchy == false)
{
return;
}
if (shutdown)
{
return;
}
StatusMessage = "OK";
//異常を検出して動作停止
try
{
ProcessMessage(ref message);
}
catch (Exception e)
{
StatusMessage = "Error: Exception";
Debug.LogError(" --- Communication Error ---");
Debug.LogError(e.ToString());
shutdown = true;
return;
}
if (!externalReceiverManager.SendNextReceivers(message, callCount))
{
StatusMessage = "Infinite loop detected!";
shutdown = true;
}
}
private void ProcessMessage(ref uOSC.Message message)
{
//メッセージアドレスがない、あるいはメッセージがない不正な形式の場合は処理しない
if (message.address == null || message.values == null)
{
StatusMessage = "Bad message.";
return;
}
//ライト同期 v2.4
if (message.address == "/VMC/Ext/Light"
&& (message.values[0] is string) //name
&& (message.values[1] is float) //pos.x
&& (message.values[2] is float) //poy.y
&& (message.values[3] is float) //pos.z
&& (message.values[4] is float) //q.x
&& (message.values[5] is float) //q.y
&& (message.values[6] is float) //q.z
&& (message.values[7] is float) //q.w
&& (message.values[8] is float) //r
&& (message.values[9] is float) //g
&& (message.values[10] is float) //b
&& (message.values[11] is float) //a
)
{
if(VMCControlledLight != null && VMCControlledLight.transform != null)
{
pos.x = (float)message.values[1];
pos.y = (float)message.values[2];
pos.z = (float)message.values[3];
rot.x = (float)message.values[4];
rot.y = (float)message.values[5];
rot.z = (float)message.values[6];
rot.w = (float)message.values[7];
col.r = (float)message.values[8];
col.g = (float)message.values[9];
col.b = (float)message.values[10];
col.a = (float)message.values[11];
VMCControlledLight.transform.localPosition = pos;
VMCControlledLight.transform.localRotation = rot;
VMCControlledLight.color = col;
}
}
}
}
}

View File

@ -1,53 +0,0 @@
/*
* ExternalReceiver
* https://sabowl.sakura.ne.jp/gpsnmeajp/
*
* MIT License
*
* Copyright (c) 2020 gpsnmeajp
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
namespace EVMC4U
{
[CustomEditor(typeof(ExternalReceiver))]
public class ExternalReceiverEditor : Editor
{
public override void OnInspectorGUI()
{
#if EVMC4U_JA
if (GUILayout.Button("説明書を開く"))
{
Tutorial.Open();
}
#else
if (GUILayout.Button("Open Manual"))
{
Tutorial.Open();
}
#endif
base.OnInspectorGUI();
}
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 8377d1e33297dac458dca9e5f91a8cc4
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Binary file not shown.

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 72e1f7be484f4a049a6925bd9ab160d3
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Binary file not shown.

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: fc1e38df2f2e3cb4e8790360fa9c40dd
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Binary file not shown.

View File

@ -1,104 +0,0 @@
fileFormatVersion: 2
guid: 8a9a093e2909a574b8a69a9c0d032158
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 2
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -1,104 +0,0 @@
fileFormatVersion: 2
guid: 1e9c002a5915b0c41bce8813c859270f
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 2
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 3cf99d0802e7abd41b513dd6ece2b371
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -1,104 +0,0 @@
fileFormatVersion: 2
guid: 8bd00136add62bd44b0c7692a8abd17d
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 2
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -1,104 +0,0 @@
fileFormatVersion: 2
guid: 481805f552d5a1c42866f2c76e80d9d1
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 2
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -1,104 +0,0 @@
fileFormatVersion: 2
guid: efbc73509d25aea43aa7e5f70fb49c3b
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 2
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: a83f9e79c7345284988cabbd2ef406b6
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -1,104 +0,0 @@
fileFormatVersion: 2
guid: f0c4f23b400062b4293d2cdd97b02503
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 2
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -1,104 +0,0 @@
fileFormatVersion: 2
guid: 3b776da16c770c8478ca233bef64f2b1
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 2
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 4a63eda723d10ef4cac2d457e66fc2ef
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -1,104 +0,0 @@
fileFormatVersion: 2
guid: 436fee3bd2ead154f87f05481d675208
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 2
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -1,104 +0,0 @@
fileFormatVersion: 2
guid: 803fc02753744be4fbfebcd748d5c12a
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 2
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -1,104 +0,0 @@
fileFormatVersion: 2
guid: ae1ea106244ca354f903f9b7c235398f
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 2
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,377 +0,0 @@
/*
* ExternalReceiver
* https://sabowl.sakura.ne.jp/gpsnmeajp/
*
* MIT License
*
* Copyright (c) 2020-2022 gpsnmeajp
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#pragma warning disable CS0162
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using UnityEngine;
using UnityEditor;
using UnityEditor.AnimatedValues;
using UnityEngine.Events;
using System.Linq;
namespace EVMC4U
{
public class Tutorial : EditorWindow
{
const bool check = false; //バージョンチェック条件式があったが、バージョン番号がなくなったので無効化
const int window_w = 400;
const int window_h = 400;
//ページ名
static string page = "";
//ボタン押下アニメーション
static AnimFloat anim = new AnimFloat(0.001f);
static string animTargetName = ""; //1つのボタンだけアニメさせる識別名
static string jsonError = "";
static TutorialJson tutorialJson = null;
static Dictionary<string, TutorialPage> tutorialPages = new Dictionary<string, TutorialPage>();
//JSON設定ファイル定義
[Serializable]
private class TutorialJson
{
public bool debug;
public TutorialPage[] pages;
public override string ToString()
{
return "TutorialJson debug:" + debug + " pages:" + pages.Length;
}
}
//JSONページ定義
[Serializable]
private class TutorialPage
{
public string name = "";
public string text = "";
public string image = "";
public TutorialButton[] buttons = new TutorialButton[0];
public override string ToString()
{
return "TutorialPage name:" + name + " text:" + text + " iamge:" + image + " buttons:" + buttons.Length;
}
}
//JSONボタン定義
[Serializable]
private class TutorialButton
{
public int x = 0;
public int y = 0;
public int w = 0;
public int h = 0;
public string text = "";
public string image = "";
public string uri = ""; //"page://" = page, "http://" or "https://" = url
public string fire = ""; //event
public override string ToString()
{
return "TutorialButton (" + x + "," + y + "," + w + "," + h + ") text:" + text + " image:" + image + " uri:" + uri;
}
}
[InitializeOnLoadMethod]
static void InitializeOnLoad()
{
//一度も開いたことない場合は、ここで開く
if (EditorUserSettings.GetConfigValue("Opened") != "1" || (check && EditorUserSettings.GetConfigValue("VRMCheckCaution") != "1"))
{
Open();
}
}
[MenuItem("EVMC4U/Oepn Tutorial")]
public static void Open()
{
//ウィンドウサイズを固定
var window = GetWindow<Tutorial>();
window.maxSize = new Vector2(window_w, window_h - 6);
window.minSize = window.maxSize;
//アニメーション定義
anim.value = 0.001f;
anim.speed = 10f;
anim.target = 0.001f;
anim.valueChanged = null;
if (Resources.Load<TextAsset>("tutorial/define") == null)
{
//読み込み準備ができていない
return;
}
//ページを初期位置に設定
page = "start";
if (EditorUserSettings.GetConfigValue("Language") == "ja")
{
page = "start_ja";
}
if (EditorUserSettings.GetConfigValue("Language") == "en")
{
page = "start_en";
}
//データを読み込む
tutorialPages = new Dictionary<string, TutorialPage>();
try
{
jsonError = "";
var r = Resources.Load<TextAsset>("tutorial/define");
tutorialJson = JsonUtility.FromJson<TutorialJson>(r.text);
if (tutorialJson.debug)
{
Debug.Log(tutorialJson);
}
//各ページのデータを読み込む
foreach (var p in tutorialJson.pages)
{
tutorialPages.Add(p.name, p);
if (tutorialJson.debug)
{
Debug.Log(p);
}
}
//一度開いたのを覚えておく
EditorUserSettings.SetConfigValue("Opened", "1");
}
catch (ArgumentException e)
{
//Debug.LogError(e);
jsonError = e.ToString();
tutorialJson = null;
}
//バージョンチェック(失敗したら失敗ページに飛ばす)
if (check)
{
EditorUserSettings.SetConfigValue("VRMCheckCaution", "1");
page = "versionCheckFailed";
}
else
{
EditorUserSettings.SetConfigValue("VRMCheckCaution", "0");
}
}
[MenuItem("EVMC4U/Reset Language")]
public static void ResetLanguage()
{
EditorUserSettings.SetConfigValue("Language", "");
Open();
}
void OnGUI()
{
//ページを開いたまま初期化されたら、初期ロード処理に飛ばす
if (page == "")
{
GUI.Label(new Rect(10, 10, window_w, window_h), "INVALID STATE\n\nチュートリアルの読み込みに失敗しました。Unityを再起動してください。\nそれでもダメな場合は、UnityPackageの導入からやり直してみてください\n\nTutorial load failed.\nPlease restart Unity.\nor Please re-import UnityPackage.");
Open();
return;
}
//アニメーションを立ち上げる
if (anim.valueChanged == null)
{
var repaintEvent = new UnityEvent();
repaintEvent.AddListener(() => Repaint());
anim.valueChanged = repaintEvent;
}
//アニメーション折り返し
if (anim.value > anim.target - 0.1f)
{
anim.target = 0.001f;
}
//ページの表示処理を開始
TutorialPage tutorialPage;
if (!tutorialPages.TryGetValue(page, out tutorialPage))
{
//JSONが多分バグってるときに表示
GUI.Label(new Rect(10, 10, window_w - 20, window_h), "JSON LOAD FAILED\n" + jsonError + "\n\nチュートリアルの読み込みに失敗しました。Unityを再起動してください。\nそれでもダメな場合は、UnityPackageの導入からやり直してみてください\n\nTutorial load failed.\nPlease restart Unity.\nor Please re-import UnityPackage.");
if (GUI.Button(new Rect(0, window_h - 30, window_w, 30), "Reload"))
{
Open();
}
return;
}
//デバッグログ
if (tutorialJson.debug)
{
Debug.Log("OnGUI: " + anim.value);
Debug.Log(tutorialPage);
}
//背景画像があれば表示
if (tutorialPage.image != "")
{
var bgtexture = Resources.Load<Texture>("tutorial/" + tutorialPage.image);
EditorGUI.DrawPreviewTexture(new Rect(0, 0, window_w, window_h), bgtexture);
}
//ページのテキストを表示(代替テキスト)
GUI.Label(new Rect(0, 0, window_w, window_h), tutorialPage.text);
//ボタンを1つずつ表示
foreach (var b in tutorialPage.buttons)
{
if (tutorialJson.debug)
{
Debug.Log(b);
}
//ボタンに画像があればそれを表示
if (b.image != "")
{
//画像を読み込む
var texture = Resources.Load<Texture>("tutorial/" + b.image);
//位置情報がない場合、下端として扱う
if (b.x == 0 && b.y == 0 && b.w == 0 && b.h == 0)
{
b.y = window_h - window_w * texture.height / texture.width;
b.w = window_w;
}
string buttonName = "btn#" + page + "#" + b.x + "-" + b.y + "-" + b.w + "-" + b.h;
float height = b.w * texture.height / texture.width;
Rect r = new Rect(b.x, b.y, b.w, height);
//アニメ対象の場合だけ動く
if (buttonName == animTargetName)
{
r = new Rect(b.x + anim.value, b.y + anim.value, b.w, height);
}
//ボタンを表示
if (GUI.Button(r, texture, new GUIStyle()))
{
//アニメーション処理と、遷移を実行
buttonFireProcess(b.fire);
buttonUriProcess(b.uri);
animTargetName = buttonName;
anim.target = 2f;
}
}
else
{
//テキストボタンを表示
if (GUI.Button(new Rect(b.x, b.y, b.w, b.h), b.text))
{
buttonFireProcess(b.fire);
buttonUriProcess(b.uri);
}
}
}
//デバッグ再読み込みボタン
if (tutorialJson.debug)
{
if (GUI.Button(new Rect(0, window_h - 30, 30, 30), "#"))
{
Open();
}
}
}
void buttonUriProcess(string uri)
{
if (tutorialJson.debug)
{
Debug.LogWarning("buttonProcess: " + uri);
}
if (uri == null)
{
return;
}
if (uri.StartsWith("page://"))
{
page = uri.Replace("page://", "");
}
if (uri.StartsWith("http://") || uri.StartsWith("https://"))
{
System.Diagnostics.Process.Start(uri);
}
}
void buttonFireProcess(string fire)
{
switch (fire)
{
case "SaveLanguageJa":
{
EditorUserSettings.SetConfigValue("Language", "ja");
var symbols = PlayerSettings.GetScriptingDefineSymbolsForGroup(BuildTargetGroup.Standalone).Split(';').ToList();
if (symbols.Contains("EVMC4U_EN"))
{
symbols.Remove("EVMC4U_EN");
}
if (!symbols.Contains("EVMC4U_JA"))
{
symbols.Add("EVMC4U_JA");
}
PlayerSettings.SetScriptingDefineSymbolsForGroup(BuildTargetGroup.Standalone, String.Join(";", symbols.ToArray()));
break;
}
case "SaveLanguageEn":
{
EditorUserSettings.SetConfigValue("Language", "en");
var symbols = PlayerSettings.GetScriptingDefineSymbolsForGroup(BuildTargetGroup.Standalone).Split(';').ToList();
if (symbols.Contains("EVMC4U_JA"))
{
symbols.Remove("EVMC4U_JA");
}
if (!symbols.Contains("EVMC4U_EN"))
{
symbols.Add("EVMC4U_EN");
}
PlayerSettings.SetScriptingDefineSymbolsForGroup(BuildTargetGroup.Standalone, String.Join(";", symbols.ToArray()));
break;
}
default: break;
}
}
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 3239c5d6ed07cd84a95fd80d1659dcce
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,199 +0,0 @@
/*
* ExternalReceiver
* https://sabowl.sakura.ne.jp/gpsnmeajp/
*
* MIT License
*
* Copyright (c) 2020 gpsnmeajp
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#pragma warning disable 0414,0219
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.Profiling;
namespace EVMC4U
{
[RequireComponent(typeof(uOSC.uOscClient))]
public class ExternalController : MonoBehaviour
{
[Header("ExternalController v1.0")]
public bool enable = true;
[Header("Frame Period")]
public int PeriodOfStatus = 1;
public int PeriodOfRoot = 1;
public int PeriodOfBone = 1;
public int PeriodOfBlendShape = 1;
public int PeriodOfCamera = 1;
public int PeriodOfDevices = 1;
public bool PeriodEnable = false;
[Header("Virtual Device")]
public VirtualDevice DeviceMode = VirtualDevice.Tracker;
public Transform DeviceTransform = null;
public String DeviceSerial = "VIRTUAL_DEVICE";
public bool DeviceEnable = false;
[Header("Virtual MIDI CC")]
public int MidiKnob = 0;
public float MidiValue = 0f;
public bool MidiEnable = false;
[Header("Camera Control")]
public Transform CameraTransform = null;
public float CameraFOV = 30f;
public bool CameraEnable = false;
[Header("BlendShapeProxy")]
public string BlendShapeName = "";
public float BlendShapeValue = 0f;
public bool BlendShapeEnable = false;
[Header("Eye Tracking Target Position")]
public Transform EyeTrackingTargetTransform = null;
public bool EyeTrackingTargetUse = false;
public bool EyeTrackingTargetEnable = false;
[Header("Response String")]
public string ResponseString = "";
public bool ResponseStringEnable = false;
[Header("Calibration")]
public bool CalibrationReady = false;
public CalibrationMode calibrationMode = 0;
public bool CalibrationExecute = false;
[Header("Config")]
public string ConfigPath = "";
public bool ConfigLoad = false;
[Header("Request Information")]
public bool RequestInformation = false;
uOSC.uOscClient client = null;
void Start()
{
client = GetComponent<uOSC.uOscClient>();
}
void Update()
{
if (client == null) {
return;
}
if (!enable) {
return;
}
if (PeriodEnable) {
client.Send("/VMC/Ext/Set/Period", PeriodOfStatus, PeriodOfRoot, PeriodOfBone, PeriodOfBlendShape, PeriodOfCamera, PeriodOfDevices);
}
if (DeviceEnable) {
string name = null;
switch (DeviceMode) {
case VirtualDevice.HMD:
name = "/VMC/Ext/Hmd/Pos";
break;
case VirtualDevice.Controller:
name = "/VMC/Ext/Con/Pos";
break;
case VirtualDevice.Tracker:
name = "/VMC/Ext/Tra/Pos";
break;
default:
name = null;
break;
}
if (name != null && DeviceTransform != null && DeviceSerial != null) {
client.Send(name,
(string)DeviceSerial,
(float)DeviceTransform.position.x,
(float)DeviceTransform.position.y,
(float)DeviceTransform.position.z,
(float)DeviceTransform.rotation.x,
(float)DeviceTransform.rotation.y,
(float)DeviceTransform.rotation.z,
(float)DeviceTransform.rotation.w);
}
}
if (MidiEnable)
{
client.Send("/VMC/Ext/Midi/CC/Val", MidiKnob, MidiValue);
}
if (CameraEnable)
{
client.Send("/VMC/Ext/Cam",
"Camera",
(float)CameraTransform.position.x,
(float)CameraTransform.position.y,
(float)CameraTransform.position.z,
(float)CameraTransform.rotation.x,
(float)CameraTransform.rotation.y,
(float)CameraTransform.rotation.z,
(float)CameraTransform.rotation.w,
(float)CameraFOV);
}
if (BlendShapeEnable)
{
client.Send("/VMC/Ext/Blend/Val", BlendShapeName, BlendShapeValue);
client.Send("/VMC/Ext/Blend/Apply");
}
if (EyeTrackingTargetEnable)
{
client.Send("/VMC/Ext/Set/Eye",
EyeTrackingTargetUse?(int)1: (int)0,
(float)EyeTrackingTargetTransform.position.x,
(float)EyeTrackingTargetTransform.position.y,
(float)EyeTrackingTargetTransform.position.z);
}
if (ResponseStringEnable)
{
client.Send("/VMC/Ext/Set/Res", ResponseString);
}
if (CalibrationReady)
{
CalibrationReady = false;
client.Send("/VMC/Ext/Set/Calib/Ready");
}
if (CalibrationExecute)
{
CalibrationExecute = false;
client.Send("/VMC/Ext/Set/Calib/Exec", (int)calibrationMode);
}
if (ConfigLoad)
{
ConfigLoad = false;
client.Send("/VMC/Ext/Set/Config", ConfigPath);
}
if (RequestInformation)
{
//毎フレーム送信要求をする
client.Send("/VMC/Ext/Set/Req");
}
}
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: e3c76998320436b479e734d3703c3abc
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: b2b1a1db52b2afb4e9cb87fac5cbf079
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

BIN
Assets/External/EVMC4U/ExternalReceiver.prefab (Stored with Git LFS) vendored

Binary file not shown.

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 86b1e8192cb57cd47890882526664df1
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

BIN
Assets/External/EVMC4U/ExternalReceiver.unity (Stored with Git LFS) vendored

Binary file not shown.

View File

@ -1,268 +0,0 @@
/*
* ExternalReceiver
* https://sabowl.sakura.ne.jp/gpsnmeajp/
*
* MIT License
*
* Copyright (c) 2019 gpsnmeajp
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#pragma warning disable 0414,0219
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.Profiling;
namespace EVMC4U
{
public class InputReceiver : MonoBehaviour, IExternalReceiver
{
[Header("InputReceiver v1.1")]
[SerializeField, Label("動作状況")]
private string StatusMessage = ""; //Inspector表示用
[SerializeField, Label("最終入力")]
private string LastInput = "";
#if EVMC4U_JA
[Header("入力イベント")]
#else
[Header("Event Callback")]
#endif
public KeyInputEvent KeyInputAction = new KeyInputEvent(); //キーボード入力イベント
public ControllerInputEvent ControllerInputAction = new ControllerInputEvent(); //コントローラボタンイベント
public MidiNoteInputEvent MidiNoteInputAction = new MidiNoteInputEvent();
public MidiCCValueInputEvent MidiCCValueInputAction = new MidiCCValueInputEvent();
public MidiCCButtonInputEvent MidiCCButtonInputAction = new MidiCCButtonInputEvent();
#if EVMC4U_JA
[Header("MIDI CC モニタ(つまみ、ボタン)")]
#else
[Header("MIDI CC Monitor")]
#endif
public float[] CCValuesMonitor = new float[128];
#if EVMC4U_JA
[Header("デイジーチェーン")]
#else
[Header("Daisy Chain")]
#endif
public GameObject[] NextReceivers = new GameObject[1];
//---
//入力辞書(コールバックではなく定値で取得したい場合に使う)
public Dictionary<string, bool> InputDictionary = new Dictionary<string, bool>();
//---
private ExternalReceiverManager externalReceiverManager = null;
bool shutdown = false;
//メッセージ処理一時変数struct(負荷対策)
ControllerInput con;
KeyInput key;
MidiNote note;
MidiCCValue ccvalue;
MidiCCButton ccbutton;
void Start()
{
externalReceiverManager = new ExternalReceiverManager(NextReceivers);
StatusMessage = "Waiting for Master...";
//強制
CCValuesMonitor = new float[128];
}
//デイジーチェーンを更新
public void UpdateDaisyChain()
{
externalReceiverManager.GetIExternalReceiver(NextReceivers);
}
public void MessageDaisyChain(ref uOSC.Message message, int callCount)
{
//Startされていない場合無視
if (externalReceiverManager == null || enabled == false || gameObject.activeInHierarchy == false)
{
return;
}
if (shutdown)
{
return;
}
StatusMessage = "OK";
//異常を検出して動作停止
try
{
ProcessMessage(ref message);
}
catch (Exception e)
{
StatusMessage = "Error: Exception";
Debug.LogError(" --- Communication Error ---");
Debug.LogError(e.ToString());
shutdown = true;
return;
}
if (!externalReceiverManager.SendNextReceivers(message, callCount))
{
StatusMessage = "Infinite loop detected!";
shutdown = true;
}
}
private void ProcessMessage(ref uOSC.Message message)
{
//メッセージアドレスがない、あるいはメッセージがない不正な形式の場合は処理しない
if (message.address == null || message.values == null)
{
StatusMessage = "Bad message.";
return;
}
//コントローラ操作情報 v2.1
if (message.address == "/VMC/Ext/Con"
&& (message.values[0] is int)
&& (message.values[1] is string)
&& (message.values[2] is int)
&& (message.values[3] is int)
&& (message.values[4] is int)
&& (message.values[5] is float)
&& (message.values[6] is float)
&& (message.values[7] is float)
)
{
con.active = (int)message.values[0];
con.name = (string)message.values[1];
con.IsLeft = (int)message.values[2];
con.IsTouch = (int)message.values[3];
con.IsAxis = (int)message.values[4];
con.Axis.x = (float)message.values[5];
con.Axis.y = (float)message.values[6];
con.Axis.z = (float)message.values[7];
//イベントを呼び出す
if (ControllerInputAction != null)
{
ControllerInputAction.Invoke(con);
}
if (con.IsAxis == 0) {
if (con.IsLeft == 1)
{
LastInput = "Left-" + con.name + " = " + con.active;
InputDictionary["Left-" + con.name] = (con.active != 0);
}
else
{
LastInput = "Right-" + con.name + " = " + con.active;
InputDictionary["Right-" + con.name] = (con.active != 0);
}
}
}
//キーボード操作情報 v2.1
else if (message.address == "/VMC/Ext/Key"
&& (message.values[0] is int)
&& (message.values[1] is string)
&& (message.values[2] is int)
)
{
key.active = (int)message.values[0];
key.name = (string)message.values[1];
key.keycode = (int)message.values[2];
//イベントを呼び出す
if (KeyInputAction != null)
{
KeyInputAction.Invoke(key);
}
LastInput = "Key-" + key.name +" = "+key.active + " (" + key.keycode + ")";
}
// v2.2
else if (message.address == "/VMC/Ext/Midi/Note"
&& (message.values[0] is int)
&& (message.values[1] is int)
&& (message.values[2] is int)
&& (message.values[3] is float)
)
{
note.active = (int)message.values[0];
note.channel = (int)message.values[1];
note.note = (int)message.values[2];
note.velocity = (float)message.values[3];
//イベントを呼び出す
if (MidiNoteInputAction != null)
{
MidiNoteInputAction.Invoke(note);
}
LastInput = "Note-" + note.note + " = "+note.active + "/" + note.channel + "/" + note.velocity;
InputDictionary["Note-" + note.note] = (note.active != 0);
}
// v2.2
else if (message.address == "/VMC/Ext/Midi/CC/Val"
&& (message.values[0] is int)
&& (message.values[1] is float)
)
{
ccvalue.knob = (int)message.values[0];
ccvalue.value = (float)message.values[1];
//イベントを呼び出す
if (MidiCCValueInputAction != null)
{
MidiCCValueInputAction.Invoke(ccvalue);
}
LastInput = "CC Val " + ccvalue.knob + " = " + ccvalue.value;
if (ccvalue.knob >= 0 && ccvalue.knob < 128) {
CCValuesMonitor[ccvalue.knob] = ccvalue.value;
}
}
// v2.2
else if (message.address == "/VMC/Ext/Midi/CC/Bit"
&& (message.values[0] is int)
&& (message.values[1] is int)
)
{
ccbutton.knob = (int)message.values[0];
ccbutton.active = (int)message.values[1];
//イベントを呼び出す
if (MidiCCButtonInputAction != null)
{
MidiCCButtonInputAction.Invoke(ccbutton);
}
LastInput = "CC-" + ccbutton.knob + " = " + ccbutton.active;
InputDictionary["CC-" + ccbutton.knob] = (ccbutton.active != 0);
}
}
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: b7b6344b39082f64e8111bc0fd99f9c2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) 2019-2020 gpsnmeajp
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: fe826b9d334c93e4ca357d6af02179cc
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: d554b7baaffa0cf4c907cd10362bf827
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,44 +0,0 @@
/*
* ExternalReceiver
* https://sabowl.sakura.ne.jp/gpsnmeajp/
*
* MIT License
*
* Copyright (c) 2019 gpsnmeajp
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace EVMC4U
{
public class CCCameraControl : MonoBehaviour
{
public InputReceiver r;
public Camera c;
private void Update()
{
c.fieldOfView = r.CCValuesMonitor[16] * 90 + 1;
c.transform.position = new Vector3((r.CCValuesMonitor[0] - 0.5f) * 3f, (r.CCValuesMonitor[1] - 0.5f) * 3f, (r.CCValuesMonitor[2]-0.5f)*3f);
c.transform.rotation = Quaternion.Euler(r.CCValuesMonitor[3]*360f, r.CCValuesMonitor[4] * 360f, r.CCValuesMonitor[5] * 360f);
}
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 38cb49d414319034c9a457279ea5133f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 7af78563b203db9458af57d24f50e7b0
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,123 +0,0 @@
/*
* ExternalReceiver
* https://sabowl.sakura.ne.jp/gpsnmeajp/
*
* MIT License
*
* Copyright (c) 2020 gpsnmeajp
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using EVMC4U;
public class CalibrationByController : MonoBehaviour
{
public InputReceiver inputReceiver;
public CommunicationValidator communicationValidator;
public ExternalController externalController;
[Header("Button Configuration")]
public string Key = "ScrollLock";
public string Button = "ClickAbutton";
[Header("Time Configuration")]
public float Time = 3f;
[Header("Button Monitor")]
public bool LeftButton = false;
public bool RightButton = false;
readonly Rect rect1 = new Rect(0, 0, 300, 40);
void Start()
{
inputReceiver.KeyInputAction.AddListener(OnKey);
inputReceiver.ControllerInputAction.AddListener(OnCon);
}
void OnGUI()
{
if (communicationValidator.calibrationState == CalibrationState.Uncalibrated)
{
GUI.TextField(rect1, "★キャリブレーションを待っています\n準備ができたらボタンを押してください");
}
if (communicationValidator.calibrationState == CalibrationState.WaitingForCalibrating)
{
GUI.TextField(rect1, "★姿勢を整えてください");
}
if (communicationValidator.calibrationState == CalibrationState.Calibrating)
{
GUI.TextField(rect1, "!動かないでください!");
}
}
void OnKey(KeyInput key)
{
if (key.name == Key && key.active == 1)
{
CalibrationReady();
}
}
void OnCon(ControllerInput con)
{
if (con.name == Button)
{
if (con.IsLeft == 1)
{
LeftButton = (con.active == 1);
}
else {
RightButton = (con.active == 1);
}
if (LeftButton && RightButton) {
//キャリブレーションできていないときのみ実行
if (communicationValidator.calibrationState == CalibrationState.Uncalibrated)
{
CalibrationReady();
}
LeftButton = false;
RightButton = false;
}
}
}
void CalibrationReady()
{
Debug.Log("[CalibrationByController] CalibrationReady");
//多重キャリブレーション時の不良動作対処に、2回キャリブレーション要求する
externalController.CalibrationReady = true;
Invoke("CalibrationReady2", 0.5f);
}
void CalibrationReady2() {
Debug.Log("[CalibrationByController] CalibrationReady");
externalController.CalibrationReady = true;
Invoke("CalibrationExecute", Time);
}
void CalibrationExecute() {
Debug.Log("[CalibrationByController] CalibrationExecute");
//キャリブレーション実施
externalController.CalibrationExecute = true;
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: a57104fd6abed25418f0b912791d8f6d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 46a4a79844c54ef45967f469e02791ed
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,117 +0,0 @@
/*
* ExternalReceiver
* https://sabowl.sakura.ne.jp/gpsnmeajp/
*
* MIT License
*
* Copyright (c) 2019 gpsnmeajp
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace EVMC4U
{
public class CapsuleRigidbodyMover : MonoBehaviour
{
public Transform MovePos;
public Transform MoveRot;
public Transform chest;
EDirection direction = EDirection.STOP;
bool click = false;
enum EDirection {
STOP,
FORWARD,
BACK,
LEFT,
RIGHT
}
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
switch (direction) {
case EDirection.FORWARD: MovePos.position += chest.forward * 10f * Time.deltaTime; break;
case EDirection.BACK: MovePos.position += chest.forward * -10f * Time.deltaTime; break;
case EDirection.LEFT: MoveRot.Rotate(new Vector3(0, -100f * Time.deltaTime, 0)); break;
case EDirection.RIGHT: MoveRot.Rotate(new Vector3(0, 100f * Time.deltaTime, 0)); break;
default: break;
}
}
public void KeyInputEvent(EVMC4U.KeyInput key)
{
if (key.active == 1)
{
switch (key.name) {
case "W": direction = EDirection.FORWARD; break;
case "S": direction = EDirection.BACK; break;
case "A": direction = EDirection.LEFT; break;
case "D": direction = EDirection.RIGHT; break;
}
}else{
direction = 0;
}
}
public void ControllerInputEvent(EVMC4U.ControllerInput con)
{
if (con.name == "PositionTrackpad")
{
if (con.IsAxis == 1)
{
var rot = Mathf.Atan2(con.Axis.x, con.Axis.y) * Mathf.Rad2Deg;
if (-45 <= rot && rot < 45)
{
direction = EDirection.FORWARD;
}
else if (45 <= rot && rot < 135)
{
direction = EDirection.RIGHT;
}
else if (-135 <= rot && rot < -45)
{
direction = EDirection.LEFT;
}
else
{
direction = EDirection.BACK;
}
}
}
if(con.name == "ClickTrackpad")
{
click = con.active == 1;
}
if (!click)
{
direction = EDirection.STOP;
}
}
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 8f1fc480ff691e345af16e7fa651417e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 86b6989340add9447bb256f0c003b57f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,43 +0,0 @@
/*
* ExternalReceiver
* https://sabowl.sakura.ne.jp/gpsnmeajp/
*
* MIT License
*
* Copyright (c) 2020 gpsnmeajp
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using EVMC4U;
public class DeviceAttacher: MonoBehaviour {
public DeviceReceiver deviceReceiver;
public string DeviceSerial = null;
void Update () {
for (int i = 0; i < deviceReceiver.Serials.Length; i++) {
if (deviceReceiver.Serials[i] == DeviceSerial) {
deviceReceiver.Transforms[i] = transform;
}
}
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 6adc09d226c320b47931ccca7db11d22
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: e3ab1687368e7234191bef23b011eda6
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,64 +0,0 @@
/*
* ExternalReceiver
* https://sabowl.sakura.ne.jp/gpsnmeajp/
*
* MIT License
*
* Copyright (c) 2019 gpsnmeajp
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace EVMC4U
{
public class FreezeSwitch : MonoBehaviour
{
public ExternalReceiver externalReceiver;
public InputReceiver inputReceiver;
public string Key= "スペース";
public string Button= "ClickMenu";
void Start()
{
inputReceiver.KeyInputAction.AddListener(OnKey);
inputReceiver.ControllerInputAction.AddListener(OnCon);
}
void OnKey(KeyInput key)
{
if (key.name == Key) {
if (key.active == 1) {
externalReceiver.Freeze = !externalReceiver.Freeze;
}
}
}
void OnCon(ControllerInput con)
{
if (con.name == Button)
{
if (con.active == 1)
{
externalReceiver.Freeze = !externalReceiver.Freeze;
}
}
}
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 97fd16077045a25459ca9b9ad21be3e3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 1ba7b15a3117ea446a06b3d34fa9b5e1
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,412 +0,0 @@
/*
* ExternalReceiver
* https://sabowl.sakura.ne.jp/gpsnmeajp/
*
* MIT License
*
* Copyright (c) 2019 gpsnmeajp
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace EVMC4U
{
[RequireComponent(typeof(ExternalReceiver))]
public class HandCatch : MonoBehaviour
{
//表示オンオフ
public bool ShowCollider = true;
bool ShowColliderOld = true;
public float NonHoldFilter = 0f;
public float InHoldFilter = 0.90f;
float offset = 0.06f;
float size = 0.15f;
public string CollisionTag = "";
public float SpeedMultiplier = 1.0f;
public string LeftKey = "Z";
public string RightKey = "X";
public string ControllerButton = "ClickTrigger";
public bool signaling = true;
public bool StickyMode = false;
bool stickyLeft = false;
bool stickyRight = false;
ExternalReceiver exrcv;
InputReceiver inputrcv;
Transform leftHand;
Transform rightHand;
GameObject leftSphere;
GameObject rightSphere;
Rigidbody leftRigidBody;
Rigidbody rightRigidBody;
Vector3 leftLastPos;
Vector3 rightLastPos;
Vector3 leftLastSpeed;
Vector3 rightLastSpeed;
HandCatch_Helper leftHelper;
HandCatch_Helper rightHelper;
GameObject leftCatchedObject;
GameObject rightCatchedObject;
bool leftCatchedObjectIsKinematic;
bool rightCatchedObjectIsKinematic;
Transform leftCatchedObjectParent;
Transform rightCatchedObjectParent;
void Start()
{
//ExternalReceiverにキー操作を登録
exrcv = GetComponent<EVMC4U.ExternalReceiver>();
inputrcv = GetComponentInChildren<EVMC4U.InputReceiver>();
inputrcv.ControllerInputAction.AddListener(ControllerInputEvent);
inputrcv.KeyInputAction.AddListener(KeyInputEvent);
//ブレ防止用にフィルタを設定
exrcv.BonePositionFilterEnable = true;
exrcv.BoneRotationFilterEnable = true;
exrcv.BoneFilter = NonHoldFilter;
//手のボーンを取得
var anim = exrcv.Model.GetComponent<Animator>();
leftHand = anim.GetBoneTransform(HumanBodyBones.LeftHand);
rightHand = anim.GetBoneTransform(HumanBodyBones.RightHand);
//左手当たり判定スフィア生成
leftSphere = GameObject.CreatePrimitive(PrimitiveType.Sphere);
leftSphere.transform.parent = leftHand;
leftSphere.transform.localPosition = new Vector3(-offset, 0f, 0f);
leftSphere.transform.localScale = new Vector3(size, size, size);
//左手当たり判定スフィアコライダー設定
var leftCollider = leftSphere.GetComponent<Collider>();
//コライダーは反応のみで衝突しない
leftCollider.isTrigger = true;
//左手当たり判定物理演算追加
leftRigidBody = leftSphere.AddComponent<Rigidbody>();
//物理は反応のみで演算しない
leftRigidBody.isKinematic = true;
//左手当たり判定ヘルパー追加
leftHelper = leftSphere.AddComponent<HandCatch_Helper>();
//右手当たり判定スフィア生成
rightSphere = GameObject.CreatePrimitive(PrimitiveType.Sphere);
rightSphere.transform.parent = rightHand;
rightSphere.transform.localPosition = new Vector3(offset, 0f, 0f);
rightSphere.transform.localScale = new Vector3(size, size, size);
//右手当たり判定スフィアコライダー設定
var rightCollider = rightSphere.GetComponent<Collider>();
//コライダーは反応のみで衝突しない
rightCollider.isTrigger = true;
//右手当たり判定物理演算追加
rightRigidBody = rightSphere.AddComponent<Rigidbody>();
//物理は反応のみで演算しない
rightRigidBody.isKinematic = true;
//右手当たり判定ヘルパー追加
rightHelper = rightSphere.AddComponent<HandCatch_Helper>();
}
//物理演算のためFixedUpdate
void FixedUpdate()
{
//剥がれ防止で親を設定
leftSphere.transform.parent = leftHand;
leftSphere.transform.localPosition = new Vector3(-offset, 0f, 0f);
leftSphere.transform.localScale = new Vector3(size, size, size);
rightSphere.transform.parent = rightHand;
rightSphere.transform.localPosition = new Vector3(offset, 0f, 0f);
rightSphere.transform.localScale = new Vector3(size, size, size);
//表示非表示を反映
if (ShowColliderOld != ShowCollider) {
leftSphere.GetComponent<MeshRenderer>().enabled = ShowCollider;
rightSphere.GetComponent<MeshRenderer>().enabled = ShowCollider;
ShowColliderOld = ShowCollider;
}
//投げるとき用にフレーム間速度を求める
leftLastSpeed = SpeedMultiplier * (leftHand.transform.position - leftLastPos)/Time.fixedDeltaTime;
leftLastPos = leftHand.transform.position;
rightLastSpeed = SpeedMultiplier * (rightHand.transform.position - rightLastPos)/Time.fixedDeltaTime;
rightLastPos = rightHand.transform.position;
}
//左手掴む処理
void CatchLeft(bool s)
{
if (s)
{
//つかみ処理
if (leftHelper.Trigger && leftHelper.other != null)
{
//コリジョンタグになにか文字が入っていて、対象と一致しない場合は処理しない
if (CollisionTag != "" && CollisionTag != leftHelper.other.tag) {
return;
}
//左手ですでに掴んでいるものは掴まない
if (leftHelper.other.gameObject.transform.parent == leftSphere.transform)
{
return;
}
//右手ですでに掴んでいるものは掴まない
if (leftHelper.other.gameObject.transform.parent == rightSphere.transform)
{
return;
}
//解除用に保持
leftCatchedObject = leftHelper.other.gameObject;
//親を保存
leftCatchedObjectParent = leftCatchedObject.transform.parent;
//手を親に上書き
leftCatchedObject.transform.parent = leftSphere.transform;
//掴むために物理演算を切る
var rigid = leftCatchedObject.GetComponent<Rigidbody>();
if (rigid != null) {
//IsKinematicを保存
leftCatchedObjectIsKinematic = rigid.isKinematic;
//設定に関わらずtrueにする
rigid.isKinematic = true;
}
//フィルタ強く
exrcv.BoneFilter = InHoldFilter;
//オブジェクトにメッセージを送る
if (signaling)
{
leftCatchedObject.SendMessage("OnCatchedLeftHand");
}
}
}
else
{
if (leftCatchedObject != null)
{
//解除して親に戻す
leftCatchedObject.transform.parent = leftCatchedObjectParent;
//掴むために物理演算を切る
var rigid = leftCatchedObject.GetComponent<Rigidbody>();
if (rigid != null)
{
//IsKinematicを保存していた設定にする
rigid.isKinematic = leftCatchedObjectIsKinematic;
//投げるために速度を転送する
rigid.linearVelocity = leftLastSpeed;
}
//フィルタ解除
exrcv.BoneFilter = NonHoldFilter;
//オブジェクトにメッセージを送る
if (signaling)
{
leftCatchedObject.SendMessage("OnReleasedLeftHand");
}
}
}
}
void CatchRight(bool s)
{
if (s)
{
if (rightHelper.Trigger && rightHelper.other != null)
{
//コリジョンタグになにか文字が入っていて、対象と一致しない場合は処理しない
if (CollisionTag != "" && CollisionTag != rightHelper.other.tag)
{
return;
}
//左手ですでに掴んでいるものは掴まない
if (rightHelper.other.gameObject.transform.parent == leftSphere.transform)
{
return;
}
//右手ですでに掴んでいるものは掴まない
if (rightHelper.other.gameObject.transform.parent == rightSphere.transform)
{
return;
}
//解除用に保持
rightCatchedObject = rightHelper.other.gameObject;
//親を保存
rightCatchedObjectParent = rightCatchedObject.transform.parent;
//手を親に上書き
rightCatchedObject.transform.parent = rightSphere.transform;
//掴むために物理演算を切る
var rigid = rightCatchedObject.GetComponent<Rigidbody>();
if (rigid != null)
{
//IsKinematicを保存
rightCatchedObjectIsKinematic = rigid.isKinematic;
//設定に関わらずtrueにする
rigid.isKinematic = true;
}
//フィルタ強く
exrcv.BoneFilter = InHoldFilter;
//オブジェクトにメッセージを送る
if (signaling)
{
rightCatchedObject.SendMessage("OnCatchedRightHand");
}
}
}
else
{
if (rightCatchedObject != null)
{
//解除して親に戻す
rightCatchedObject.transform.parent = rightCatchedObjectParent;
//掴むために物理演算を切る
var rigid = rightCatchedObject.GetComponent<Rigidbody>();
if (rigid != null)
{
//IsKinematicを保存していた設定にする
rigid.isKinematic = rightCatchedObjectIsKinematic;
Debug.Log(rightRigidBody.linearVelocity);
//投げるために速度を転送する
rigid.linearVelocity = rightLastSpeed;
}
//フィルタ解除
exrcv.BoneFilter = NonHoldFilter;
//オブジェクトにメッセージを送る
if (signaling)
{
rightCatchedObject.SendMessage("OnReleasedRightHand");
}
}
}
}
public void KeyInputEvent(EVMC4U.KeyInput key)
{
if (!StickyMode)
{
//Zキーが押されたか
if (key.name == LeftKey)
{
//つかみ・離し
CatchLeft(key.active == 1);
}
//Xキー押されたか
if (key.name == RightKey)
{
//つかみ・離し
CatchRight(key.active == 1);
}
}
else {
if (key.active == 1)
{
//Zキーが押されたか
if (key.name == LeftKey)
{
//つかみ・離し
stickyLeft = !stickyLeft;
CatchLeft(stickyLeft);
}
//Xキー押されたか
if (key.name == RightKey)
{
//つかみ・離し
stickyRight = !stickyRight;
CatchRight(stickyRight);
}
}
}
}
public void ControllerInputEvent(EVMC4U.ControllerInput con)
{
//トリガー引かれたか
if (con.name == ControllerButton)
{
if (!StickyMode)
{
if (con.IsLeft == 1)
{
//つかみ・離し
CatchLeft(con.active == 1);
}
else
{
//つかみ・離し
CatchRight(con.active == 1);
}
}
else {
if (con.active == 1) {
if (con.IsLeft == 1)
{
//つかみ・離し
stickyLeft = !stickyLeft;
CatchLeft(stickyLeft);
}
else
{
//つかみ・離し
stickyRight = !stickyRight;
CatchRight(stickyRight);
}
}
}
}
}
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 7d956bc80add4844891ac394eb195161
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,54 +0,0 @@
/*
* ExternalReceiver
* https://sabowl.sakura.ne.jp/gpsnmeajp/
*
* MIT License
*
* Copyright (c) 2019 gpsnmeajp
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace EVMC4U
{
public class HandCatch_Helper : MonoBehaviour
{
public bool Trigger = false;
public Collider other;
private void OnTriggerEnter(Collider other)
{
this.other = other;
Trigger = true;
GetComponent<MeshRenderer>().material.color = Color.cyan;
}
private void OnTriggerExit(Collider other)
{
this.other = other;
Trigger = false;
GetComponent<MeshRenderer>().material.color = Color.white;
}
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 32a6e766ebdc4c140b2e2324eae9915c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,110 +0,0 @@
/*
* ExternalReceiver
* https://sabowl.sakura.ne.jp/gpsnmeajp/
*
* MIT License
*
* Copyright (c) 2019 gpsnmeajp
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//掴まれたとき: 手の位置に持つ
//離されたとき: 鞘の位置なら、収まるべき場所に戻る
// そうでないなら、親なしにしてとどまる
namespace EVMC4U
{
public class HandCatch_WeaponHelper : MonoBehaviour
{
public Transform CaseParent; //鞘オブジェクト
public Transform LeftHoldPosition; //左手保持位置
public Transform RightHoldPosition; //右手保持位置
//鞘に戻らない限界距離
public float Threshold = 0.5f;
//どれだけふわっと動くか
public float Filter = 0.8f;
//初期位置(鞘に収まっている状態)
Vector3 CasePosition;
Quaternion CaseRotation;
//初期位置(鞘に収まっている状態)
Vector3 TragetPosition;
Quaternion TargetRotation;
void Start()
{
CasePosition = transform.localPosition;
CaseRotation = transform.localRotation;
TragetPosition = CasePosition;
TargetRotation = CaseRotation;
}
void Update()
{
if (transform.parent != null) {
transform.localPosition = Vector3.Lerp(TragetPosition, transform.localPosition, Filter);
transform.localRotation = Quaternion.Lerp(TargetRotation, transform.localRotation, Filter);
}
}
void OnCatchedLeftHand()
{
Debug.Log("C:L");
TragetPosition = LeftHoldPosition.localPosition;
TargetRotation = LeftHoldPosition.localRotation;
}
void OnCatchedRightHand()
{
Debug.Log("C:R");
TragetPosition = RightHoldPosition.localPosition;
TargetRotation = RightHoldPosition.localRotation;
}
void OnReleasedLeftHand()
{
Debug.Log("R:L");
OnReleasedRightHand();//同じ処理
}
void OnReleasedRightHand()
{
Debug.Log("R:R");
//計算用に一時的に親にする
transform.parent = CaseParent;
float distance = Vector3.Distance(CasePosition, transform.localPosition);
if (distance < Threshold)
{
transform.parent = CaseParent;
TragetPosition = CasePosition;
TargetRotation = CaseRotation;
}
else {
transform.parent = null;
}
}
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 0b722cb0621aaad4f9585f5d17bf89e1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 7ac5b962b075c1f4e913c49ad9c50680
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,57 +0,0 @@
/*
* ExternalReceiver
* https://sabowl.sakura.ne.jp/gpsnmeajp/
*
* MIT License
*
* Copyright (c) 2020 gpsnmeajp
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using EVMC4U;
public class ObjectSwitch : MonoBehaviour
{
public InputReceiver inputReceiver;
public string Key = "スペース";
public string Button = "ClickMenu";
void Start()
{
inputReceiver.KeyInputAction.AddListener(OnKey);
inputReceiver.ControllerInputAction.AddListener(OnCon);
}
void OnKey(KeyInput key)
{
if (key.name == Key && key.active == 1)
{
gameObject.SetActive(!gameObject.activeSelf);
}
}
void OnCon(ControllerInput con)
{
if (con.name == Button && con.active == 1)
{
gameObject.SetActive(!gameObject.activeSelf);
}
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: ca3e3053b95a4864cb49cc75a25c816f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 0ae2642b6e10fda49985acfd80a2bcda
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,73 +0,0 @@
/*
* ExternalReceiver
* https://sabowl.sakura.ne.jp/gpsnmeajp/
*
* MIT License
*
* Copyright (c) 2019 gpsnmeajp
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace EVMC4U
{
public class TeleportManager : MonoBehaviour
{
public InputReceiver inputReceiver;
public GameObject ParentObject;
public Animator model;
public string[] TriggerKey = new string[5];
public Transform[] TeleportTarget = new Transform[5];
private Transform footpos;
void Start()
{
inputReceiver.KeyInputAction.AddListener(OnKey);
footpos = model.GetBoneTransform(HumanBodyBones.LeftFoot);
}
void OnKey(KeyInput key)
{
//押されたときのみ
if (key.active != 1) {
return;
}
//該当するキーを探す
for (int i = 0; i < TriggerKey.Length; i++) {
if (TriggerKey[i] == key.name) {
Debug.Log("Key:" + key.name);
//発見したらターゲット有効性をチェックする
if (TeleportTarget.Length > i) {
if (TeleportTarget[i] != null) {
//モデルに反映
ParentObject.transform.position -= (footpos.position - TeleportTarget[i].position);
ParentObject.transform.rotation = TeleportTarget[i].rotation;
}
}
}
}
}
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 6ca42dd9317a6194d82d5ab6c382cd59
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 9cc666ef35f0a954280a2dc6a3c01c04
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,86 +0,0 @@
/*
* ExternalReceiver
* https://sabowl.sakura.ne.jp/gpsnmeajp/
*
* MIT License
*
* Copyright (c) 2019 gpsnmeajp
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class HiResolutionPhotoCamera : MonoBehaviour {
//撮影したい解像度
public int width = 4096;
public int height = 2160;
//撮影したいカメラ
public Camera cam;
//撮影ボタン
public bool shot = false;
void Update () {
//撮影ボタンが押されたら撮影する
if (shot) {
shot = false;
TakePhoto();
}
}
void TakePhoto() {
width = 8192;
height = (int)((float)8192 * (float)Screen.height/ (float)Screen.width);
//撮影したい解像度のRenderテクスチャを作成
var renderTexture = new RenderTexture(width, height, 24);
//アクティブなレンダーテクスチャを保存
var save = RenderTexture.active;
//カメラに描画対象を設定
cam.targetTexture = renderTexture;
//ReadPixelsの取得元(アクティブなレンダーテクスチャ)を設定
RenderTexture.active = renderTexture;
//即座にレンダリングする
cam.Render();
//テクスチャを生成して読み取り
Texture2D texture = new Texture2D(renderTexture.width, renderTexture.height, TextureFormat.ARGB32, false);
texture.ReadPixels(new Rect(0, 0, renderTexture.width, renderTexture.height), 0, 0);
texture.Apply();
//テクスチャをpngファイルに保存
byte[] data = texture.EncodeToPNG();
File.WriteAllBytes("output" + DateTime.Now.ToString("yyyy-MM-dd_hh-mm-ss-ff")+ ".png", data);
//破棄
DestroyImmediate(texture);
//カメラの描画対象を元に戻す
cam.targetTexture = null;
//アクティブなレンダーテクスチャを復元
RenderTexture.active = save;
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: a163057f77fd4964d930cb2b19e510c5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 7e3d414de8589044f8af782fc6e85db6
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,51 +0,0 @@
/*
* ExternalReceiver
* https://sabowl.sakura.ne.jp/gpsnmeajp/
*
* MIT License
*
* Copyright (c) 2019 gpsnmeajp
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace EVMC4U
{
public class AddComponentTest : MonoBehaviour
{
public GameObject Model;
// Use this for initialization
void Start()
{
var x = gameObject.AddComponent<EVMC4U.ExternalReceiver>();
x.Model = Model;
}
// Update is called once per frame
void Update()
{
}
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: ca033debfd5f5e749bf2054d2a0527dc
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,55 +0,0 @@
/*
* ExternalReceiver
* https://sabowl.sakura.ne.jp/gpsnmeajp/
*
* MIT License
*
* Copyright (c) 2019 gpsnmeajp
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using uOSC;
namespace EVMC4U
{
public class DaisyChainTesting : MonoBehaviour, IExternalReceiver
{
//デイジーチェーンテスト
public void MessageDaisyChain(ref Message message, int callCount)
{
if (message.address == "/VMC/Ext/T")
{
Debug.Log(message.address + "[" + (float)message.values[0] + "]");
}
//メッセージ全部Logに出そうとか考えないこと。Unityが死ぬほど送られてきます。
}
public void UpdateDaisyChain()
{
throw new NotImplementedException();
}
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 115a682733d799a4c8da6c4e1da18253
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,103 +0,0 @@
/*
* ExternalReceiver
* https://sabowl.sakura.ne.jp/gpsnmeajp/
*
* MIT License
*
* Copyright (c) 2019 gpsnmeajp
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace EVMC4U
{
public class InputTesting : MonoBehaviour
{
public InputReceiver receiver;
private void Start()
{
receiver.ControllerInputAction.AddListener(ControllerInputEvent);
receiver.KeyInputAction.AddListener(KeyInputEvent);
receiver.MidiNoteInputAction.AddListener(MidiNoteEvent);
receiver.MidiCCValueInputAction.AddListener(MidiCCValEvent);
receiver.MidiCCButtonInputAction.AddListener(MidiCCButtonEvent);
}
public void KeyInputEvent(EVMC4U.KeyInput key)
{
switch (key.active)
{
case 1:
Debug.Log("" + key.name + "(" + key.keycode + ") pressed.");
break;
case 0:
Debug.Log("" + key.name + "(" + key.keycode + ") released.");
break;
default:
Debug.Log("" + key.name + "(" + key.keycode + ") unknown.");
break;
}
}
public void ControllerInputEvent(EVMC4U.ControllerInput con)
{
switch (con.active)
{
case 2:
Debug.Log("" + con.name + "(" + ((con.IsAxis == 1) ? "Axis" : "Non Axis") + "/" + ((con.IsLeft == 1) ? "Left" : "Right") + "/" + ((con.IsTouch == 1) ? "Touch" : "Non Touch") + " [" + con.Axis.x + "," + con.Axis.y + "," + con.Axis.z + "]" + ") changed.");
break;
case 1:
Debug.Log("" + con.name + "(" + ((con.IsAxis == 1) ? "Axis" : "Non Axis") + "/" + ((con.IsLeft == 1) ? "Left" : "Right") + "/" + ((con.IsTouch == 1) ? "Touch" : "Non Touch") + " [" + con.Axis.x + "," + con.Axis.y + "," + con.Axis.z + "]" + ") pressed.");
break;
case 0:
Debug.Log("" + con.name + "(" + ((con.IsAxis == 1) ? "Axis" : "Non Axis") + "/" + ((con.IsLeft == 1) ? "Left" : "Right") + "/" + ((con.IsTouch == 1) ? "Touch" : "Non Touch") + " [" + con.Axis.x + "," + con.Axis.y + "," + con.Axis.z + "]" + ") released.");
break;
default:
Debug.Log("" + con.name + "(" + ((con.IsAxis == 1) ? "Axis" : "Non Axis") + "/" + ((con.IsLeft == 1) ? "Left" : "Right") + "/" + ((con.IsTouch == 1) ? "Touch" : "Non Touch") + " [" + con.Axis.x + "," + con.Axis.y + "," + con.Axis.z + "]" + ") unknown.");
break;
}
}
public void MidiNoteEvent(EVMC4U.MidiNote note)
{
if (note.active == 1)
{
Debug.Log("MIDI Note ON =" + note.note + " channel=" + note.channel + " velocity=" + note.velocity);
}
else
{
Debug.Log("MIDI note OFF =" + note.note + " channel=" + note.channel + " velocity=" + note.velocity);
}
}
public void MidiCCValEvent(EVMC4U.MidiCCValue val)
{
Debug.Log("MIDI CC Value knob=" + val.knob + " value=" + val.value);
}
public void MidiCCButtonEvent(EVMC4U.MidiCCButton bit)
{
Debug.Log("MIDI CC Button knob=" + bit.knob + " active=" + bit.active);
}
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 30c17a2abdf40c749a563c6beb9c4cb3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 7618eb7d813fe0348ba985c6aee44247
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,45 +0,0 @@
/*
* ExternalReceiver
* https://sabowl.sakura.ne.jp/gpsnmeajp/
*
* MIT License
*
* Copyright (c) 2019 gpsnmeajp
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
namespace EVMC4U {
//イベント定義
[Serializable]
public class KeyInputEvent : UnityEvent<KeyInput> { };
[Serializable]
public class ControllerInputEvent : UnityEvent<ControllerInput> { };
[Serializable]
public class MidiNoteInputEvent : UnityEvent<MidiNote> { };
[Serializable]
public class MidiCCValueInputEvent : UnityEvent<MidiCCValue> { };
[Serializable]
public class MidiCCButtonInputEvent : UnityEvent<MidiCCButton> { };
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: c8815bc3a23b2e64d867d5a797c3d66b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,128 +0,0 @@
/*
* ExternalReceiver
* https://sabowl.sakura.ne.jp/gpsnmeajp/
*
* MIT License
*
* Copyright (c) 2019 gpsnmeajp
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
#if UNITY_EDITOR
using UnityEditor;
#endif
namespace EVMC4U {
//キーボード入力情報
public struct KeyInput
{
public int active;
public string name;
public int keycode;
}
//コントローラ入力情報
public struct ControllerInput
{
public int active;
public string name;
public int IsLeft;
public int IsTouch;
public int IsAxis;
public Vector3 Axis;
}
//MIDI Note入力情報
public struct MidiNote
{
public int active;
public int channel;
public int note;
public float velocity;
}
//MIDI CC Value入力情報
public struct MidiCCValue
{
public int knob;
public float value;
}
//MIDI CC Button入力情報
public struct MidiCCButton
{
public int knob;
public float active;
}
public enum CalibrationState
{
Uncalibrated = 0,
WaitingForCalibrating = 1,
Calibrating = 2,
Calibrated = 3,
}
public enum CalibrationMode
{
Normal = 0,
MR_Hand = 1,
MR_Floor = 2,
T_Pose = 3,
}
public enum VirtualDevice
{
HMD = 0,
Controller = 1,
Tracker = 2,
}
public class LabelAttribute : PropertyAttribute
{
public readonly string name;
public LabelAttribute(string name)
{
this.name = name;
}
}
#if UNITY_EDITOR
[CustomPropertyDrawer(typeof(LabelAttribute))]
public class LabelAttributeDrawer : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
#if EVMC4U_JA
var attr = attribute as LabelAttribute;
label.text = attr.name;
#endif
EditorGUI.PropertyField(position, property, label, true);
}
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
{
return base.GetPropertyHeight(property, label);
}
}
#endif
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: c408232ad0549a04885448ccc3c949c5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,88 +0,0 @@
/*
* ExternalReceiver
* https://sabowl.sakura.ne.jp/gpsnmeajp/
*
* MIT License
*
* Copyright (c) 2019 gpsnmeajp
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
namespace EVMC4U {
public class ExternalReceiverManager
{
List<IExternalReceiver> receivers = new List<IExternalReceiver>();
//コンストラクタ
public ExternalReceiverManager(GameObject[] gameObjects) {
GetIExternalReceiver(gameObjects);
}
//ゲームオブジェクトからIExternalReceiverを探す
public void GetIExternalReceiver(GameObject[] gameObjects)
{
//リストをクリア
receivers.Clear();
if (gameObjects == null) {
return;
}
//GameObjectを調べる
foreach (var g in gameObjects)
{
//GameObjectが存在するなら
if (g != null) {
//IExternalReceiverを探す
var f = g.GetComponent(typeof(IExternalReceiver)) as IExternalReceiver;
if (f != null) {
//リストに突っ込む
receivers.Add(f);
}
}
}
}
//IExternalReceiverのリストを使って配信する
public bool SendNextReceivers(uOSC.Message message, int callCount)
{
if (callCount > 100)
{
//無限ループ対策
Debug.LogError("[ExternalReceiver] Too many call(maybe infinite loop).");
return false;
}
foreach (var r in receivers) {
//インターフェースがあるか
if (r != null)
{
//Chain数を+1して次へ
r.MessageDaisyChain(ref message, callCount + 1);
}
}
return true;
}
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 5bff20909940d4b42906662b389b7cb1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,40 +0,0 @@
/*
* ExternalReceiver
* https://sabowl.sakura.ne.jp/gpsnmeajp/
*
* MIT License
*
* Copyright (c) 2019 gpsnmeajp
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
namespace EVMC4U {
//デイジーチェーン受信の最低限のインターフェース
public interface IExternalReceiver
{
void MessageDaisyChain(ref uOSC.Message message, int callCount);
void UpdateDaisyChain();
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 6f1804aa17fcc684f856124d233e9672
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -13,19 +13,16 @@ namespace UniGLTF
static List<AnimationClip> GetAnimationClips(GameObject Copy)
{
var clips = new List<AnimationClip>();
var animator = Copy.GetComponent<Animator>();
var animation = Copy.GetComponent<Animation>();
if (animator != null)
{
clips.AddRange(AnimationExporter.GetAnimationClips(animator));
clips = AnimationExporter.GetAnimationClips(animator);
}
var animation = Copy.GetComponent<Animation>();
if (animation != null)
else if (animation != null)
{
clips.AddRange(AnimationExporter.GetAnimationClips(animation));
clips = AnimationExporter.GetAnimationClips(animation);
}
return clips;
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 31e28050bb28edd40a730d8e05ddcde5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

Some files were not shown because too many files have changed in this diff Show More