removed mobile camera code
removed commented code changed remaining abList references
This commit is contained in:
@@ -88,20 +88,6 @@ public class CameraOrbit : MonoBehaviour
|
|||||||
Debug.Log($"Switched AntiAliasing to {(PostProcessLayer.Antialiasing)AAModeDropdown.value}");
|
Debug.Log($"Switched AntiAliasing to {(PostProcessLayer.Antialiasing)AAModeDropdown.value}");
|
||||||
AAMode = AAModeDropdown.value;
|
AAMode = AAModeDropdown.value;
|
||||||
}
|
}
|
||||||
#if UNITY_ANDROID
|
|
||||||
switch (CameraModeDropdown.value)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
MobileOrbitAround();
|
|
||||||
MobileOrbitLight();
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
MobileOrbitAround(true);
|
|
||||||
MobileOrbitLight();
|
|
||||||
break;
|
|
||||||
case 2: FreeCamera(); break;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
switch (CameraModeDropdown.value)
|
switch (CameraModeDropdown.value)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
@@ -110,7 +96,6 @@ public class CameraOrbit : MonoBehaviour
|
|||||||
break;
|
break;
|
||||||
case 1: FreeCamera(); break;
|
case 1: FreeCamera(); break;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -223,75 +208,4 @@ public class CameraOrbit : MonoBehaviour
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Mobile Controls
|
|
||||||
Vector3 mouseBasePos = Vector3.zero;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Rotate Light Source
|
|
||||||
/// </summary>
|
|
||||||
private void MobileOrbitLight()
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
//if (Input.touchCount == 2 && !eventSystem.IsPointerOverGameObject(Input.touches[0].fingerId) && !eventSystem.IsPointerOverGameObject(Input.touches[1].fingerId))
|
|
||||||
//{
|
|
||||||
// Light.transform.Rotate(Input.GetAxis("Mouse X") * Vector3.up, Space.Self);
|
|
||||||
// Light.transform.Rotate(Input.GetAxis("Mouse Y") * Vector3.right, Space.Self);
|
|
||||||
//}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Orbit camera around world center
|
|
||||||
/// </summary>
|
|
||||||
void MobileOrbitAround(bool aroundCharacter = false)
|
|
||||||
{
|
|
||||||
TargetCenter = Vector3.zero;
|
|
||||||
|
|
||||||
Camera.main.fieldOfView = OrbitCamFovSlider.value;
|
|
||||||
Vector3 position = transform.position;
|
|
||||||
|
|
||||||
if (Input.GetMouseButtonDown(0) && !eventSystem.IsPointerOverGameObject(0))
|
|
||||||
{
|
|
||||||
mouseBasePos = Input.mousePosition;
|
|
||||||
controlOn = true;
|
|
||||||
}
|
|
||||||
if (Input.touchCount==1 && controlOn)
|
|
||||||
{
|
|
||||||
position -= (Input.mousePosition - mouseBasePos).x * 0.001f * transform.right * OrbitCamSpeedSlider.value;
|
|
||||||
OrbitCamHeightSlider.value -= (Input.mousePosition - mouseBasePos).y * 0.001f * OrbitCamSpeedSlider.value;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mouseBasePos = Vector3.zero;
|
|
||||||
controlOn = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Input.touchCount == 2)
|
|
||||||
{
|
|
||||||
Touch touchZero = Input.GetTouch(0);
|
|
||||||
Touch touchOne = Input.GetTouch(1);
|
|
||||||
|
|
||||||
Vector2 touchZeroPrevPos = touchZero.position - touchZero.deltaPosition;
|
|
||||||
Vector2 touchOnePrevPos = touchOne.position - touchOne.deltaPosition;
|
|
||||||
|
|
||||||
float prevMagnitude = (touchZeroPrevPos - touchOnePrevPos).magnitude;
|
|
||||||
float currentMagnitude = (touchZero.position - touchOne.position).magnitude;
|
|
||||||
|
|
||||||
float difference = currentMagnitude - prevMagnitude;
|
|
||||||
|
|
||||||
OrbitCamZoomSlider.value -= difference * 0.01f * OrbitCamZoomSpeedSlider.value;
|
|
||||||
}
|
|
||||||
|
|
||||||
float camDist = OrbitCamZoomSlider.value;
|
|
||||||
OrbitCamHeightSlider.maxValue = camDist + 1 - camDist * 0.2f;
|
|
||||||
OrbitCamHeightSlider.minValue = -camDist + 1 + camDist * 0.2f;
|
|
||||||
|
|
||||||
Vector3 target = TargetCenter + OrbitCamTargetHeightSlider.value * Vector3.up; //set target offsets
|
|
||||||
|
|
||||||
position.y = TargetCenter.y + OrbitCamHeightSlider.value; //set camera height
|
|
||||||
transform.position = position; //set final position of camera at target
|
|
||||||
transform.LookAt(target); //look at target position
|
|
||||||
transform.position = target - transform.forward * camDist; //move away from target
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,22 +101,6 @@ public class UmaDatabaseController
|
|||||||
return entries;
|
return entries;
|
||||||
}
|
}
|
||||||
|
|
||||||
//static IEnumerable<UmaharaData> ReadMaster(SqliteConnection conn)
|
|
||||||
//{
|
|
||||||
// SqliteCommand sqlite_cmd = conn.CreateCommand();
|
|
||||||
// sqlite_cmd.CommandText = "SELECT id,tail_model_id FROM chara_data";
|
|
||||||
// SqliteDataReader sqlite_datareader = sqlite_cmd.ExecuteReader();
|
|
||||||
// while (sqlite_datareader.Read())
|
|
||||||
// {
|
|
||||||
// UmaCharaData entry = new UmaCharaData()
|
|
||||||
// {
|
|
||||||
// id = sqlite_datareader.GetInt32(0),
|
|
||||||
// tail_model_id = sqlite_datareader.GetInt32(1).ToString(),
|
|
||||||
// };
|
|
||||||
// yield return entry;
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
static IEnumerable<DataRow> ReadMaster(SqliteConnection conn)
|
static IEnumerable<DataRow> ReadMaster(SqliteConnection conn)
|
||||||
{
|
{
|
||||||
SqliteCommand sqlite_cmd = conn.CreateCommand();
|
SqliteCommand sqlite_cmd = conn.CreateCommand();
|
||||||
|
|||||||
@@ -104,9 +104,9 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
body = UmaDatabaseController.BodyPath + $"bdy{costumeIdShort}/pfb_bdy{costumeId}_{height}_{shape}_{bust}";
|
body = UmaDatabaseController.BodyPath + $"bdy{costumeIdShort}/pfb_bdy{costumeId}_{height}_{shape}_{bust}";
|
||||||
|
|
||||||
Debug.Log("Looking for " + body);
|
Debug.Log("Looking for " + body);
|
||||||
asset = UmaViewerMain.Instance.AbList.FirstOrDefault(a => a.Name == body);
|
asset = UmaViewerMain.Instance.AbChara.FirstOrDefault(a => a.Name == body);
|
||||||
}
|
}
|
||||||
else asset = UmaViewerMain.Instance.AbList.FirstOrDefault(a => a.Name == UmaDatabaseController.BodyPath + $"bdy{id}_{costumeId}/pfb_bdy{id}_{costumeId}");
|
else asset = UmaViewerMain.Instance.AbChara.FirstOrDefault(a => a.Name == UmaDatabaseController.BodyPath + $"bdy{id}_{costumeId}/pfb_bdy{id}_{costumeId}");
|
||||||
|
|
||||||
if (asset == null)
|
if (asset == null)
|
||||||
{
|
{
|
||||||
@@ -141,7 +141,7 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
}
|
}
|
||||||
Debug.Log(texPattern1 + " " + texPattern2);
|
Debug.Log(texPattern1 + " " + texPattern2);
|
||||||
//Load Body Textures
|
//Load Body Textures
|
||||||
foreach (var asset1 in UmaViewerMain.Instance.AbList.Where(a => a.Name.StartsWith(UmaDatabaseController.BodyPath)
|
foreach (var asset1 in UmaViewerMain.Instance.AbChara.Where(a => a.Name.StartsWith(UmaDatabaseController.BodyPath)
|
||||||
&& (a.Name.Contains(texPattern1)
|
&& (a.Name.Contains(texPattern1)
|
||||||
|| a.Name.Contains(texPattern2)
|
|| a.Name.Contains(texPattern2)
|
||||||
|| (string.IsNullOrEmpty(texPattern3) ? false : a.Name.Contains(texPattern3))
|
|| (string.IsNullOrEmpty(texPattern3) ? false : a.Name.Contains(texPattern3))
|
||||||
@@ -154,7 +154,7 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
RecursiveLoadAsset(asset);
|
RecursiveLoadAsset(asset);
|
||||||
|
|
||||||
//Load Physics
|
//Load Physics
|
||||||
foreach (var asset1 in UmaViewerMain.Instance.AbList.Where(a => a.Name.StartsWith(UmaDatabaseController.BodyPath + $"bdy{costumeIdShort}/clothes")))
|
foreach (var asset1 in UmaViewerMain.Instance.AbChara.Where(a => a.Name.StartsWith(UmaDatabaseController.BodyPath + $"bdy{costumeIdShort}/clothes")))
|
||||||
{
|
{
|
||||||
if (asset1.Name.Contains("cloth00") && asset1.Name.Contains("bust" + bust))
|
if (asset1.Name.Contains("cloth00") && asset1.Name.Contains("bust" + bust))
|
||||||
RecursiveLoadAsset(asset1);
|
RecursiveLoadAsset(asset1);
|
||||||
@@ -165,7 +165,7 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
RecursiveLoadAsset(asset);
|
RecursiveLoadAsset(asset);
|
||||||
|
|
||||||
//Load Physics
|
//Load Physics
|
||||||
foreach (var asset1 in UmaViewerMain.Instance.AbList.Where(a => a.Name.StartsWith(UmaDatabaseController.BodyPath + $"bdy{id}_{costumeId}/clothes")))
|
foreach (var asset1 in UmaViewerMain.Instance.AbChara.Where(a => a.Name.StartsWith(UmaDatabaseController.BodyPath + $"bdy{id}_{costumeId}/clothes")))
|
||||||
{
|
{
|
||||||
if (asset1.Name.Contains("cloth04"))
|
if (asset1.Name.Contains("cloth04"))
|
||||||
RecursiveLoadAsset(asset1);
|
RecursiveLoadAsset(asset1);
|
||||||
@@ -201,19 +201,19 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
}
|
}
|
||||||
|
|
||||||
string head = UmaDatabaseController.HeadPath + $"chr{head_id}_{head_costumeId}/pfb_chr{head_id}_{head_costumeId}";
|
string head = UmaDatabaseController.HeadPath + $"chr{head_id}_{head_costumeId}/pfb_chr{head_id}_{head_costumeId}";
|
||||||
asset = UmaViewerMain.Instance.AbList.FirstOrDefault(a => a.Name == head);
|
asset = UmaViewerMain.Instance.AbChara.FirstOrDefault(a => a.Name == head);
|
||||||
bool isDefaultHead = false;
|
bool isDefaultHead = false;
|
||||||
//Some costumes don't have custom heads
|
//Some costumes don't have custom heads
|
||||||
if (head_costumeId != "00" && asset == null)
|
if (head_costumeId != "00" && asset == null)
|
||||||
{
|
{
|
||||||
asset = UmaViewerMain.Instance.AbList.FirstOrDefault(a => a.Name == UmaDatabaseController.HeadPath + $"chr{head_id}_00/pfb_chr{head_id}_00");
|
asset = UmaViewerMain.Instance.AbChara.FirstOrDefault(a => a.Name == UmaDatabaseController.HeadPath + $"chr{head_id}_00/pfb_chr{head_id}_00");
|
||||||
isDefaultHead = true;
|
isDefaultHead = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (asset != null)
|
if (asset != null)
|
||||||
{
|
{
|
||||||
//Load Hair Textures
|
//Load Hair Textures
|
||||||
foreach (var asset1 in UmaViewerMain.Instance.AbList.Where(a => a.Name.StartsWith($"{UmaDatabaseController.HeadPath}chr{head_id}_{head_costumeId}/textures")))
|
foreach (var asset1 in UmaViewerMain.Instance.AbChara.Where(a => a.Name.StartsWith($"{UmaDatabaseController.HeadPath}chr{head_id}_{head_costumeId}/textures")))
|
||||||
{
|
{
|
||||||
RecursiveLoadAsset(asset1);
|
RecursiveLoadAsset(asset1);
|
||||||
}
|
}
|
||||||
@@ -223,7 +223,7 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
//Load Physics
|
//Load Physics
|
||||||
if (isDefaultHead)
|
if (isDefaultHead)
|
||||||
{
|
{
|
||||||
foreach (var asset1 in UmaViewerMain.Instance.AbList.Where(a => a.Name.StartsWith($"{UmaDatabaseController.HeadPath}chr{head_id}_00/clothes")))
|
foreach (var asset1 in UmaViewerMain.Instance.AbChara.Where(a => a.Name.StartsWith($"{UmaDatabaseController.HeadPath}chr{head_id}_00/clothes")))
|
||||||
{
|
{
|
||||||
if (asset1.Name.Contains("cloth00"))
|
if (asset1.Name.Contains("cloth00"))
|
||||||
RecursiveLoadAsset(asset1);
|
RecursiveLoadAsset(asset1);
|
||||||
@@ -231,7 +231,7 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
foreach (var asset1 in UmaViewerMain.Instance.AbList.Where(a => a.Name.StartsWith($"{UmaDatabaseController.HeadPath}chr{head_id}_{head_costumeId}/clothes")))
|
foreach (var asset1 in UmaViewerMain.Instance.AbChara.Where(a => a.Name.StartsWith($"{UmaDatabaseController.HeadPath}chr{head_id}_{head_costumeId}/clothes")))
|
||||||
{
|
{
|
||||||
if (asset1.Name.Contains("cloth00"))
|
if (asset1.Name.Contains("cloth00"))
|
||||||
RecursiveLoadAsset(asset1);
|
RecursiveLoadAsset(asset1);
|
||||||
@@ -245,10 +245,10 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
string tailName = $"tail{tailId.ToString().PadLeft(4, '0')}_00";
|
string tailName = $"tail{tailId.ToString().PadLeft(4, '0')}_00";
|
||||||
string tailPath = $"3d/chara/tail/{tailName}/";
|
string tailPath = $"3d/chara/tail/{tailName}/";
|
||||||
string tailPfb = tailPath + $"pfb_{tailName}";
|
string tailPfb = tailPath + $"pfb_{tailName}";
|
||||||
asset = UmaViewerMain.Instance.AbList.FirstOrDefault(a => a.Name == tailPfb);
|
asset = UmaViewerMain.Instance.AbChara.FirstOrDefault(a => a.Name == tailPfb);
|
||||||
if (asset != null)
|
if (asset != null)
|
||||||
{
|
{
|
||||||
foreach (var asset1 in UmaViewerMain.Instance.AbList.Where(a => a.Name.StartsWith($"{tailPath}textures/tex_{tailName}_{head_id}") || a.Name.StartsWith($"{tailPath}textures/tex_{tailName}_0000")))
|
foreach (var asset1 in UmaViewerMain.Instance.AbChara.Where(a => a.Name.StartsWith($"{tailPath}textures/tex_{tailName}_{head_id}") || a.Name.StartsWith($"{tailPath}textures/tex_{tailName}_0000")))
|
||||||
{
|
{
|
||||||
RecursiveLoadAsset(asset1);
|
RecursiveLoadAsset(asset1);
|
||||||
}
|
}
|
||||||
@@ -256,7 +256,7 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
|
|
||||||
|
|
||||||
//Load Physics
|
//Load Physics
|
||||||
foreach (var asset1 in UmaViewerMain.Instance.AbList.Where(a => a.Name.StartsWith($"{tailPath}clothes")))
|
foreach (var asset1 in UmaViewerMain.Instance.AbChara.Where(a => a.Name.StartsWith($"{tailPath}clothes")))
|
||||||
{
|
{
|
||||||
if (asset1.Name.Contains("cloth00"))
|
if (asset1.Name.Contains("cloth00"))
|
||||||
RecursiveLoadAsset(asset1);
|
RecursiveLoadAsset(asset1);
|
||||||
|
|||||||
@@ -503,8 +503,7 @@ public class UmaViewerUI : MonoBehaviour
|
|||||||
Destroy(animationList.content.GetChild(i).gameObject);
|
Destroy(animationList.content.GetChild(i).gameObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
var filteredList = Main.AbList.Where(a => a.Name.StartsWith(UmaDatabaseController.MotionPath)
|
var filteredList = Main.AbMotions.Where(a => !a.Name.Contains($"mirror")
|
||||||
&& !a.Name.Contains($"mirror")
|
|
||||||
&& (mini ? a.Name.Contains($"mini") : !a.Name.Contains($"mini"))
|
&& (mini ? a.Name.Contains($"mini") : !a.Name.Contains($"mini"))
|
||||||
&& !a.Name.Contains($"facial")
|
&& !a.Name.Contains($"facial")
|
||||||
&& !a.Name.Contains($"_cam")
|
&& !a.Name.Contains($"_cam")
|
||||||
|
|||||||
Reference in New Issue
Block a user