mirror of
https://gitgud.io/AbstractConcept/rimworld-animation-studio.git
synced 2024-08-15 00:43:27 +00:00
Actor addons and animation
- Includes addons for hands and sex toys - WIP and very buggy
This commit is contained in:
parent
d9e6288e3a
commit
cd4711a8e5
400 changed files with 10269 additions and 661 deletions
|
@ -107,6 +107,7 @@ namespace RimWorldAnimationStudio
|
|||
{ Debug.LogWarning("Cannot make new actor - there is no AnimationDef"); return false; }
|
||||
|
||||
Workspace.animationDef.actors.Add(this);
|
||||
Workspace.actorID = Workspace.animationDef.actors.Count - 1;
|
||||
|
||||
foreach (AnimationStage stage in Workspace.animationDef.animationStages)
|
||||
{
|
||||
|
@ -116,6 +117,7 @@ namespace RimWorldAnimationStudio
|
|||
{
|
||||
stage.animationClips.Add(clip);
|
||||
stage.Initialize();
|
||||
stage.OnPostLoad();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
31
Assets/Scripts/AnimationComponents/ActorAddon.cs
Normal file
31
Assets/Scripts/AnimationComponents/ActorAddon.cs
Normal file
|
@ -0,0 +1,31 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace RimWorldAnimationStudio
|
||||
{
|
||||
public class ActorAddon
|
||||
{
|
||||
public string addonName;
|
||||
public int anchoringActor;
|
||||
public string anchorName;
|
||||
public string layer = "Pawn";
|
||||
public float scale;
|
||||
public bool render;
|
||||
|
||||
[XmlIgnore] public SimpleCurve PosX = new SimpleCurve();
|
||||
[XmlIgnore] public SimpleCurve PosZ = new SimpleCurve();
|
||||
[XmlIgnore] public SimpleCurve Rotation = new SimpleCurve();
|
||||
|
||||
public ActorAddon() { }
|
||||
|
||||
public ActorAddon(string addonName, float scale = 1f)
|
||||
{
|
||||
this.addonName = addonName;
|
||||
this.scale = scale;
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/AnimationComponents/ActorAddon.cs.meta
Normal file
11
Assets/Scripts/AnimationComponents/ActorAddon.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f4d87003a570d5241affe4170ae91045
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -9,6 +9,9 @@ namespace RimWorldAnimationStudio
|
|||
{
|
||||
public class PawnAnimationClip : AnimationClip
|
||||
{
|
||||
[XmlArray("addons"), XmlArrayItem("li")] public List<ActorAddon> _addons = new List<ActorAddon>();
|
||||
[XmlIgnore] public List<ActorAddon> addons = new List<ActorAddon>();
|
||||
|
||||
[XmlAttribute("Class")] public string className = "Rimworld_Animations.PawnAnimationClip";
|
||||
[XmlArray("keyframes"), XmlArrayItem("li")] public List<PawnKeyframe> keyframes = new List<PawnKeyframe>();
|
||||
|
||||
|
@ -35,6 +38,13 @@ namespace RimWorldAnimationStudio
|
|||
HeadBob.Clear();
|
||||
GenitalAngle.Clear();
|
||||
|
||||
foreach (ActorAddon addon in addons)
|
||||
{
|
||||
addon.PosX.Clear();
|
||||
addon.PosZ.Clear();
|
||||
addon.Rotation.Clear();
|
||||
}
|
||||
|
||||
int keyframePosition = 0;
|
||||
int duration = 0;
|
||||
|
||||
|
@ -61,6 +71,16 @@ namespace RimWorldAnimationStudio
|
|||
HeadBob.Add((float)keyframe.atTick / (float)duration, keyframe.headBob, true);
|
||||
GenitalAngle.Add((float)keyframe.atTick / (float)duration, keyframe.genitalAngle, true);
|
||||
|
||||
foreach (ActorAddon addon in addons)
|
||||
{
|
||||
if (keyframe.addonKeyframes.Any(x => x.addonName == addon.addonName) == false)
|
||||
{ keyframe.addonKeyframes.Add(new AddonKeyframe(addon.addonName)); }
|
||||
|
||||
addon.PosX.Add((float)keyframe.atTick / (float)duration, keyframe.GetAddonKeyframe(addon.addonName).posX, true);
|
||||
addon.PosZ.Add((float)keyframe.atTick / (float)duration, keyframe.GetAddonKeyframe(addon.addonName).posZ, true);
|
||||
addon.Rotation.Add((float)keyframe.atTick / (float)duration, keyframe.GetAddonKeyframe(addon.addonName).rotation, true);
|
||||
}
|
||||
|
||||
if (i + 1 < keyframes.Count)
|
||||
{ keyframes[i].tickDuration = keyframes[i + 1].atTick.Value - keyframes[i].atTick.Value; }
|
||||
}
|
||||
|
@ -76,6 +96,16 @@ namespace RimWorldAnimationStudio
|
|||
HeadBob.Add((float)keyframePosition / (float)duration, keyframe.headBob, true);
|
||||
GenitalAngle.Add((float)keyframePosition / (float)duration, keyframe.genitalAngle, true);
|
||||
|
||||
foreach (ActorAddon addon in addons)
|
||||
{
|
||||
if (keyframe.addonKeyframes.Any(x => x.addonName == addon.addonName) == false)
|
||||
{ keyframe.addonKeyframes.Add(new AddonKeyframe(addon.addonName)); }
|
||||
|
||||
addon.PosX.Add((float)keyframePosition / (float)duration, keyframe.GetAddonKeyframe(addon.addonName).posX, true);
|
||||
addon.PosZ.Add((float)keyframePosition / (float)duration, keyframe.GetAddonKeyframe(addon.addonName).posZ, true);
|
||||
addon.Rotation.Add((float)keyframePosition / (float)duration, keyframe.GetAddonKeyframe(addon.addonName).rotation, true);
|
||||
}
|
||||
|
||||
if (keyframe.tickDuration != 1 && keyframe.quiver.HasValue)
|
||||
{
|
||||
quiver.Add(keyframePosition, true);
|
||||
|
@ -88,7 +118,57 @@ namespace RimWorldAnimationStudio
|
|||
}
|
||||
}
|
||||
|
||||
public override void ValidateData() { }
|
||||
public void AddActorAddon(string addonName, float scale = 1f)
|
||||
{
|
||||
if (addons.Any(x => x.addonName == addonName) == false)
|
||||
{
|
||||
addons.Add(new ActorAddon(addonName, scale));
|
||||
}
|
||||
|
||||
foreach (PawnKeyframe keyframe in keyframes)
|
||||
{
|
||||
if (keyframe.addonKeyframes.Any(x => x.addonName == addonName) == false)
|
||||
{ keyframe.addonKeyframes.Add(new AddonKeyframe(addonName)); }
|
||||
}
|
||||
}
|
||||
|
||||
public void ShowOrHideActorAddon(string addonName, bool flag)
|
||||
{
|
||||
ActorAddon addon = GetActorAddon(addonName);
|
||||
|
||||
if (addon != null)
|
||||
{ addon.render = flag; }
|
||||
}
|
||||
|
||||
public bool IsActorAddonVisible(string addonName)
|
||||
{
|
||||
ActorAddon addon = GetActorAddon(addonName);
|
||||
|
||||
if (addon != null)
|
||||
{ return addon.render; }
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public ActorAddon GetActorAddon(string addonName)
|
||||
{
|
||||
return addons.FirstOrDefault(x => x.addonName == addonName);
|
||||
}
|
||||
|
||||
public override void ValidateData()
|
||||
{
|
||||
_addons.Clear();
|
||||
|
||||
foreach (ActorAddon addon in addons)
|
||||
{
|
||||
Debug.Log(addon.anchorName);
|
||||
|
||||
if (addon.render)
|
||||
{
|
||||
_addons.Add(addon);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int GetOwningActorID()
|
||||
{
|
||||
|
@ -132,5 +212,19 @@ namespace RimWorldAnimationStudio
|
|||
BuildSimpleCurves();
|
||||
return true;
|
||||
}
|
||||
|
||||
public void OnPostLoad()
|
||||
{
|
||||
addons = _addons.Copy();
|
||||
|
||||
foreach (PawnKeyframe keyframe in keyframes)
|
||||
{
|
||||
keyframe.OnPostLoad();
|
||||
}
|
||||
|
||||
AddActorAddon("left hand", 0.667f);
|
||||
AddActorAddon("right hand", 0.667f);
|
||||
AddActorAddon("dildo");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,10 +22,10 @@ namespace RimWorldAnimationStudio
|
|||
foreach (PawnAnimationClip clip in animationClips)
|
||||
{
|
||||
clip.BuildSimpleCurves();
|
||||
|
||||
|
||||
// Select playTimeTicks as longest playtime of all the animations
|
||||
if (clip.duration > playTimeTicks)
|
||||
{ playTimeTicks = clip.duration; }
|
||||
{ playTimeTicks = clip.duration; }
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -53,15 +53,23 @@ namespace RimWorldAnimationStudio
|
|||
foreach (Actor actor in Workspace.animationDef.actors)
|
||||
{
|
||||
PawnAnimationClip clip = new PawnAnimationClip();
|
||||
|
||||
|
||||
if (clip.MakeNew(actor.GetActorID()))
|
||||
{ animationClips.Add(clip); }
|
||||
}
|
||||
|
||||
Initialize();
|
||||
playTimeTicksQuick = playTimeTicks;
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void OnPostLoad()
|
||||
{
|
||||
foreach (PawnAnimationClip clip in animationClips)
|
||||
{
|
||||
clip.OnPostLoad();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace RimWorldAnimationStudio
|
||||
{
|
||||
public class AddonKeyframe
|
||||
{
|
||||
public string addonName;
|
||||
public float posX;
|
||||
public float posZ;
|
||||
public float rotation;
|
||||
|
||||
public AddonKeyframe() { }
|
||||
|
||||
public AddonKeyframe(string addonName)
|
||||
{
|
||||
this.addonName = addonName;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 60509e7cd8e74e6419c5c93304440a17
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -1,4 +1,5 @@
|
|||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
@ -19,6 +20,10 @@ namespace RimWorldAnimationStudio
|
|||
|
||||
public float genitalAngle;
|
||||
public bool? quiver;
|
||||
|
||||
[XmlArray("addonKeyframes"), XmlArrayItem("li")] public List<AddonKeyframe> _addonKeyframes = new List<AddonKeyframe>();
|
||||
|
||||
[XmlIgnore] public List<AddonKeyframe> addonKeyframes = new List<AddonKeyframe>();
|
||||
[XmlIgnore] public int keyframeID;
|
||||
[XmlIgnore] public int actorID = -1;
|
||||
|
||||
|
@ -28,12 +33,32 @@ namespace RimWorldAnimationStudio
|
|||
public override void ValidateData()
|
||||
{
|
||||
soundEffect = Tags.soundDefs.Concat(CustomTags.soundDefs).Contains(soundEffect) ? soundEffect : null;
|
||||
|
||||
_addonKeyframes.Clear();
|
||||
|
||||
foreach (AddonKeyframe addonKeyframe in addonKeyframes)
|
||||
{
|
||||
ActorAddon addon = Workspace.Instance.GetAnimationClipThatOwnsKeyframe(keyframeID, out int clipID).GetActorAddon(addonKeyframe.addonName);
|
||||
|
||||
if (addon.render)
|
||||
{ _addonKeyframes.Add(addonKeyframe.Copy()); }
|
||||
}
|
||||
}
|
||||
|
||||
public void OnPostLoad()
|
||||
{
|
||||
addonKeyframes.Clear();
|
||||
|
||||
foreach (AddonKeyframe addonKeyframe in _addonKeyframes)
|
||||
{
|
||||
addonKeyframes.Add(addonKeyframe.Copy());
|
||||
}
|
||||
}
|
||||
|
||||
public void GenerateKeyframeID(int actorID)
|
||||
{
|
||||
this.actorID = actorID;
|
||||
int _keyframeID = Random.Range(100000, 1000000);
|
||||
int _keyframeID = UnityEngine.Random.Range(100000, 1000000);
|
||||
|
||||
if (Workspace.animationDef.animationStages.Any(x => x.animationClips.Any(y => y.keyframes.Any(z => z.keyframeID == _keyframeID))))
|
||||
{
|
||||
|
@ -51,5 +76,10 @@ namespace RimWorldAnimationStudio
|
|||
{
|
||||
return Selectable.allSelectablesArray.FirstOrDefault(x => x.GetComponent<KeyframeSlider>()?.keyframeID == keyframeID)?.GetComponent< KeyframeSlider>();
|
||||
}
|
||||
|
||||
public AddonKeyframe GetAddonKeyframe(string addonName)
|
||||
{
|
||||
return addonKeyframes.FirstOrDefault(x => x.addonName == addonName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
17
Assets/Scripts/Extensions/Vector3Extension.cs
Normal file
17
Assets/Scripts/Extensions/Vector3Extension.cs
Normal file
|
@ -0,0 +1,17 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
namespace RimWorldAnimationStudio
|
||||
{
|
||||
public static class Vector3Extension
|
||||
{
|
||||
public static Vector3 FlipAxes(this Vector3 v)
|
||||
{
|
||||
return new Vector3(v.x, v.z, v.y);
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/Extensions/Vector3Extension.cs.meta
Normal file
11
Assets/Scripts/Extensions/Vector3Extension.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 1b49e51e0077dee41a199e4e81f26e32
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
51
Assets/Scripts/GUI/ActorAddonCard.cs
Normal file
51
Assets/Scripts/GUI/ActorAddonCard.cs
Normal file
|
@ -0,0 +1,51 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace RimWorldAnimationStudio
|
||||
{
|
||||
public class ActorAddonCard : MonoBehaviour
|
||||
{
|
||||
public string addonName;
|
||||
public InputField xOffsetField;
|
||||
public InputField zOffsetField;
|
||||
public InputField rotationField;
|
||||
|
||||
public void Start()
|
||||
{
|
||||
xOffsetField.onEndEdit.AddListener(delegate { OnFieldValueChanged(); });
|
||||
zOffsetField.onEndEdit.AddListener(delegate { OnFieldValueChanged(); });
|
||||
rotationField.onEndEdit.AddListener(delegate { OnFieldValueChanged(); });
|
||||
|
||||
AnimationController.Instance.animationClipTimeField.onValueChanged.AddListener(delegate { OnKeyframeValueChanged(); });
|
||||
}
|
||||
|
||||
public void OnFieldValueChanged()
|
||||
{
|
||||
if (Workspace.animationDef == null) return;
|
||||
PawnAnimationClip clip = Workspace.Instance.GetCurrentPawnAnimationClip();
|
||||
PawnKeyframe keyframe = Workspace.Instance.GetCurrentPawnKeyframe(true);
|
||||
|
||||
keyframe.GetAddonKeyframe(addonName).posX = float.Parse(xOffsetField.text);
|
||||
keyframe.GetAddonKeyframe(addonName).posZ = float.Parse(zOffsetField.text);
|
||||
keyframe.GetAddonKeyframe(addonName).rotation = float.Parse(rotationField.text);
|
||||
|
||||
clip.BuildSimpleCurves();
|
||||
Workspace.Instance.RecordEvent("Actor addon position / orientation");
|
||||
}
|
||||
|
||||
public void OnKeyframeValueChanged()
|
||||
{
|
||||
if (Workspace.animationDef == null) return;
|
||||
PawnAnimationClip clip = Workspace.Instance.GetCurrentPawnAnimationClip();
|
||||
|
||||
xOffsetField.SetTextWithoutNotify(clip.GetActorAddon(addonName).PosX.Evaluate((float)AnimationController.Instance.stageTick / Workspace.StageWindowSize).ToString());
|
||||
zOffsetField.SetTextWithoutNotify(clip.GetActorAddon(addonName).PosZ.Evaluate((float)AnimationController.Instance.stageTick / Workspace.StageWindowSize).ToString());
|
||||
rotationField.SetTextWithoutNotify(clip.GetActorAddon(addonName).Rotation.Evaluate((float)AnimationController.Instance.stageTick / Workspace.StageWindowSize).ToString());
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/GUI/ActorAddonCard.cs.meta
Normal file
11
Assets/Scripts/GUI/ActorAddonCard.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8a63bb35c73985c46b65383f08d4afd9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -32,6 +32,12 @@ namespace RimWorldAnimationStudio
|
|||
else
|
||||
{ bodyRenderer.color = Constants.ColorWhite; }
|
||||
|
||||
foreach (ActorAddon addon in Workspace.animationDef.animationStages[Workspace.stageID].animationClips[actorID].addons)
|
||||
{
|
||||
ActorBodyPart bodyPart = GetComponentsInChildren<ActorBodyPart>(true).FirstOrDefault(x => x.addonName == addon.addonName);
|
||||
bodyPart?.gameObject?.SetActive(addon.render);
|
||||
}
|
||||
|
||||
//headRenderer.gameObject.SetActive(Workspace.animationDef.actors[actorID].GetAlienRaceDef().isHumanoid);
|
||||
//appendageRenderer.gameObject.SetActive(Workspace.animationDef.actors[actorID].requiredGenitals.Any(x => x == "Penis") || Workspace.animationDef.actors[actorID].isFucking);
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ namespace RimWorldAnimationStudio
|
|||
public SpriteRenderer bodyPartRenderer;
|
||||
public ActorBody parent;
|
||||
public bool isHead = false;
|
||||
public string addonName;
|
||||
public bool isSelected = false;
|
||||
|
||||
private Vector3 delta = new Vector3();
|
||||
|
@ -46,7 +47,56 @@ namespace RimWorldAnimationStudio
|
|||
if (delta == Vector3.zero)
|
||||
{ delta = mousePosition - transform.position; }
|
||||
|
||||
if (isHead)
|
||||
if (addonName != null && addonName != "")
|
||||
{
|
||||
AddonKeyframe addonKeyframe = keyframe.GetAddonKeyframe(addonName);
|
||||
ActorAddon addon = Workspace.Instance.GetCurrentPawnAnimationClip().GetActorAddon(addonName);
|
||||
|
||||
if (Workspace.actorManipulationMode == ActorManipulationMode.Pan)
|
||||
{
|
||||
Vector3 anchor;
|
||||
|
||||
ActorBody anchoringActorBody = AnimationController.Instance.actorBodies.GetComponentsInChildren<ActorBody>()?.FirstOrDefault(x => x.actorID == addon.anchoringActor);
|
||||
Vector3 bodyPos = new Vector3(anchoringActorBody.transform.position.x, anchoringActorBody.transform.position.y, 0);
|
||||
AlienRaceDef alienRaceDef = Workspace.animationDef.actors[addon.anchoringActor].GetAlienRaceDef();
|
||||
Actor anchoringActor = Workspace.animationDef.actors[addon.anchoringActor];
|
||||
int bodyFacing = (int)Workspace.animationDef.animationStages[Workspace.stageID].animationClips[addon.anchoringActor].BodyFacing.Evaluate((float)AnimationController.Instance.stageTick / Workspace.StageWindowSize);
|
||||
|
||||
switch (addon.anchorName)
|
||||
{
|
||||
case "torso": anchor = bodyPos; break;
|
||||
case "head": anchor = new Vector3(anchoringActorBody.transform.Find("ActorHead").position.x, anchoringActorBody.transform.Find("ActorHead").position.y, 0); break;
|
||||
case "groin": anchor = bodyPos + Quaternion.AngleAxis(anchoringActorBody.transform.rotation.eulerAngles.z, Vector3.forward) * PawnUtility.GroinOffsetAt(anchoringActor.bodyType, bodyFacing).FlipAxes(); break;
|
||||
case "left breast": anchor = bodyPos + Quaternion.AngleAxis(anchoringActorBody.transform.rotation.eulerAngles.z, Vector3.forward) * PawnUtility.BreastLeftOffsetAt(anchoringActor.bodyType, bodyFacing).FlipAxes(); break;
|
||||
case "right breast": anchor = bodyPos + Quaternion.AngleAxis(anchoringActorBody.transform.rotation.eulerAngles.z, Vector3.forward) * PawnUtility.BreastRightOffsetAt(anchoringActor.bodyType, bodyFacing).FlipAxes(); break;
|
||||
default: anchor = new Vector3(); break;
|
||||
}
|
||||
|
||||
transform.position = new Vector3(mousePosition.x, mousePosition.y, 0f);
|
||||
|
||||
addonKeyframe.posX = transform.position.x - anchor.x;
|
||||
addonKeyframe.posZ = transform.position.y - anchor.y;
|
||||
|
||||
ActorKeyframeCard.Instance.transform.GetComponentsInChildren<ActorAddonCard>()?.FirstOrDefault(x => x.addonName == addonName)?.OnKeyframeValueChanged();
|
||||
}
|
||||
|
||||
else if (Workspace.actorManipulationMode == ActorManipulationMode.Rotate)
|
||||
{
|
||||
float angle = -Vector2.SignedAngle(Vector2.down, (Vector2)mousePosition - (Vector2)transform.position);
|
||||
addonKeyframe.rotation = angle;
|
||||
}
|
||||
|
||||
else if (Workspace.actorManipulationMode == ActorManipulationMode.Face)
|
||||
{
|
||||
//float angle = Vector2.SignedAngle(Vector2.up, (Vector2)mousePosition - (Vector2)transform.position);
|
||||
//int facing = -Mathf.RoundToInt(angle / 90f);
|
||||
//facing = facing < 0 ? facing + 4 : facing;
|
||||
|
||||
//keyframe.headFacing = facing;
|
||||
}
|
||||
}
|
||||
|
||||
else if (isHead)
|
||||
{
|
||||
if (Workspace.actorManipulationMode == ActorManipulationMode.Pan)
|
||||
{
|
||||
|
|
|
@ -20,6 +20,7 @@ namespace RimWorldAnimationStudio
|
|||
|
||||
public void Pop()
|
||||
{
|
||||
Initialize();
|
||||
gameObject.SetActive(gameObject.activeSelf == false);
|
||||
}
|
||||
|
||||
|
|
215
Assets/Scripts/GUI/DialogBoxes/SelectActorAddonsDialog.cs
Normal file
215
Assets/Scripts/GUI/DialogBoxes/SelectActorAddonsDialog.cs
Normal file
|
@ -0,0 +1,215 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace RimWorldAnimationStudio
|
||||
{
|
||||
public class SelectActorAddonsDialog : DialogBox
|
||||
{
|
||||
public Toggle handLeftToggle;
|
||||
public Toggle handRightToggle;
|
||||
public Toggle sexToyToggle;
|
||||
|
||||
public Dropdown handLeftAnchor;
|
||||
public Dropdown handRightAnchor;
|
||||
public Dropdown sexToyAnchor;
|
||||
|
||||
public InputField handLeftAnchoringPawn;
|
||||
public InputField handRightAnchoringPawn;
|
||||
public InputField sexToyAnchoringPawn;
|
||||
|
||||
public Dropdown handLeftLayer;
|
||||
public Dropdown handRightLayer;
|
||||
public Dropdown sexToyLayer;
|
||||
|
||||
public GameObject handLeftControls;
|
||||
public GameObject handRightControls;
|
||||
public GameObject sexToyControls;
|
||||
|
||||
public override void Initialize(bool addedNewTag = false)
|
||||
{
|
||||
if (Workspace.animationDef == null) return;
|
||||
PawnAnimationClip clip = Workspace.animationDef.animationStages[Workspace.stageID].animationClips[Workspace.actorID];
|
||||
|
||||
if (clip?.GetActorAddon("left hand") != null)
|
||||
{
|
||||
switch (clip.GetActorAddon("left hand").anchorName)
|
||||
{
|
||||
case "torso": handLeftAnchor.value = 1; break;
|
||||
case "head": handLeftAnchor.value = 2; break;
|
||||
case "groin": handLeftAnchor.value = 3; break;
|
||||
case "left breast": handLeftAnchor.value = 4; break;
|
||||
case "right breast": handLeftAnchor.value = 5; break;
|
||||
default: handLeftAnchor.value = 0; break;
|
||||
}
|
||||
}
|
||||
|
||||
if (clip?.GetActorAddon("right hand") != null)
|
||||
{
|
||||
switch (clip.GetActorAddon("right hand").anchorName)
|
||||
{
|
||||
case "torso": handRightAnchor.value = 1; break;
|
||||
case "head": handRightAnchor.value = 2; break;
|
||||
case "groin": handRightAnchor.value = 3; break;
|
||||
case "left breast": handRightAnchor.value = 4; break;
|
||||
case "right breast": handRightAnchor.value = 5; break;
|
||||
default: handRightAnchor.value = 0; break;
|
||||
}
|
||||
}
|
||||
|
||||
if (clip?.GetActorAddon("dildo") != null)
|
||||
{
|
||||
switch (clip.GetActorAddon("dildo").anchorName)
|
||||
{
|
||||
case "torso": sexToyAnchor.value = 1; break;
|
||||
case "head": sexToyAnchor.value = 2; break;
|
||||
case "groin": sexToyAnchor.value = 3; break;
|
||||
case "left breast": sexToyAnchor.value = 4; break;
|
||||
case "right breast": sexToyAnchor.value = 5; break;
|
||||
default: sexToyAnchor.value = 0; break;
|
||||
}
|
||||
}
|
||||
|
||||
if (clip?.GetActorAddon("left hand") != null)
|
||||
{
|
||||
handLeftLayer.value = handLeftLayer.options.IndexOf(handLeftLayer.options.First(x => x.text == clip.GetActorAddon("left hand").layer));
|
||||
handLeftAnchoringPawn.text = clip.GetActorAddon("left hand").anchoringActor.ToString();
|
||||
}
|
||||
|
||||
if (clip?.GetActorAddon("right hand") != null)
|
||||
{
|
||||
handRightLayer.value = handRightLayer.options.IndexOf(handRightLayer.options.First(x => x.text == clip.GetActorAddon("right hand").layer));
|
||||
handRightAnchoringPawn.text = clip.GetActorAddon("right hand").anchoringActor.ToString();
|
||||
}
|
||||
|
||||
if (clip?.GetActorAddon("dildo") != null)
|
||||
{
|
||||
sexToyLayer.value = sexToyLayer.options.IndexOf(sexToyLayer.options.First(x => x.text == clip.GetActorAddon("dildo").layer));
|
||||
sexToyAnchoringPawn.text = clip.GetActorAddon("dildo").anchoringActor.ToString();
|
||||
}
|
||||
|
||||
handLeftToggle.isOn = clip.IsActorAddonVisible("left hand");
|
||||
handRightToggle.isOn = clip.IsActorAddonVisible("right hand");
|
||||
sexToyToggle.isOn = clip.IsActorAddonVisible("dildo");
|
||||
|
||||
//handLeftControls.SetActive(handLeftToggle.isOn);
|
||||
//handRightControls.SetActive(handRightToggle.isOn);
|
||||
//sexToyControls.SetActive(sexToyToggle.isOn);
|
||||
}
|
||||
|
||||
public void OnToggleChanged()
|
||||
{
|
||||
PawnAnimationClip clip = Workspace.animationDef.animationStages[Workspace.stageID].animationClips[Workspace.actorID];
|
||||
|
||||
clip.ShowOrHideActorAddon("left hand", handLeftToggle.isOn);
|
||||
clip.ShowOrHideActorAddon("right hand", handRightToggle.isOn);
|
||||
clip.ShowOrHideActorAddon("dildo", sexToyToggle.isOn);
|
||||
|
||||
//Initialize();
|
||||
}
|
||||
|
||||
public void OnValueChanged()
|
||||
{
|
||||
PawnAnimationClip clip = Workspace.animationDef.animationStages[Workspace.stageID].animationClips[Workspace.actorID];
|
||||
|
||||
if (clip?.GetActorAddon("left hand") != null)
|
||||
{
|
||||
switch (handLeftAnchor.value)
|
||||
{
|
||||
case 1: clip.GetActorAddon("left hand").anchorName = "torso"; break;
|
||||
case 2: clip.GetActorAddon("left hand").anchorName = "head"; break;
|
||||
case 3: clip.GetActorAddon("left hand").anchorName = "groin"; break;
|
||||
case 4: clip.GetActorAddon("left hand").anchorName = "left breast"; break;
|
||||
case 5: clip.GetActorAddon("left hand").anchorName = "right breast"; break;
|
||||
default: clip.GetActorAddon("left hand").anchorName = null; break;
|
||||
}
|
||||
}
|
||||
|
||||
if (clip?.GetActorAddon("right hand") != null)
|
||||
{
|
||||
switch (handRightAnchor.value)
|
||||
{
|
||||
case 1: clip.GetActorAddon("right hand").anchorName = "torso"; break;
|
||||
case 2: clip.GetActorAddon("right hand").anchorName = "head"; break;
|
||||
case 3: clip.GetActorAddon("right hand").anchorName = "groin"; break;
|
||||
case 4: clip.GetActorAddon("right hand").anchorName = "left breast"; break;
|
||||
case 5: clip.GetActorAddon("right hand").anchorName = "right breast"; break;
|
||||
default: clip.GetActorAddon("right hand").anchorName = null; break;
|
||||
}
|
||||
}
|
||||
|
||||
if (clip?.GetActorAddon("dildo") != null)
|
||||
{
|
||||
switch (sexToyAnchor.value)
|
||||
{
|
||||
case 1: clip.GetActorAddon("dildo").anchorName = "torso"; break;
|
||||
case 2: clip.GetActorAddon("dildo").anchorName = "head"; break;
|
||||
case 3: clip.GetActorAddon("dildo").anchorName = "groin"; break;
|
||||
case 4: clip.GetActorAddon("dildo").anchorName = "left breast"; break;
|
||||
case 5: clip.GetActorAddon("dildo").anchorName = "right breast"; break;
|
||||
default: clip.GetActorAddon("dildo").anchorName = null; break;
|
||||
}
|
||||
}
|
||||
|
||||
//Initialize();
|
||||
}
|
||||
|
||||
public void OnLayerChanged()
|
||||
{
|
||||
PawnAnimationClip clip = Workspace.animationDef.animationStages[Workspace.stageID].animationClips[Workspace.actorID];
|
||||
|
||||
if (clip?.GetActorAddon("left hand") != null)
|
||||
{ clip.GetActorAddon("left hand").layer = handLeftLayer.options[handLeftLayer.value].text; }
|
||||
|
||||
if (clip?.GetActorAddon("right hand") != null)
|
||||
{ clip.GetActorAddon("right hand").layer = handRightLayer.options[handRightLayer.value].text; }
|
||||
|
||||
if (clip?.GetActorAddon("dildo") != null)
|
||||
{ clip.GetActorAddon("dildo").layer = sexToyLayer.options[sexToyLayer.value].text; }
|
||||
|
||||
//Initialize();
|
||||
}
|
||||
|
||||
public void OnAnchoringPawnChanged()
|
||||
{
|
||||
PawnAnimationClip clip = Workspace.animationDef.animationStages[Workspace.stageID].animationClips[Workspace.actorID];
|
||||
|
||||
if (clip?.GetActorAddon("left hand") != null)
|
||||
{
|
||||
int i = int.Parse(handLeftAnchoringPawn.text);
|
||||
|
||||
if (i < 0) { i = clip.GetOwningActorID(); }
|
||||
i = Mathf.Clamp(i, 0, Workspace.animationDef.actors.Count - 1);
|
||||
|
||||
clip.GetActorAddon("left hand").anchoringActor = i;
|
||||
handLeftAnchoringPawn.SetTextWithoutNotify(i.ToString());
|
||||
}
|
||||
|
||||
if (clip?.GetActorAddon("right hand") != null)
|
||||
{
|
||||
int i = int.Parse(handRightAnchoringPawn.text);
|
||||
|
||||
if (i < 0) { i = clip.GetOwningActorID(); }
|
||||
i = Mathf.Clamp(i, 0, Workspace.animationDef.actors.Count - 1);
|
||||
|
||||
clip.GetActorAddon("right hand").anchoringActor = i;
|
||||
handRightAnchoringPawn.SetTextWithoutNotify(i.ToString());
|
||||
}
|
||||
|
||||
if (clip?.GetActorAddon("dildo") != null)
|
||||
{
|
||||
int i = int.Parse(sexToyAnchoringPawn.text);
|
||||
|
||||
if (i < 0) { i = clip.GetOwningActorID(); }
|
||||
i = Mathf.Clamp(i, 0, Workspace.animationDef.actors.Count - 1);
|
||||
|
||||
clip.GetActorAddon("dildo").anchoringActor = i;
|
||||
sexToyAnchoringPawn.SetTextWithoutNotify(i.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 869b2cd91a545c142b38856695c4257a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -64,7 +64,7 @@ namespace RimWorldAnimationStudio
|
|||
GameObject obj = Instantiate(linearScaleTickPrefab, transform);
|
||||
obj.GetComponentInChildren<Text>().text = division.ToString();
|
||||
|
||||
float xOffset = ((float)(division - 1) / (Workspace.StageWindowSize - 1)) * transform.parent.GetComponent<RectTransform>().rect.width;
|
||||
float xOffset = ((float)(division - Constants.minTick) / (Workspace.StageWindowSize - Constants.minTick)) * transform.parent.GetComponent<RectTransform>().rect.width;
|
||||
obj.GetComponent<RectTransform>().localPosition = new Vector3(xOffset, 0, 0);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,6 +30,9 @@ namespace RimWorldAnimationStudio
|
|||
public Button playToggleButton;
|
||||
public Text stageLengthText;
|
||||
public Text animationLengthText;
|
||||
public GameObject handLeftControls;
|
||||
public GameObject handRightControls;
|
||||
public GameObject sexToyControls;
|
||||
|
||||
[Header("Prefabs")]
|
||||
public ActorBody actorBodyPrefab;
|
||||
|
@ -197,7 +200,7 @@ namespace RimWorldAnimationStudio
|
|||
Vector3 bodyPos = new Vector3(deltaPos.x, deltaPos.z, 0);
|
||||
Vector3 headPos = new Vector3(headOffset.x, headOffset.z, 0);
|
||||
|
||||
Vector3 appendagePos = PawnUtility.AppendageOffsetAt(bodyType, bodyFacing);
|
||||
Vector3 appendagePos = PawnUtility.GroinOffsetAt(bodyType, bodyFacing);
|
||||
float appendageRotation = clip.GenitalAngle.Evaluate(clipPercent);
|
||||
|
||||
actorBody.transform.position = bodyPos + actor.GetFinalTransformOffset();
|
||||
|
@ -236,6 +239,41 @@ namespace RimWorldAnimationStudio
|
|||
if (ActorKeyframeCard.Instance.headBobField.isFocused == false) { ActorKeyframeCard.Instance.headBobField.text = headBob.ToString("0.000"); }
|
||||
if (ActorKeyframeCard.Instance.headRotationField.isFocused == false) { ActorKeyframeCard.Instance.headRotationField.text = headAngle.ToString("0.000"); }
|
||||
if (ActorKeyframeCard.Instance.appendageRotationField.isFocused == false) { ActorKeyframeCard.Instance.appendageRotationField.text = appendageRotation.ToString("0.000"); }
|
||||
|
||||
if (actorID == Workspace.actorID)
|
||||
{
|
||||
handLeftControls.SetActive(clip.GetActorAddon("left hand").render);
|
||||
handRightControls.SetActive(clip.GetActorAddon("right hand").render);
|
||||
sexToyControls.SetActive(clip.GetActorAddon("dildo").render);
|
||||
}
|
||||
|
||||
foreach (ActorAddon addon in clip.addons)
|
||||
{
|
||||
ActorBodyPart bodyPart = actorBody.GetComponentsInChildren<ActorBodyPart>()?.FirstOrDefault(x => x.addonName == addon.addonName);
|
||||
if (bodyPart == null) continue;
|
||||
|
||||
Vector3 anchor;
|
||||
|
||||
ActorBody anchoringActorBody = actorBodies.GetComponentsInChildren<ActorBody>()?.FirstOrDefault(x => x.actorID == addon.anchoringActor);
|
||||
bodyPos = new Vector3(anchoringActorBody.transform.position.x, anchoringActorBody.transform.position.y, 0);
|
||||
alienRaceDef = Workspace.animationDef.actors[addon.anchoringActor].GetAlienRaceDef();
|
||||
Actor anchoringActor = Workspace.animationDef.actors[addon.anchoringActor];
|
||||
bodyFacing = (int)Workspace.animationDef.animationStages[Workspace.stageID].animationClips[addon.anchoringActor].BodyFacing.Evaluate(clipPercent);
|
||||
|
||||
switch (addon.anchorName)
|
||||
{
|
||||
case "torso": anchor = bodyPos; break;
|
||||
case "head": anchor = new Vector3(anchoringActorBody.transform.Find("ActorHead").position.x, anchoringActorBody.transform.Find("ActorHead").position.y, 0); break;
|
||||
case "groin": anchor = bodyPos + Quaternion.AngleAxis(anchoringActorBody.transform.rotation.eulerAngles.z, Vector3.forward) * PawnUtility.GroinOffsetAt(anchoringActor.bodyType, bodyFacing).FlipAxes(); break;
|
||||
case "left breast": anchor = bodyPos + Quaternion.AngleAxis(anchoringActorBody.transform.rotation.eulerAngles.z, Vector3.forward) * PawnUtility.BreastLeftOffsetAt(anchoringActor.bodyType, bodyFacing).FlipAxes(); break;
|
||||
case "right breast": anchor = bodyPos + Quaternion.AngleAxis(anchoringActorBody.transform.rotation.eulerAngles.z, Vector3.forward) * PawnUtility.BreastRightOffsetAt(anchoringActor.bodyType, bodyFacing).FlipAxes(); break;
|
||||
default: anchor = new Vector3(); break;
|
||||
}
|
||||
|
||||
bodyPart.transform.position = anchor + new Vector3(addon.PosX.Evaluate(clipPercent), addon.PosZ.Evaluate(clipPercent), 0);
|
||||
bodyPart.transform.eulerAngles = new Vector3(0, 0, -addon.Rotation.Evaluate(clipPercent));
|
||||
bodyPart.GetComponent<SpriteRenderer>().sortingLayerName = addon.layer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -91,6 +91,12 @@ namespace RimWorldAnimationStudio
|
|||
else if (animationDef.animationStages.Count == 0)
|
||||
{ animationDef.animationStages[0].playTimeTicksQuick = animationDef.animationStages[0].playTimeTicks; }
|
||||
}
|
||||
|
||||
foreach (AnimationStage stage in animationDef.animationStages)
|
||||
{
|
||||
stage.OnPostLoad();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void TryToSaveAnimation()
|
||||
|
|
|
@ -43,7 +43,7 @@ namespace RimWorldAnimationStudio
|
|||
public static List<string> sexTypes = new List<string>() { "None", "Vaginal", "Anal", "Oral", "Masturbation", "DoublePenetration", "Boobjob", "Handjob", "Footjob", "Fingering", "Scissoring", "MutualMasturbation", "Fisting", "MechImplant", "Rimming", "Fellatio", "Cunnilingus", "Sixtynine" };
|
||||
public static List<string> interactionDefTypes = new List<string>() { "Bestiality_Anal", "Bestiality_Double_Penetration_M", "Bestiality_Oral", "Bestiality_Vaginal", "Breeding_Lick", "Breeding_Fingering", "Breeding_OralS", "Bestiality_Reverse_Anal", "Bestiality_Reverse_Double_Penetration_M", "Bestiality_Reverse_Handjob", "Bestiality_Reverse_Oral", "Bestiality_Reverse_Oral_Service", "Bestiality_Reverse_Vaginal", "AnimalSexChat", "Masturbation_AutoBreastjob", "Masturbation_AutoFellatio", "Masturbation_Breastjob", "Masturbation_HandjobA", "Masturbation_HandjobP", "Masturbation_HandjobV", "rjw_interaction_template", "Necro_Anal", "Necro_DoublePenetration", "Necro_DoublePenetrationM", "Necro_Vaginal", "Necro_Reverse_Anal", "Necro_Reverse_DoublePenetration", "Necro_Reverse_DoublePenetrationM", "Necro_Reverse_Vaginal", "Rape_MechImplant", "Rape_Anal", "Rape_Beakjob", "Rape_Breastjob", "Rape_Cunnilingus", "Rape_DoublePenetration", "Rape_DoublePenetrationM", "Rape_Fellatio", "Rape_Fingering", "Rape_Fisting", "Rape_Footjob", "Rape_Handjob", "Rape_Oral", "Rape_Rimming", "Rape_Scissoring", "Rape_Vaginal", "Rape_Reverse_Anal", "Rape_Reverse_Beakjob", "Rape_Reverse_Breastjob", "Rape_Reverse_Cunnilingus", "Rape_Reverse_DoublePenetration", "Rape_Reverse_DoublePenetrationM", "Rape_Reverse_Fellatio", "Rape_Reverse_Fingering", "Rape_Reverse_Fisting", "Rape_Reverse_Footjob", "Rape_Reverse_Handjob", "Rape_Reverse_Rimming", "Rape_Reverse_Scissoring", "Rape_Reverse_Vaginal", "Sex_Reverse_Anal", "Sex_Reverse_Beakjob", "Sex_Reverse_Breastjob", "Sex_Reverse_Cunnilingus", "Sex_Reverse_DoublePenetration", "Sex_Reverse_DoublePenetrationM", "Sex_Reverse_Fellatio", "Sex_Reverse_Fingering", "Sex_Reverse_Fisting", "Sex_Reverse_Footjob", "Sex_Reverse_Handjob", "Sex_Reverse_Rimming", "Sex_Reverse_Vaginal", "Sex_Anal", "Sex_Beakjob", "Sex_Breastjob", "Sex_Cunnilingus", "Sex_DoublePenetration", "Sex_DoublePenetrationM", "Sex_Fellatio", "Sex_Fingering", "Sex_Fisting", "Sex_Footjob", "Sex_Handjob", "Sex_MutualMasturbation", "Sex_Rimming", "Sex_Scissoring", "Sex_Sixtynine", "Sex_Vaginal" };
|
||||
public static List<string> soundDefs = new List<string>() { "None", "Sex", "Fuck", "Slimy", "Suck", "Cum" };
|
||||
public static List<string> actorLayers = new List<string>() { "Building", "BuildingOnTop", "MoteBelowThings", "Item", "ItemImportant", "LayingPawn", "PawnRope", "Projectile", "Pawn", "PawnUnused", "PawnState" };
|
||||
public static List<string> actorLayers = new List<string>() { "LayingPawn", "PawnRope", "Projectile", "Pawn", "PawnUnused" };
|
||||
public static List<string> bodyTypes = new List<string>() { "Male", "Female", "Fat", "Hulk", "Thin" };
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace RimWorldAnimationStudio
|
|||
}
|
||||
}
|
||||
|
||||
public static Vector3 AppendageOffsetAt(string bodyType, int rotation)
|
||||
public static Vector3 GroinOffsetAt(string bodyType, int rotation)
|
||||
{
|
||||
if (rotation == 0 || rotation == 2)
|
||||
{
|
||||
|
@ -73,5 +73,89 @@ namespace RimWorldAnimationStudio
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static Vector3 BreastLeftOffsetAt(string bodyType, int rotation)
|
||||
{
|
||||
if (rotation == 0 || rotation == 2)
|
||||
{
|
||||
switch (bodyType)
|
||||
{
|
||||
case "Male": return new Vector3(0.035f, 0f, -0.050f);
|
||||
case "Female": return new Vector3(0.002f, 0f, -0.044f);
|
||||
case "Thin": return new Vector3(0.000f, 0f, -0.024f);
|
||||
case "Hulk": return new Vector3(0.118f, 0f, -0.194f);
|
||||
case "Fat": return new Vector3(0.141f, 0f, -0.084f);
|
||||
default: return Vector3.zero;
|
||||
}
|
||||
}
|
||||
|
||||
else if (rotation == 1)
|
||||
{
|
||||
switch (bodyType)
|
||||
{
|
||||
case "Male": return new Vector3(0.098f, 0f, -0.053f);
|
||||
case "Female": return new Vector3(0.008f, 0f, -0.008f);
|
||||
case "Thin": return new Vector3(-0.011f, 0f, -0.024f);
|
||||
case "Hulk": return new Vector3(0.180f, 0f, -0.151f);
|
||||
case "Fat": return new Vector3(0.200f, 0f, -0.034f);
|
||||
default: return Vector3.zero;
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
switch (bodyType)
|
||||
{
|
||||
case "Male": return new Vector3(-0.098f, 0f, -0.053f);
|
||||
case "Female": return new Vector3(-0.008f, 0f, -0.008f);
|
||||
case "Thin": return new Vector3(0.011f, 0f, -0.024f);
|
||||
case "Hulk": return new Vector3(-0.180f, 0f, -0.151f);
|
||||
case "Fat": return new Vector3(-0.200f, 0f, -0.034f);
|
||||
default: return Vector3.zero;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static Vector3 BreastRightOffsetAt(string bodyType, int rotation)
|
||||
{
|
||||
if (rotation == 0 || rotation == 2)
|
||||
{
|
||||
switch (bodyType)
|
||||
{
|
||||
case "Male": return new Vector3(-0.035f, 0f, -0.050f);
|
||||
case "Female": return new Vector3(-0.002f, 0f, -0.044f);
|
||||
case "Thin": return new Vector3(-0.000f, 0f, -0.024f);
|
||||
case "Hulk": return new Vector3(-0.118f, 0f, -0.194f);
|
||||
case "Fat": return new Vector3(-0.141f, 0f, -0.084f);
|
||||
default: return Vector3.zero;
|
||||
}
|
||||
}
|
||||
|
||||
else if (rotation == 1)
|
||||
{
|
||||
switch (bodyType)
|
||||
{
|
||||
case "Male": return new Vector3(0.098f, 0f, -0.053f);
|
||||
case "Female": return new Vector3(0.008f, 0f, -0.008f);
|
||||
case "Thin": return new Vector3(-0.011f, 0f, -0.024f);
|
||||
case "Hulk": return new Vector3(0.180f, 0f, -0.151f);
|
||||
case "Fat": return new Vector3(0.200f, 0f, -0.034f);
|
||||
default: return Vector3.zero;
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
switch (bodyType)
|
||||
{
|
||||
case "Male": return new Vector3(-0.098f, 0f, -0.053f);
|
||||
case "Female": return new Vector3(-0.008f, 0f, -0.008f);
|
||||
case "Thin": return new Vector3(0.011f, 0f, -0.024f);
|
||||
case "Hulk": return new Vector3(-0.180f, 0f, -0.151f);
|
||||
case "Fat": return new Vector3(-0.200f, 0f, -0.034f);
|
||||
default: return Vector3.zero;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue