bug fix
This commit is contained in:
@@ -83,21 +83,18 @@ public class UmaViewerBuilder : MonoBehaviour
|
||||
if (characters[i].CharaEntry.Name != "")
|
||||
{
|
||||
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)
|
||||
{
|
||||
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);
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@@ -995,32 +995,32 @@ namespace Gallop
|
||||
|
||||
EyeMorphs.ForEach(morph => morph.weight = 0);
|
||||
|
||||
if (updateInfo_.eyePrev != null)
|
||||
if (updateInfo_.eyeNext != null)
|
||||
{
|
||||
if (weightRatio != 1)
|
||||
{
|
||||
foreach (var part in updateInfo_.eyePrev.facialPartsDataArrayL)
|
||||
foreach (var part in updateInfo_.eyeNext.facialPartsDataArrayL)
|
||||
{
|
||||
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; }
|
||||
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
|
||||
{
|
||||
foreach (var part in updateInfo_.eyePrev.facialPartsDataArrayL)
|
||||
foreach (var part in updateInfo_.eyeNext.facialPartsDataArrayL)
|
||||
{
|
||||
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; }
|
||||
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)
|
||||
{
|
||||
Vector3 target = new Vector3();
|
||||
if(CalcTargetPosition(key, ref target))
|
||||
if(CalcTargetPosition(key, out Vector3 target))
|
||||
{
|
||||
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)
|
||||
@@ -1194,13 +1193,29 @@ namespace Gallop
|
||||
case FacialEyeTrackTargetType.Arena:
|
||||
target = Container.HeadBone.transform.position + new Vector3(0, 1, 10);
|
||||
return true;
|
||||
case FacialEyeTrackTargetType.CharaForward:
|
||||
target = Container.HeadBone.transform.position + Container.HeadBone.transform.forward;
|
||||
return true;
|
||||
case FacialEyeTrackTargetType.DirectPosition:
|
||||
target = key.DirectPosition;
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
case FacialEyeTrackTargetType.Camera:
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -697,6 +697,16 @@ namespace Gallop.Live.Cutt
|
||||
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)
|
||||
{
|
||||
if (_multiCameraCache != null && index < _multiCameraCache.Length)
|
||||
@@ -835,7 +845,7 @@ namespace Gallop.Live.Cutt
|
||||
{
|
||||
if (posFlags.hasFlag((LiveCharaPosition)i) && liveCharactorLocators[i] != null)
|
||||
{
|
||||
retPos += liveCharactorLocators[i].liveCharaConstHeightHeadPosition;
|
||||
retPos.y += liveCharactorLocators[i].liveCharaConstHeightHeadPosition.y;
|
||||
retPos += cameraOffset * liveCharactorLocators[i].liveCharaHeightRatio;
|
||||
retPos += charaPos;
|
||||
num++;
|
||||
@@ -849,7 +859,7 @@ namespace Gallop.Live.Cutt
|
||||
{
|
||||
if (posFlags.hasFlag((LiveCharaPosition)i) && liveCharactorLocators[i] != null)
|
||||
{
|
||||
retPos += liveCharactorLocators[i].liveCharaConstHeightWaistPosition;
|
||||
retPos.y += liveCharactorLocators[i].liveCharaConstHeightWaistPosition.y;
|
||||
retPos += cameraOffset * liveCharactorLocators[i].liveCharaHeightRatio;
|
||||
retPos += charaPos;
|
||||
num++;
|
||||
@@ -863,7 +873,7 @@ namespace Gallop.Live.Cutt
|
||||
{
|
||||
if (posFlags.hasFlag((LiveCharaPosition)i) && liveCharactorLocators[i] != null)
|
||||
{
|
||||
retPos += liveCharactorLocators[i].liveCharaConstHeightChestPosition;
|
||||
retPos.y += liveCharactorLocators[i].liveCharaConstHeightChestPosition.y;
|
||||
retPos += cameraOffset * liveCharactorLocators[i].liveCharaHeightRatio;
|
||||
retPos += charaPos;
|
||||
num++;
|
||||
@@ -877,7 +887,7 @@ namespace Gallop.Live.Cutt
|
||||
{
|
||||
if (posFlags.hasFlag((LiveCharaPosition)i) && liveCharactorLocators[i] != null)
|
||||
{
|
||||
retPos += liveCharactorLocators[i].liveCharaFootPosition;
|
||||
retPos.y += liveCharactorLocators[i].liveCharaFootPosition.y;
|
||||
retPos += cameraOffset * liveCharactorLocators[i].liveCharaHeightRatio;
|
||||
retPos += charaPos;
|
||||
num++;
|
||||
|
||||
@@ -283,7 +283,7 @@ namespace Gallop.Live
|
||||
public HandShakeCamera HandShakeCamera { get; }
|
||||
//public GallopFrameBuffer FrameBuffer { get; }
|
||||
public Camera MainCameraObject { get; }
|
||||
public Transform MainCameraTransform { get; }
|
||||
public Transform MainCameraTransform => _mainCameraTransform;
|
||||
public List<CharacterObject> CharacterObjectList { get; }
|
||||
public List<CharaEffectInfo> listShadowEffectInfo { get; }
|
||||
public List<CharaEffectInfo> listSpotLightEffectInfo { get; }
|
||||
@@ -380,12 +380,12 @@ namespace Gallop.Live
|
||||
_instance = this;
|
||||
Debug.Log(string.Format(CUTT_PATH, live.MusicId));
|
||||
Debug.Log(live.BackGroundId);
|
||||
Builder.LoadAssetPath(string.Format(CUTT_PATH, live.MusicId), this.gameObject.transform);
|
||||
Builder.LoadAssetPath(string.Format(STAGE_PATH, live.BackGroundId), this.gameObject.transform);
|
||||
Builder.LoadAssetPath(string.Format(CUTT_PATH, live.MusicId), transform);
|
||||
Builder.LoadAssetPath(string.Format(STAGE_PATH, live.BackGroundId), transform);
|
||||
|
||||
//Make CharacterObject
|
||||
|
||||
var characterStandPos = this._liveTimelineControl.transform.Find("CharacterStandPos");
|
||||
var characterStandPos = _liveTimelineControl.transform.Find("CharacterStandPos");
|
||||
int counter = 0;
|
||||
foreach (Transform trans in characterStandPos.GetComponentsInChildren<Transform>())
|
||||
{
|
||||
@@ -393,7 +393,7 @@ namespace Gallop.Live
|
||||
{
|
||||
continue;
|
||||
}
|
||||
var newObj = Instantiate(trans, this.transform);
|
||||
var newObj = Instantiate(trans, transform);
|
||||
newObj.gameObject.name = string.Format("CharacterObject{0}", counter);
|
||||
charaObjs.Add(newObj.transform);
|
||||
counter++;
|
||||
|
||||
Reference in New Issue
Block a user