bug fix
This commit is contained in:
@@ -83,21 +83,18 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
if (characters[i].CharaEntry.Name != "")
|
if (characters[i].CharaEntry.Name != "")
|
||||||
{
|
{
|
||||||
var umaContainer = new GameObject($"Chara_{characters[i].CharaEntry.Id}_{characters[i].CostumeId}").AddComponent<UmaContainerCharacter>();
|
var umaContainer = new GameObject($"Chara_{characters[i].CharaEntry.Id}_{characters[i].CostumeId}").AddComponent<UmaContainerCharacter>();
|
||||||
|
umaContainer.IsLive = true;
|
||||||
|
umaContainer.CharaData = UmaDatabaseController.ReadCharaData(characters[i].CharaEntry);
|
||||||
|
var charObjs = Gallop.Live.Director.instance.charaObjs;
|
||||||
|
umaContainer.transform.parent = charObjs[i];
|
||||||
|
umaContainer.transform.localPosition = new Vector3();
|
||||||
|
|
||||||
if (characters[i].CharaEntry.IsMob)
|
if (characters[i].CharaEntry.IsMob)
|
||||||
{
|
{
|
||||||
umaContainer.IsLive = true;
|
|
||||||
umaContainer.CharaData = UmaDatabaseController.ReadCharaData(characters[i].CharaEntry);
|
|
||||||
umaContainer.transform.parent = Gallop.Live.Director.instance.charaObjs[i];
|
|
||||||
umaContainer.transform.localPosition = new Vector3();
|
|
||||||
LoadMobUma(umaContainer, characters[i].CharaEntry, characters[i].CostumeId);
|
LoadMobUma(umaContainer, characters[i].CharaEntry, characters[i].CostumeId);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
umaContainer.IsLive = true;
|
|
||||||
umaContainer.CharaData = UmaDatabaseController.ReadCharaData(characters[i].CharaEntry);
|
|
||||||
umaContainer.transform.parent = Gallop.Live.Director.instance.charaObjs[i];
|
|
||||||
umaContainer.transform.localPosition = new Vector3();
|
|
||||||
LoadNormalUma(umaContainer, characters[i].CharaEntry, characters[i].CostumeId);
|
LoadNormalUma(umaContainer, characters[i].CharaEntry, characters[i].CostumeId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -995,32 +995,32 @@ namespace Gallop
|
|||||||
|
|
||||||
EyeMorphs.ForEach(morph => morph.weight = 0);
|
EyeMorphs.ForEach(morph => morph.weight = 0);
|
||||||
|
|
||||||
if (updateInfo_.eyePrev != null)
|
if (updateInfo_.eyeNext != null)
|
||||||
{
|
{
|
||||||
if (weightRatio != 1)
|
if (weightRatio != 1)
|
||||||
{
|
{
|
||||||
foreach (var part in updateInfo_.eyePrev.facialPartsDataArrayL)
|
foreach (var part in updateInfo_.eyeNext.facialPartsDataArrayL)
|
||||||
{
|
{
|
||||||
if (part.FacialPartsId == 0) { continue; }
|
if (part.FacialPartsId == 0) { continue; }
|
||||||
leftEyeMorph[part.FacialPartsId - 1].weight = ((float)part.WeightPer / 100 * (1 - weightRatio)) * ((float)updateInfo_.eyePrev.weight / 100);
|
leftEyeMorph[part.FacialPartsId - 1].weight = ((float)part.WeightPer / 100 * weightRatio * ((float)updateInfo_.eyeCur.weight / 100));
|
||||||
}
|
}
|
||||||
foreach (var part in updateInfo_.eyePrev.facialPartsDataArrayR)
|
foreach (var part in updateInfo_.eyeNext.facialPartsDataArrayR)
|
||||||
{
|
{
|
||||||
if (part.FacialPartsId == 0) { continue; }
|
if (part.FacialPartsId == 0) { continue; }
|
||||||
rightEyeMorph[part.FacialPartsId - 1].weight = ((float)part.WeightPer / 100 * (1 - weightRatio)) * ((float)updateInfo_.eyePrev.weight / 100);
|
rightEyeMorph[part.FacialPartsId - 1].weight = ((float)part.WeightPer / 100 * weightRatio * ((float)updateInfo_.eyeCur.weight / 100));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
foreach (var part in updateInfo_.eyePrev.facialPartsDataArrayL)
|
foreach (var part in updateInfo_.eyeNext.facialPartsDataArrayL)
|
||||||
{
|
{
|
||||||
if (part.FacialPartsId == 0) { continue; }
|
if (part.FacialPartsId == 0) { continue; }
|
||||||
leftEyeMorph[part.FacialPartsId - 1].weight = 0;
|
leftEyeMorph[part.FacialPartsId - 1].weight = part.WeightPer / 100;
|
||||||
}
|
}
|
||||||
foreach (var part in updateInfo_.eyePrev.facialPartsDataArrayR)
|
foreach (var part in updateInfo_.eyeNext.facialPartsDataArrayR)
|
||||||
{
|
{
|
||||||
if (part.FacialPartsId == 0) { continue; }
|
if (part.FacialPartsId == 0) { continue; }
|
||||||
rightEyeMorph[part.FacialPartsId - 1].weight = 0;
|
rightEyeMorph[part.FacialPartsId - 1].weight = part.WeightPer / 100;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1175,8 +1175,7 @@ namespace Gallop
|
|||||||
|
|
||||||
public Vector2 GetTimelineEyeTrackRotation(LiveTimelineKeyFacialEyeTrackData key)
|
public Vector2 GetTimelineEyeTrackRotation(LiveTimelineKeyFacialEyeTrackData key)
|
||||||
{
|
{
|
||||||
Vector3 target = new Vector3();
|
if(CalcTargetPosition(key, out Vector3 target))
|
||||||
if(CalcTargetPosition(key, ref target))
|
|
||||||
{
|
{
|
||||||
return GetEyeTrackRotation(target) + new Vector2((float)key.horizontalRatePer / 100, (float)key.verticalRatePer / 100);
|
return GetEyeTrackRotation(target) + new Vector2((float)key.horizontalRatePer / 100, (float)key.verticalRatePer / 100);
|
||||||
}
|
}
|
||||||
@@ -1186,7 +1185,7 @@ namespace Gallop
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool CalcTargetPosition(LiveTimelineKeyFacialEyeTrackData key, ref Vector3 target)
|
public bool CalcTargetPosition(LiveTimelineKeyFacialEyeTrackData key, out Vector3 target)
|
||||||
{
|
{
|
||||||
|
|
||||||
switch (key.targetType)
|
switch (key.targetType)
|
||||||
@@ -1194,13 +1193,29 @@ namespace Gallop
|
|||||||
case FacialEyeTrackTargetType.Arena:
|
case FacialEyeTrackTargetType.Arena:
|
||||||
target = Container.HeadBone.transform.position + new Vector3(0, 1, 10);
|
target = Container.HeadBone.transform.position + new Vector3(0, 1, 10);
|
||||||
return true;
|
return true;
|
||||||
|
case FacialEyeTrackTargetType.CharaForward:
|
||||||
|
target = Container.HeadBone.transform.position + Container.HeadBone.transform.forward;
|
||||||
|
return true;
|
||||||
case FacialEyeTrackTargetType.DirectPosition:
|
case FacialEyeTrackTargetType.DirectPosition:
|
||||||
target = key.DirectPosition;
|
target = key.DirectPosition;
|
||||||
return true;
|
return true;
|
||||||
default:
|
case FacialEyeTrackTargetType.Camera:
|
||||||
break;
|
target = Live.Director.instance.MainCameraTransform.position;
|
||||||
|
return true;
|
||||||
|
case FacialEyeTrackTargetType.MultiCamera1:
|
||||||
|
target = Live.Director.instance._liveTimelineControl.GetMultiCameraWorldPosition(0);
|
||||||
|
return true;
|
||||||
|
case FacialEyeTrackTargetType.MultiCamera2:
|
||||||
|
target = Live.Director.instance._liveTimelineControl.GetMultiCameraWorldPosition(1);
|
||||||
|
return true;
|
||||||
|
case FacialEyeTrackTargetType.MultiCamera3:
|
||||||
|
target = Live.Director.instance._liveTimelineControl.GetMultiCameraWorldPosition(2);
|
||||||
|
return true;
|
||||||
|
case FacialEyeTrackTargetType.MultiCamera4:
|
||||||
|
target = Live.Director.instance._liveTimelineControl.GetMultiCameraWorldPosition(3);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
target = Vector3.zero;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -697,6 +697,16 @@ namespace Gallop.Live.Cutt
|
|||||||
return _multiCameraCache[index].cacheTransform.rotation;
|
return _multiCameraCache[index].cacheTransform.rotation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Vector3 GetMultiCameraWorldPosition(int index)
|
||||||
|
{
|
||||||
|
if (_multiCameraCache == null || _multiCameraCache.Length <= index)
|
||||||
|
{
|
||||||
|
return Vector3.zero;
|
||||||
|
}
|
||||||
|
return _multiCameraCache[index].cacheTransform.position;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public bool ExistsMultiCamera(int index)
|
public bool ExistsMultiCamera(int index)
|
||||||
{
|
{
|
||||||
if (_multiCameraCache != null && index < _multiCameraCache.Length)
|
if (_multiCameraCache != null && index < _multiCameraCache.Length)
|
||||||
@@ -835,7 +845,7 @@ namespace Gallop.Live.Cutt
|
|||||||
{
|
{
|
||||||
if (posFlags.hasFlag((LiveCharaPosition)i) && liveCharactorLocators[i] != null)
|
if (posFlags.hasFlag((LiveCharaPosition)i) && liveCharactorLocators[i] != null)
|
||||||
{
|
{
|
||||||
retPos += liveCharactorLocators[i].liveCharaConstHeightHeadPosition;
|
retPos.y += liveCharactorLocators[i].liveCharaConstHeightHeadPosition.y;
|
||||||
retPos += cameraOffset * liveCharactorLocators[i].liveCharaHeightRatio;
|
retPos += cameraOffset * liveCharactorLocators[i].liveCharaHeightRatio;
|
||||||
retPos += charaPos;
|
retPos += charaPos;
|
||||||
num++;
|
num++;
|
||||||
@@ -849,7 +859,7 @@ namespace Gallop.Live.Cutt
|
|||||||
{
|
{
|
||||||
if (posFlags.hasFlag((LiveCharaPosition)i) && liveCharactorLocators[i] != null)
|
if (posFlags.hasFlag((LiveCharaPosition)i) && liveCharactorLocators[i] != null)
|
||||||
{
|
{
|
||||||
retPos += liveCharactorLocators[i].liveCharaConstHeightWaistPosition;
|
retPos.y += liveCharactorLocators[i].liveCharaConstHeightWaistPosition.y;
|
||||||
retPos += cameraOffset * liveCharactorLocators[i].liveCharaHeightRatio;
|
retPos += cameraOffset * liveCharactorLocators[i].liveCharaHeightRatio;
|
||||||
retPos += charaPos;
|
retPos += charaPos;
|
||||||
num++;
|
num++;
|
||||||
@@ -863,7 +873,7 @@ namespace Gallop.Live.Cutt
|
|||||||
{
|
{
|
||||||
if (posFlags.hasFlag((LiveCharaPosition)i) && liveCharactorLocators[i] != null)
|
if (posFlags.hasFlag((LiveCharaPosition)i) && liveCharactorLocators[i] != null)
|
||||||
{
|
{
|
||||||
retPos += liveCharactorLocators[i].liveCharaConstHeightChestPosition;
|
retPos.y += liveCharactorLocators[i].liveCharaConstHeightChestPosition.y;
|
||||||
retPos += cameraOffset * liveCharactorLocators[i].liveCharaHeightRatio;
|
retPos += cameraOffset * liveCharactorLocators[i].liveCharaHeightRatio;
|
||||||
retPos += charaPos;
|
retPos += charaPos;
|
||||||
num++;
|
num++;
|
||||||
@@ -877,7 +887,7 @@ namespace Gallop.Live.Cutt
|
|||||||
{
|
{
|
||||||
if (posFlags.hasFlag((LiveCharaPosition)i) && liveCharactorLocators[i] != null)
|
if (posFlags.hasFlag((LiveCharaPosition)i) && liveCharactorLocators[i] != null)
|
||||||
{
|
{
|
||||||
retPos += liveCharactorLocators[i].liveCharaFootPosition;
|
retPos.y += liveCharactorLocators[i].liveCharaFootPosition.y;
|
||||||
retPos += cameraOffset * liveCharactorLocators[i].liveCharaHeightRatio;
|
retPos += cameraOffset * liveCharactorLocators[i].liveCharaHeightRatio;
|
||||||
retPos += charaPos;
|
retPos += charaPos;
|
||||||
num++;
|
num++;
|
||||||
|
|||||||
@@ -283,7 +283,7 @@ namespace Gallop.Live
|
|||||||
public HandShakeCamera HandShakeCamera { get; }
|
public HandShakeCamera HandShakeCamera { get; }
|
||||||
//public GallopFrameBuffer FrameBuffer { get; }
|
//public GallopFrameBuffer FrameBuffer { get; }
|
||||||
public Camera MainCameraObject { get; }
|
public Camera MainCameraObject { get; }
|
||||||
public Transform MainCameraTransform { get; }
|
public Transform MainCameraTransform => _mainCameraTransform;
|
||||||
public List<CharacterObject> CharacterObjectList { get; }
|
public List<CharacterObject> CharacterObjectList { get; }
|
||||||
public List<CharaEffectInfo> listShadowEffectInfo { get; }
|
public List<CharaEffectInfo> listShadowEffectInfo { get; }
|
||||||
public List<CharaEffectInfo> listSpotLightEffectInfo { get; }
|
public List<CharaEffectInfo> listSpotLightEffectInfo { get; }
|
||||||
@@ -380,12 +380,12 @@ namespace Gallop.Live
|
|||||||
_instance = this;
|
_instance = this;
|
||||||
Debug.Log(string.Format(CUTT_PATH, live.MusicId));
|
Debug.Log(string.Format(CUTT_PATH, live.MusicId));
|
||||||
Debug.Log(live.BackGroundId);
|
Debug.Log(live.BackGroundId);
|
||||||
Builder.LoadAssetPath(string.Format(CUTT_PATH, live.MusicId), this.gameObject.transform);
|
Builder.LoadAssetPath(string.Format(CUTT_PATH, live.MusicId), transform);
|
||||||
Builder.LoadAssetPath(string.Format(STAGE_PATH, live.BackGroundId), this.gameObject.transform);
|
Builder.LoadAssetPath(string.Format(STAGE_PATH, live.BackGroundId), transform);
|
||||||
|
|
||||||
//Make CharacterObject
|
//Make CharacterObject
|
||||||
|
|
||||||
var characterStandPos = this._liveTimelineControl.transform.Find("CharacterStandPos");
|
var characterStandPos = _liveTimelineControl.transform.Find("CharacterStandPos");
|
||||||
int counter = 0;
|
int counter = 0;
|
||||||
foreach (Transform trans in characterStandPos.GetComponentsInChildren<Transform>())
|
foreach (Transform trans in characterStandPos.GetComponentsInChildren<Transform>())
|
||||||
{
|
{
|
||||||
@@ -393,7 +393,7 @@ namespace Gallop.Live
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
var newObj = Instantiate(trans, this.transform);
|
var newObj = Instantiate(trans, transform);
|
||||||
newObj.gameObject.name = string.Format("CharacterObject{0}", counter);
|
newObj.gameObject.name = string.Format("CharacterObject{0}", counter);
|
||||||
charaObjs.Add(newObj.transform);
|
charaObjs.Add(newObj.transform);
|
||||||
counter++;
|
counter++;
|
||||||
|
|||||||
Reference in New Issue
Block a user