add some extra assets FX and SFX
This commit is contained in:
@@ -41,6 +41,39 @@ public class bodyMountPointsSystem : MonoBehaviour
|
||||
public GameObject mountPointObjectReferencePrefab;
|
||||
|
||||
|
||||
public void removeCharacterBodyMountPointsToTemporalParent (Transform newParent)
|
||||
{
|
||||
for (int i = 0; i < bodyMountPointInfoList.Count; i++) {
|
||||
|
||||
bodyMountPointInfo currentBodyMountPointInfo = bodyMountPointInfoList [i];
|
||||
|
||||
for (int j = 0; j < currentBodyMountPointInfo.objectPointInfoList.Count; j++) {
|
||||
objectPointInfo currentObjectPointInfo = currentBodyMountPointInfo.objectPointInfoList [j];
|
||||
|
||||
if (currentObjectPointInfo.objectTransform != null) {
|
||||
currentObjectPointInfo.objectTransform.SetParent (newParent);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void resetCharacterBodyMountPointsLocalPositions ()
|
||||
{
|
||||
for (int i = 0; i < bodyMountPointInfoList.Count; i++) {
|
||||
|
||||
bodyMountPointInfo currentBodyMountPointInfo = bodyMountPointInfoList [i];
|
||||
|
||||
for (int j = 0; j < currentBodyMountPointInfo.objectPointInfoList.Count; j++) {
|
||||
objectPointInfo currentObjectPointInfo = currentBodyMountPointInfo.objectPointInfoList [j];
|
||||
|
||||
if (currentObjectPointInfo.objectTransform != null) {
|
||||
currentObjectPointInfo.objectTransform.localPosition = Vector3.zero;
|
||||
currentObjectPointInfo.objectTransform.localRotation = Quaternion.identity;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setCharacterBodyMountPointsInfoList ()
|
||||
{
|
||||
for (int i = 0; i < bodyMountPointInfoList.Count; i++) {
|
||||
@@ -63,24 +96,34 @@ public class bodyMountPointsSystem : MonoBehaviour
|
||||
|
||||
if (currentBodyMountPointInfo.useCustomBoneTransform) {
|
||||
currentBone = currentBodyMountPointInfo.customBoneTransform;
|
||||
|
||||
if (currentBone != null) {
|
||||
if (!currentBone.IsChildOf (mainAnimator.transform)) {
|
||||
print ("transform assigned is not part of the current animator, recalculating " + currentBone.name);
|
||||
|
||||
currentBone = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (currentBone == null) {
|
||||
currentBone = mainAnimator.GetBoneTransform (currentBodyMountPointInfo.boneToAttach);
|
||||
}
|
||||
|
||||
if (currentBone == null) {
|
||||
currentBone = mainAnimator.GetBoneTransform (currentBodyMountPointInfo.alternativeBoneToAttach);
|
||||
}
|
||||
|
||||
if (currentBone == null) {
|
||||
currentBone = mainAnimator.GetBoneTransform (HumanBodyBones.Hips);
|
||||
if (mainAnimator.isHuman) {
|
||||
if (currentBone == null) {
|
||||
currentBone = mainAnimator.GetBoneTransform (currentBodyMountPointInfo.boneToAttach);
|
||||
}
|
||||
|
||||
if (currentBone == null) {
|
||||
currentBone = mainAnimator.transform;
|
||||
currentBone = mainAnimator.GetBoneTransform (currentBodyMountPointInfo.alternativeBoneToAttach);
|
||||
}
|
||||
|
||||
print ("WARNING: No bone found on character body elements list for " + currentBodyMountPointInfo.Name + "" +
|
||||
" setting that character element inside the character model " + currentBone.name);
|
||||
if (currentBone == null) {
|
||||
currentBone = mainAnimator.GetBoneTransform (HumanBodyBones.Hips);
|
||||
|
||||
if (currentBone == null) {
|
||||
currentBone = mainAnimator.transform;
|
||||
|
||||
print ("WARNING: No bone found on character body elements list for " + currentBodyMountPointInfo.Name + "" +
|
||||
" setting that character element inside the character model " + currentBone.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user