add some extra assets FX and SFX
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6860ec410d4e546ca9be7cbb25c7f24f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
||||
@@ -0,0 +1,9 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace NobleMuffins.LimbHacker
|
||||
{
|
||||
public abstract class AbstractHackDecisionMaker : MonoBehaviour
|
||||
{
|
||||
public abstract bool ShouldHack(string joint);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9ebabc4cd40e94187b63d947f0fc3b42
|
||||
timeCreated: 1464179993
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Integrations/LimbHacker-master/Components/AbstractHackDecisionMaker.cs
|
||||
uploadId: 889948
|
||||
@@ -0,0 +1,18 @@
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace NobleMuffins.LimbHacker
|
||||
{
|
||||
public abstract class AbstractSliceHandler : MonoBehaviour
|
||||
{
|
||||
public virtual void handleSlice (GameObject[] results)
|
||||
{
|
||||
//Do nothing
|
||||
}
|
||||
|
||||
public virtual bool cloneAlternate (Dictionary<string, bool> hierarchyPresence)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 66a32b063468a4a3e98026538aa9e370
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Integrations/LimbHacker-master/Components/AbstractSliceHandler.cs
|
||||
uploadId: 889948
|
||||
Binary file not shown.
@@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ffb733fbd886c4e76a6ea9222cfec159
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Integrations/LimbHacker-master/Components/Attachable
|
||||
Slicer.prefab
|
||||
uploadId: 889948
|
||||
@@ -0,0 +1,268 @@
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using NobleMuffins.LimbHacker.Guts;
|
||||
using UnityEngine.Events;
|
||||
|
||||
namespace NobleMuffins.LimbHacker
|
||||
{
|
||||
public class Hackable : MonoBehaviour, ISliceable
|
||||
{
|
||||
[Header ("Main Settings")]
|
||||
[Space]
|
||||
|
||||
public InfillMode infillMode = InfillMode.Sloppy;
|
||||
|
||||
public bool ignoreUpdateLastObjectSpeed;
|
||||
|
||||
public bool ignoreDestroyOriginalObject;
|
||||
|
||||
public bool setCustomIDOnSliceSpieces;
|
||||
|
||||
public string randomString = "";
|
||||
|
||||
public bool destructionPending = false;
|
||||
|
||||
[Space]
|
||||
[Header ("Parts To Slice Settings")]
|
||||
[Space]
|
||||
|
||||
public Transform [] severables = new Transform [0];
|
||||
|
||||
[Space]
|
||||
[Header ("Events Settings")]
|
||||
[Space]
|
||||
|
||||
public UnityEvent eventsOnIgnoreDestroyOriginalObject;
|
||||
|
||||
[Space]
|
||||
[Header ("Components")]
|
||||
[Space]
|
||||
|
||||
public surfaceToSlice mainSurfaceToSlice;
|
||||
|
||||
public GameObject objectToSlice;
|
||||
|
||||
public UnityEngine.Object alternatePrefab = null;
|
||||
|
||||
public Material infillMaterial = null;
|
||||
|
||||
|
||||
public Dictionary<string, float> maximumTiltBySeverableName = new Dictionary<string, float> ();
|
||||
|
||||
bool valuesInitialized;
|
||||
|
||||
bool updateLastObjectSpeed;
|
||||
Vector3 lastSpeed = Vector3.zero;
|
||||
|
||||
|
||||
public string getRandomString ()
|
||||
{
|
||||
return randomString;
|
||||
}
|
||||
|
||||
public void setRandomString (string newValue)
|
||||
{
|
||||
if (randomString.Equals ("")) {
|
||||
randomString = newValue;
|
||||
}
|
||||
}
|
||||
|
||||
public void initializeValues ()
|
||||
{
|
||||
if (objectToSlice == null) {
|
||||
objectToSlice = gameObject;
|
||||
}
|
||||
|
||||
foreach (Transform bodyPart in severables) {
|
||||
if (bodyPart != null) {
|
||||
ChildOfHackable referencer = bodyPart.GetComponent<ChildOfHackable> ();
|
||||
|
||||
if (referencer == null)
|
||||
referencer = bodyPart.gameObject.AddComponent<ChildOfHackable> ();
|
||||
|
||||
referencer.parentHackable = this;
|
||||
}
|
||||
}
|
||||
|
||||
valuesInitialized = true;
|
||||
}
|
||||
|
||||
void checkInitializeValues ()
|
||||
{
|
||||
if (!valuesInitialized) {
|
||||
initializeValues ();
|
||||
}
|
||||
}
|
||||
|
||||
public event EventHandler<SliceEventArgs> Sliced;
|
||||
|
||||
public void Slice (Vector3 positionInWorldSpace, Vector3 normalInWorldSpace)
|
||||
{
|
||||
if (destructionPending) {
|
||||
return;
|
||||
}
|
||||
|
||||
var decisionMaker = objectToSlice.GetComponent<AbstractHackDecisionMaker> ();
|
||||
|
||||
string jointName = null;
|
||||
|
||||
float rootTipProgression = 0f;
|
||||
|
||||
if (LimbHackerAgent.DetermineSlice (this, positionInWorldSpace, ref jointName, ref rootTipProgression) && (decisionMaker == null || decisionMaker.ShouldHack (jointName))) {
|
||||
LimbHackerAgent.instance.SeverByJoint (objectToSlice, jointName, rootTipProgression, normalInWorldSpace);
|
||||
}
|
||||
}
|
||||
|
||||
public void handleSlice (GameObject [] results, Vector4 planeInWorldSpace, Vector3 focalPointInWorldSpace)
|
||||
{
|
||||
bool originalRemainsAfterSlice = false;
|
||||
|
||||
for (int i = 0; i < results.Length; i++)
|
||||
originalRemainsAfterSlice |= results [i] == objectToSlice;
|
||||
|
||||
destructionPending = !originalRemainsAfterSlice;
|
||||
|
||||
AbstractSliceHandler [] handlers = objectToSlice.GetComponents<AbstractSliceHandler> ();
|
||||
|
||||
foreach (AbstractSliceHandler handler in handlers) {
|
||||
handler.handleSlice (results);
|
||||
}
|
||||
|
||||
if (Sliced != null) {
|
||||
Sliced (this, new SliceEventArgs (new Plane (planeInWorldSpace, planeInWorldSpace.w), focalPointInWorldSpace, results));
|
||||
|
||||
if (!ignoreUpdateLastObjectSpeed) {
|
||||
if (updateLastObjectSpeed && lastSpeed != Vector3.zero) {
|
||||
|
||||
for (int i = 0; i < results.Length; i++) {
|
||||
if (results [i] != null) {
|
||||
|
||||
Component [] currentRigidbody = results [i].GetComponentsInChildren (typeof (Rigidbody));
|
||||
foreach (Rigidbody child in currentRigidbody) {
|
||||
if (child.gameObject.activeInHierarchy) {
|
||||
child.linearVelocity = lastSpeed;
|
||||
}
|
||||
}
|
||||
|
||||
// print (results [i].name);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
updateLastObjectSpeed = false;
|
||||
|
||||
lastSpeed = Vector3.zero;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool cloneAlternate (Dictionary<string, bool> hierarchyPresence)
|
||||
{
|
||||
if (alternatePrefab == null) {
|
||||
return false;
|
||||
} else {
|
||||
AbstractSliceHandler [] handlers = objectToSlice.GetComponents<AbstractSliceHandler> ();
|
||||
|
||||
bool result = false;
|
||||
|
||||
if (handlers.Length == 0) {
|
||||
result = true;
|
||||
} else {
|
||||
foreach (AbstractSliceHandler handler in handlers) {
|
||||
result |= handler.cloneAlternate (hierarchyPresence);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private readonly Queue<PendingSlice> pendingSlices = new Queue<PendingSlice> ();
|
||||
|
||||
bool sliceWaitingToFinish;
|
||||
|
||||
Vector3 normalInWorldSpace;
|
||||
|
||||
private List<GameObject> suppressUntilContactCeases = new List<GameObject> ();
|
||||
|
||||
class PendingSlice
|
||||
{
|
||||
public PendingSlice (Vector3 _point, ISliceable _target)
|
||||
{
|
||||
point = _point;
|
||||
target = _target;
|
||||
}
|
||||
|
||||
public readonly Vector3 point;
|
||||
public readonly ISliceable target;
|
||||
}
|
||||
|
||||
|
||||
void LateUpdate ()
|
||||
{
|
||||
if (sliceWaitingToFinish) {
|
||||
while (pendingSlices.Count > 0) {
|
||||
PendingSlice pendingSlice = pendingSlices.Dequeue ();
|
||||
|
||||
var component = pendingSlice.target as MonoBehaviour;
|
||||
|
||||
if (component != null) {
|
||||
var targetGameObject = component.gameObject;
|
||||
|
||||
if (suppressUntilContactCeases.Contains (targetGameObject) == false) {
|
||||
|
||||
pendingSlice.target.Sliced += PendingSlice_target_Sliced;
|
||||
|
||||
pendingSlice.target.Slice (pendingSlice.point, normalInWorldSpace);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sliceWaitingToFinish = false;
|
||||
|
||||
ContactCeased (objectToSlice);
|
||||
}
|
||||
}
|
||||
|
||||
void PendingSlice_target_Sliced (object sender, SliceEventArgs e)
|
||||
{
|
||||
if (e.Parts.Length > 1) {
|
||||
suppressUntilContactCeases.AddRange (e.Parts);
|
||||
}
|
||||
}
|
||||
|
||||
private void ContactCeased (GameObject other)
|
||||
{
|
||||
if (suppressUntilContactCeases.Contains (other)) {
|
||||
suppressUntilContactCeases.Remove (other);
|
||||
}
|
||||
}
|
||||
|
||||
public void activateSlice (GameObject objectToSlice, Vector3 point, Vector3 newNormalInWorldSpaceValue,
|
||||
bool updateLastObjectSpeedValue, Vector3 lastSpeedValue)
|
||||
{
|
||||
checkInitializeValues ();
|
||||
|
||||
ISliceable sliceable = objectToSlice.GetComponent (typeof (ISliceable)) as ISliceable;
|
||||
|
||||
if (sliceable != null) {
|
||||
pendingSlices.Enqueue (new PendingSlice (point, sliceable));
|
||||
|
||||
normalInWorldSpace = newNormalInWorldSpaceValue;
|
||||
|
||||
sliceWaitingToFinish = true;
|
||||
|
||||
updateLastObjectSpeed = updateLastObjectSpeedValue;
|
||||
lastSpeed = lastSpeedValue;
|
||||
}
|
||||
}
|
||||
|
||||
public void setDestructionPending (bool state)
|
||||
{
|
||||
destructionPending = state;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6dd56a8ae574e4fd492ffaed7fb8e357
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Integrations/LimbHacker-master/Components/Hackable.cs
|
||||
uploadId: 889948
|
||||
@@ -0,0 +1,63 @@
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace NobleMuffins.LimbHacker
|
||||
{
|
||||
[RequireComponent(typeof(Hackable))]
|
||||
public class ToRagdollOrNot : AbstractSliceHandler
|
||||
{
|
||||
public enum Operator { And, Or };
|
||||
public enum Presentness { Equals, Not };
|
||||
|
||||
public Operator groupRule = Operator.And;
|
||||
public Presentness totalityRule = Presentness.Not;
|
||||
|
||||
public Transform[] bones;
|
||||
|
||||
public override bool cloneAlternate(Dictionary<string, bool> hierarchyPresence)
|
||||
{
|
||||
List<bool> relevantStates = new List<bool>(bones.Length);
|
||||
|
||||
foreach (Transform t in bones)
|
||||
{
|
||||
string key = t.name;
|
||||
|
||||
if (hierarchyPresence.ContainsKey(key))
|
||||
{
|
||||
relevantStates.Add(hierarchyPresence[key]);
|
||||
}
|
||||
}
|
||||
|
||||
bool totality = false;
|
||||
|
||||
if (groupRule == Operator.And)
|
||||
{
|
||||
totality = true;
|
||||
foreach (bool b in relevantStates)
|
||||
{
|
||||
totality &= b;
|
||||
}
|
||||
}
|
||||
else if (groupRule == Operator.Or)
|
||||
{
|
||||
totality = false;
|
||||
foreach (bool b in relevantStates)
|
||||
{
|
||||
totality |= b;
|
||||
}
|
||||
}
|
||||
|
||||
if (totalityRule == Presentness.Not)
|
||||
{
|
||||
totality = !totality;
|
||||
}
|
||||
|
||||
return totality;
|
||||
}
|
||||
|
||||
public override void handleSlice(GameObject[] results)
|
||||
{
|
||||
//Do nothing.
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4bd7131eac6c14639b7b531425a23c8c
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Integrations/LimbHacker-master/Components/ToRagdollOrNot.cs
|
||||
uploadId: 889948
|
||||
@@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3cc7b62d124024e329b5391333a04175
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
||||
@@ -0,0 +1,15 @@
|
||||
using UnityEditor;
|
||||
|
||||
namespace NobleMuffins.LimbHacker.Guts
|
||||
{
|
||||
[CustomEditor(typeof(ChildOfHackable))]
|
||||
public class ChildOfHackableEditor : Editor
|
||||
{
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
EditorGUILayout.LabelField("This is a Limb Hacker internal component.");
|
||||
EditorGUILayout.LabelField("Do not add this to an object yourself.");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ab06f9d6d2404f0459cea8be116c3802
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Integrations/LimbHacker-master/Editor/ChildOfHackableEditor.cs
|
||||
uploadId: 889948
|
||||
@@ -0,0 +1,150 @@
|
||||
//using UnityEngine;
|
||||
//using UnityEditor;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
//
|
||||
//namespace NobleMuffins.LimbHacker
|
||||
//{
|
||||
// [CustomEditor (typeof(Hackable))]
|
||||
// public class HackableEditor : Editor
|
||||
// {
|
||||
// Hackable manager;
|
||||
//
|
||||
// void OnEnable ()
|
||||
// {
|
||||
// manager = (Hackable)target;
|
||||
// }
|
||||
//
|
||||
// public override void OnInspectorGUI ()
|
||||
// {
|
||||
// DrawDefaultInspector ();
|
||||
//
|
||||
// EditorGUILayout.Space ();
|
||||
//
|
||||
// if (GUILayout.Button ("Search Body Parts")) {
|
||||
// manager.searchBodyParts ();
|
||||
// }
|
||||
//
|
||||
// EditorGUILayout.Space ();
|
||||
// }
|
||||
//
|
||||
// public static IEnumerable<Transform> FindBonesInTree (GameObject go)
|
||||
// {
|
||||
// var skinnedMeshRenderers = go.GetComponentsInChildren<SkinnedMeshRenderer> (true);
|
||||
//
|
||||
// var bones = new HashSet<Transform> ();
|
||||
//
|
||||
// var rootCandidates = new HashSet<Transform> ();
|
||||
//
|
||||
// foreach (var smr in skinnedMeshRenderers) {
|
||||
// if (smr.rootBone != null) {
|
||||
// rootCandidates.Add (smr.rootBone);
|
||||
// } else {
|
||||
// //Just pick a bone and crawl up the path until we can verify that we found the root.
|
||||
//
|
||||
// var rootCandidate = smr.bones.First ();
|
||||
//
|
||||
// while (IsThisTheRootBone (rootCandidate, smr.bones)) {
|
||||
// rootCandidate = rootCandidate.parent;
|
||||
// }
|
||||
//
|
||||
// rootCandidates.Add (rootCandidate);
|
||||
// }
|
||||
//
|
||||
// foreach (var bone in smr.bones) {
|
||||
// bones.Add (bone);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// //LimbHacker requires a single tree; there must be precisely one root. Conceptually
|
||||
// //a root has no parent. In Unity, the root may have a parent but that is fine provided
|
||||
// //that the parent is not part of the bone set.
|
||||
//
|
||||
// //First we need to determine, from the set of root candidates, what the root is.
|
||||
// //The root is the root candidate for which every other root is a child.
|
||||
//
|
||||
// Transform root = null;
|
||||
//
|
||||
// if (rootCandidates.Count == 1) {
|
||||
// root = rootCandidates.First ();
|
||||
// } else if (rootCandidates.Count > 0) {
|
||||
// foreach (var rootCandidate in rootCandidates) {
|
||||
// bool valid = true;
|
||||
//
|
||||
// foreach (var possibleChild in rootCandidates) {
|
||||
// if (possibleChild == rootCandidate)
|
||||
// continue;
|
||||
//
|
||||
// valid &= IsThisChildOfThat (possibleChild, rootCandidate);
|
||||
//
|
||||
// if (!valid)
|
||||
// break;
|
||||
// }
|
||||
//
|
||||
// if (valid) {
|
||||
// root = rootCandidate;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if (root == null) {
|
||||
// var boneDescriptor = new StringBuilder ();
|
||||
// foreach (var bone in bones) {
|
||||
// boneDescriptor.AppendFormat ("{0}: {1}\n", bone.name, bone.parent == null ? "nil" : bone.parent.name);
|
||||
// }
|
||||
// throw new ForestException (string.Format ("{0} does not have a single, valid tree. LimbHacker compatible objects must have a single bone tree. Tree dump:\n{1}", go.name, boneDescriptor.ToString ()));
|
||||
// }
|
||||
//
|
||||
// return bones;
|
||||
// }
|
||||
//
|
||||
// private static bool IsThisTheRootBone (Transform candidate, ICollection<Transform> boneSet)
|
||||
// {
|
||||
// //A candidate can't be anything but the root if its parent is null.
|
||||
//
|
||||
// if (candidate.parent == null) {
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// //A candidate is NOT the root if its parent is a subset of the bone set.
|
||||
//
|
||||
// if (boneSet.Contains (candidate.parent)) {
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// //A candidate is the root bone if every other bone is a child of it.
|
||||
//
|
||||
// bool allOthersAreChildren = true;
|
||||
//
|
||||
// foreach (var bone in boneSet) {
|
||||
// if (candidate == bone.parent) {
|
||||
// continue;
|
||||
// }
|
||||
// if (IsThisChildOfThat (bone, candidate) == false) {
|
||||
// allOthersAreChildren = false;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return allOthersAreChildren;
|
||||
// }
|
||||
//
|
||||
//
|
||||
// public class ForestException : System.Exception
|
||||
// {
|
||||
// public ForestException (string message) : base (message)
|
||||
// {
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// private static bool IsThisChildOfThat (Transform subject, Transform parent)
|
||||
// {
|
||||
// do {
|
||||
// subject = subject.parent;
|
||||
// } while (subject != null && subject != parent);
|
||||
// return subject == parent;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6f50a56adfbe345c48268cae6aef308c
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Integrations/LimbHacker-master/Editor/HackableEditor.cs
|
||||
uploadId: 889948
|
||||
@@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9555ac55ebcb06940a230e54baf6ca8a
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
||||
@@ -0,0 +1,21 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace NobleMuffins.LimbHacker.Examples
|
||||
{
|
||||
[RequireComponent(typeof(SwordVelocityFilter))]
|
||||
public class AttachableSlicerController : MonoBehaviour
|
||||
{
|
||||
private SwordVelocityFilter swordVelocityFilter;
|
||||
public GameObject slicer;
|
||||
|
||||
void Start()
|
||||
{
|
||||
swordVelocityFilter = GetComponent<SwordVelocityFilter>();
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
slicer.SetActive(swordVelocityFilter.IsFastEnoughToCut);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cb6aef6e851f6984d837632b1f736993
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Integrations/LimbHacker-master/Example/AttachableSlicerController.cs
|
||||
uploadId: 889948
|
||||
@@ -0,0 +1,79 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace NobleMuffins.LimbHacker.Examples
|
||||
{
|
||||
[RequireComponent(typeof(Collider))]
|
||||
public class Button : MonoBehaviour
|
||||
{
|
||||
const float changeTime = 0.033f;
|
||||
|
||||
public new Camera camera;
|
||||
|
||||
public GameObject target;
|
||||
public string message;
|
||||
|
||||
public AudioClip clickSound;
|
||||
|
||||
public bool visible;
|
||||
|
||||
private new Transform transform;
|
||||
private new Collider collider;
|
||||
private Vector3 scaleAtStart;
|
||||
|
||||
private float size = 1f, sizeDelta = 0f;
|
||||
private bool pressedAsButton = false;
|
||||
|
||||
void Start()
|
||||
{
|
||||
transform = GetComponent<Transform>();
|
||||
collider = GetComponent<Collider>();
|
||||
|
||||
scaleAtStart = transform.localScale;
|
||||
|
||||
if (camera == null) camera = Camera.main;
|
||||
}
|
||||
|
||||
private bool firstRun = true;
|
||||
|
||||
void Update()
|
||||
{
|
||||
Ray ray = camera.ScreenPointToRay(Input.mousePosition);
|
||||
|
||||
RaycastHit hitInfo;
|
||||
|
||||
bool hover = collider.Raycast(ray, out hitInfo, 2f);
|
||||
|
||||
pressedAsButton |= hover && Input.GetMouseButtonDown(0);
|
||||
|
||||
bool released = Input.GetMouseButtonUp(0);
|
||||
|
||||
bool releasedAsButton = pressedAsButton && hover && released;
|
||||
|
||||
if (released)
|
||||
{
|
||||
pressedAsButton = false;
|
||||
}
|
||||
|
||||
if (releasedAsButton)
|
||||
{
|
||||
target.SendMessage(message);
|
||||
|
||||
if (clickSound != null)
|
||||
{
|
||||
AudioSource.PlayClipAtPoint(clickSound, Vector3.zero);
|
||||
}
|
||||
}
|
||||
|
||||
bool enlarge = hover || pressedAsButton;
|
||||
|
||||
float idealSize = (enlarge ? 1.1f : 1f) * (visible ? 1f : 0f);
|
||||
|
||||
size = firstRun ? idealSize : Mathf.SmoothDamp(size, idealSize, ref sizeDelta, changeTime);
|
||||
|
||||
firstRun = false;
|
||||
|
||||
transform.localScale = size * scaleAtStart;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a54bd2a3c315546de98c80b0f49fdaa9
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Integrations/LimbHacker-master/Example/Button.cs
|
||||
uploadId: 889948
|
||||
@@ -0,0 +1,32 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace NobleMuffins.LimbHacker.Examples
|
||||
{
|
||||
public class CameraPositionController : MonoBehaviour
|
||||
{
|
||||
public Transform backAwayPosition, upClosePosition;
|
||||
public TimeForSlicingFilter timeForSlicingFilter;
|
||||
public float transitionTime = 1f;
|
||||
|
||||
private new Transform transform;
|
||||
private Vector3 position, positionDelta;
|
||||
|
||||
// Use this for initialization
|
||||
void Start()
|
||||
{
|
||||
transform = GetComponent<Transform>();
|
||||
|
||||
position = transform.position;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
Vector3 idealPosition = timeForSlicingFilter.IsTimeForSlicing ? upClosePosition.position : backAwayPosition.position;
|
||||
|
||||
position = Vector3.SmoothDamp(position, idealPosition, ref positionDelta, transitionTime);
|
||||
|
||||
transform.position = position;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f14870d2c7572544ebb0eac825b68362
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Integrations/LimbHacker-master/Example/CameraPositionController.cs
|
||||
uploadId: 889948
|
||||
@@ -0,0 +1,49 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace NobleMuffins.LimbHacker.Examples
|
||||
{
|
||||
public class CameraSteer : MonoBehaviour
|
||||
{
|
||||
|
||||
private Vector3 naturalForward, naturalUp, naturalRight;
|
||||
|
||||
private Vector3 forward, forwardDelta;
|
||||
|
||||
private new Transform transform;
|
||||
|
||||
public float panSpeed = 0.33f;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
transform = GetComponent<Transform>();
|
||||
|
||||
naturalForward = transform.forward;
|
||||
naturalRight = transform.right;
|
||||
naturalUp = transform.up;
|
||||
|
||||
forward = naturalForward;
|
||||
forwardDelta = Vector3.zero;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
Vector2 center = new Vector2(Screen.width / 2f, Screen.height / 2f);
|
||||
Vector2 current = (Vector2)Input.mousePosition;
|
||||
|
||||
Vector2 delta = current - center;
|
||||
|
||||
delta.x /= Screen.width;
|
||||
delta.y /= Screen.height;
|
||||
|
||||
delta *= 0.33f;
|
||||
|
||||
Vector3 idealForward = (naturalForward + naturalRight * delta.x + naturalUp * delta.y).normalized;
|
||||
|
||||
forward = Vector3.SmoothDamp(forward, idealForward, ref forwardDelta, panSpeed);
|
||||
|
||||
transform.forward = forward;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 729e15f2b0d6e294ab13e49a19c997de
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Integrations/LimbHacker-master/Example/CameraSteer.cs
|
||||
uploadId: 889948
|
||||
@@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 40595bf38a7fd4c45882d92e2d2bbb42
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
||||
@@ -0,0 +1,159 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!91 &9100000
|
||||
AnimatorController:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name: Animation Controller
|
||||
serializedVersion: 5
|
||||
m_AnimatorParameters: []
|
||||
m_AnimatorLayers:
|
||||
- serializedVersion: 5
|
||||
m_Name: Base Layer
|
||||
m_StateMachine: {fileID: 110700000}
|
||||
m_Mask: {fileID: 0}
|
||||
m_Motions: []
|
||||
m_Behaviours: []
|
||||
m_BlendingMode: 0
|
||||
m_SyncedLayerIndex: -1
|
||||
m_DefaultWeight: 0
|
||||
m_IKPass: 0
|
||||
m_SyncedLayerAffectsTiming: 0
|
||||
m_Controller: {fileID: 9100000}
|
||||
--- !u!1101 &110100000
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 3
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name:
|
||||
m_Conditions: []
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: 110204645}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 1.5
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0
|
||||
m_HasExitTime: 1
|
||||
m_HasFixedDuration: 0
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
--- !u!1101 &110117645
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 3
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name:
|
||||
m_Conditions: []
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: 110204645}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0.19736843
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0.80263156
|
||||
m_HasExitTime: 1
|
||||
m_HasFixedDuration: 0
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
--- !u!1102 &110200000
|
||||
AnimatorState:
|
||||
serializedVersion: 5
|
||||
m_ObjectHideFlags: 3
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name: Rise
|
||||
m_Speed: 0.4
|
||||
m_CycleOffset: 0
|
||||
m_Transitions: []
|
||||
m_StateMachineBehaviours: []
|
||||
m_Position: {x: 36, y: -120, z: 0}
|
||||
m_IKOnFeet: 1
|
||||
m_WriteDefaultValues: 1
|
||||
m_Mirror: 0
|
||||
m_SpeedParameterActive: 0
|
||||
m_MirrorParameterActive: 0
|
||||
m_CycleOffsetParameterActive: 0
|
||||
m_Motion: {fileID: 7400000, guid: 7a571e18b998b154190a06f1dd7da67b, type: 3}
|
||||
m_Tag:
|
||||
m_SpeedParameter:
|
||||
m_MirrorParameter:
|
||||
m_CycleOffsetParameter:
|
||||
--- !u!1102 &110204645
|
||||
AnimatorState:
|
||||
serializedVersion: 5
|
||||
m_ObjectHideFlags: 3
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name: Standing
|
||||
m_Speed: 0.05
|
||||
m_CycleOffset: 0
|
||||
m_Transitions: []
|
||||
m_StateMachineBehaviours: []
|
||||
m_Position: {x: 156, y: -192, z: 0}
|
||||
m_IKOnFeet: 1
|
||||
m_WriteDefaultValues: 1
|
||||
m_Mirror: 0
|
||||
m_SpeedParameterActive: 0
|
||||
m_MirrorParameterActive: 0
|
||||
m_CycleOffsetParameterActive: 0
|
||||
m_Motion: {fileID: 7400004, guid: 7a571e18b998b154190a06f1dd7da67b, type: 3}
|
||||
m_Tag:
|
||||
m_SpeedParameter:
|
||||
m_MirrorParameter:
|
||||
m_CycleOffsetParameter:
|
||||
--- !u!1102 &110217570
|
||||
AnimatorState:
|
||||
serializedVersion: 5
|
||||
m_ObjectHideFlags: 3
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name: Crouched
|
||||
m_Speed: 0.5
|
||||
m_CycleOffset: 0
|
||||
m_Transitions:
|
||||
- {fileID: 110100000}
|
||||
m_StateMachineBehaviours: []
|
||||
m_Position: {x: 168, y: -48, z: 0}
|
||||
m_IKOnFeet: 1
|
||||
m_WriteDefaultValues: 1
|
||||
m_Mirror: 0
|
||||
m_SpeedParameterActive: 0
|
||||
m_MirrorParameterActive: 0
|
||||
m_CycleOffsetParameterActive: 0
|
||||
m_Motion: {fileID: 7400002, guid: 7a571e18b998b154190a06f1dd7da67b, type: 3}
|
||||
m_Tag:
|
||||
m_SpeedParameter:
|
||||
m_MirrorParameter:
|
||||
m_CycleOffsetParameter:
|
||||
--- !u!1107 &110700000
|
||||
AnimatorStateMachine:
|
||||
serializedVersion: 5
|
||||
m_ObjectHideFlags: 3
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name: Base Layer
|
||||
m_ChildStates:
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: 110204645}
|
||||
m_Position: {x: 156, y: -192, z: 0}
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: 110217570}
|
||||
m_Position: {x: 168, y: -48, z: 0}
|
||||
m_ChildStateMachines: []
|
||||
m_AnyStateTransitions: []
|
||||
m_EntryTransitions: []
|
||||
m_StateMachineTransitions: {}
|
||||
m_StateMachineBehaviours: []
|
||||
m_AnyStatePosition: {x: 48, y: 12, z: 0}
|
||||
m_EntryPosition: {x: 50, y: 120, z: 0}
|
||||
m_ExitPosition: {x: 800, y: 120, z: 0}
|
||||
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
|
||||
m_DefaultState: {fileID: 110217570}
|
||||
@@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c35d48e5604c74f24892398081bf3c3b
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Integrations/LimbHacker-master/Example/Checkerperson/Animation
|
||||
Controller.controller
|
||||
uploadId: 889948
|
||||
Binary file not shown.
@@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 253e6f9721d604d97b674c7ddf4e8993
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Integrations/LimbHacker-master/Example/Checkerperson/Checkerperson
|
||||
ragdoll.prefab
|
||||
uploadId: 889948
|
||||
Binary file not shown.
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bfc185066ed8e42b1bfc4dfe93ef6e66
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Integrations/LimbHacker-master/Example/Checkerperson/Checkerperson.prefab
|
||||
uploadId: 889948
|
||||
@@ -0,0 +1,106 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Checkers
|
||||
m_Shader: {fileID: 4800000, guid: 8d2bb70cbf9db8d4da26e15b26e74248, type: 3}
|
||||
m_Parent: {fileID: 0}
|
||||
m_ModifiedSerializedProperties: 0
|
||||
m_ValidKeywords:
|
||||
- _EMISSION
|
||||
- _GLOSSINESS_FROM_BASE_ALPHA
|
||||
- _SPECULAR_COLOR
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 1
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap:
|
||||
RenderType: Opaque
|
||||
disabledShaderPasses:
|
||||
- MOTIONVECTORS
|
||||
m_LockedProperties:
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _BaseMap:
|
||||
m_Texture: {fileID: 2800000, guid: f720465dd6601462aa8b304392a139c5, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _BumpMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _EmissionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _SpecGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_Lightmaps:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_LightmapsInd:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_ShadowMasks:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Ints: []
|
||||
m_Floats:
|
||||
- _AddPrecomputedVelocity: 0
|
||||
- _AlphaClip: 0
|
||||
- _AlphaToMask: 0
|
||||
- _Blend: 0
|
||||
- _BlendModePreserveSpecular: 1
|
||||
- _BumpScale: 1
|
||||
- _Cull: 2
|
||||
- _Cutoff: 0.5
|
||||
- _DstBlend: 0
|
||||
- _DstBlendAlpha: 0
|
||||
- _GlossinessSource: 0
|
||||
- _QueueOffset: 0
|
||||
- _ReceiveShadows: 1
|
||||
- _Shininess: 0
|
||||
- _Smoothness: 0.5
|
||||
- _SmoothnessSource: 1
|
||||
- _SpecSource: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _SrcBlendAlpha: 1
|
||||
- _Surface: 0
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _SpecColor: {r: 0.5, g: 0.5, b: 0.5, a: 0.5}
|
||||
m_BuildTextureStacks: []
|
||||
m_AllowLocking: 1
|
||||
--- !u!114 &2401247225920078037
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 10
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3e712d1b46d3b4b61b90928342616387
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Integrations/LimbHacker-master/Example/Checkerperson/Checkers.mat
|
||||
uploadId: 889948
|
||||
Binary file not shown.
@@ -0,0 +1,53 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f720465dd6601462aa8b304392a139c5
|
||||
TextureImporter:
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -1
|
||||
maxTextureSize: 1024
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapMode: -1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 0
|
||||
textureType: -1
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Integrations/LimbHacker-master/Example/Checkerperson/Checkers.png
|
||||
uploadId: 889948
|
||||
@@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fda6ef7b5100940f7b31b583bb45227c
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
||||
@@ -0,0 +1,106 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Checkerperson
|
||||
m_Shader: {fileID: 4800000, guid: 8d2bb70cbf9db8d4da26e15b26e74248, type: 3}
|
||||
m_Parent: {fileID: 0}
|
||||
m_ModifiedSerializedProperties: 0
|
||||
m_ValidKeywords:
|
||||
- _EMISSION
|
||||
- _GLOSSINESS_FROM_BASE_ALPHA
|
||||
- _SPECULAR_COLOR
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 1
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap:
|
||||
RenderType: Opaque
|
||||
disabledShaderPasses:
|
||||
- MOTIONVECTORS
|
||||
m_LockedProperties:
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _BaseMap:
|
||||
m_Texture: {fileID: 2800000, guid: 2fba0f6812d304ed0a1a6bcc447e4af8, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _BumpMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _EmissionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _SpecGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_Lightmaps:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_LightmapsInd:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_ShadowMasks:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Ints: []
|
||||
m_Floats:
|
||||
- _AddPrecomputedVelocity: 0
|
||||
- _AlphaClip: 0
|
||||
- _AlphaToMask: 0
|
||||
- _Blend: 0
|
||||
- _BlendModePreserveSpecular: 1
|
||||
- _BumpScale: 1
|
||||
- _Cull: 2
|
||||
- _Cutoff: 0.5
|
||||
- _DstBlend: 0
|
||||
- _DstBlendAlpha: 0
|
||||
- _GlossinessSource: 0
|
||||
- _QueueOffset: 0
|
||||
- _ReceiveShadows: 1
|
||||
- _Shininess: 0
|
||||
- _Smoothness: 0.5
|
||||
- _SmoothnessSource: 1
|
||||
- _SpecSource: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _SrcBlendAlpha: 1
|
||||
- _Surface: 0
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _SpecColor: {r: 0.5, g: 0.5, b: 0.5, a: 0.5}
|
||||
m_BuildTextureStacks: []
|
||||
m_AllowLocking: 1
|
||||
--- !u!114 &4084420163468262454
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 10
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: deecda6b38e164a76beae141117472f9
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Integrations/LimbHacker-master/Example/Checkerperson/Materials/Checkerperson.mat
|
||||
uploadId: 889948
|
||||
Binary file not shown.
@@ -0,0 +1,53 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2fba0f6812d304ed0a1a6bcc447e4af8
|
||||
TextureImporter:
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -1
|
||||
maxTextureSize: 1024
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapMode: -1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 0
|
||||
textureType: -1
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Integrations/LimbHacker-master/Example/Checkerperson/lightCheckers.png
|
||||
uploadId: 889948
|
||||
Binary file not shown.
@@ -0,0 +1,298 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e3edf8014b1aa4a658386663240d0446
|
||||
ModelImporter:
|
||||
serializedVersion: 22200
|
||||
internalIDToNameTable:
|
||||
- first:
|
||||
1: 100000
|
||||
second: //RootNode
|
||||
- first:
|
||||
1: 100002
|
||||
second: toe_R
|
||||
- first:
|
||||
1: 100004
|
||||
second: foot_R
|
||||
- first:
|
||||
1: 100006
|
||||
second: shin_R
|
||||
- first:
|
||||
1: 100008
|
||||
second: thigh_R
|
||||
- first:
|
||||
1: 100010
|
||||
second: toe_L
|
||||
- first:
|
||||
1: 100012
|
||||
second: foot_L
|
||||
- first:
|
||||
1: 100014
|
||||
second: shin_L
|
||||
- first:
|
||||
1: 100016
|
||||
second: thigh_L
|
||||
- first:
|
||||
1: 100018
|
||||
second: head
|
||||
- first:
|
||||
1: 100020
|
||||
second: neck_000
|
||||
- first:
|
||||
1: 100022
|
||||
second: neck
|
||||
- first:
|
||||
1: 100024
|
||||
second: hand_R
|
||||
- first:
|
||||
1: 100026
|
||||
second: forearm_R
|
||||
- first:
|
||||
1: 100028
|
||||
second: upper_arm_R
|
||||
- first:
|
||||
1: 100030
|
||||
second: shoulder_R
|
||||
- first:
|
||||
1: 100032
|
||||
second: hand_L
|
||||
- first:
|
||||
1: 100034
|
||||
second: forearm_L
|
||||
- first:
|
||||
1: 100036
|
||||
second: upper_arm_L
|
||||
- first:
|
||||
1: 100038
|
||||
second: shoulder_L
|
||||
- first:
|
||||
1: 100040
|
||||
second: ribs
|
||||
- first:
|
||||
1: 100042
|
||||
second: spine
|
||||
- first:
|
||||
1: 100044
|
||||
second: hips
|
||||
- first:
|
||||
1: 100046
|
||||
second: Armature
|
||||
- first:
|
||||
1: 100048
|
||||
second: Dude
|
||||
- first:
|
||||
1: 100050
|
||||
second: wrist_L
|
||||
- first:
|
||||
1: 100052
|
||||
second: wrist_R
|
||||
- first:
|
||||
4: 400000
|
||||
second: //RootNode
|
||||
- first:
|
||||
4: 400002
|
||||
second: toe_R
|
||||
- first:
|
||||
4: 400004
|
||||
second: foot_R
|
||||
- first:
|
||||
4: 400006
|
||||
second: shin_R
|
||||
- first:
|
||||
4: 400008
|
||||
second: thigh_R
|
||||
- first:
|
||||
4: 400010
|
||||
second: toe_L
|
||||
- first:
|
||||
4: 400012
|
||||
second: foot_L
|
||||
- first:
|
||||
4: 400014
|
||||
second: shin_L
|
||||
- first:
|
||||
4: 400016
|
||||
second: thigh_L
|
||||
- first:
|
||||
4: 400018
|
||||
second: head
|
||||
- first:
|
||||
4: 400020
|
||||
second: neck_000
|
||||
- first:
|
||||
4: 400022
|
||||
second: neck
|
||||
- first:
|
||||
4: 400024
|
||||
second: hand_R
|
||||
- first:
|
||||
4: 400026
|
||||
second: forearm_R
|
||||
- first:
|
||||
4: 400028
|
||||
second: upper_arm_R
|
||||
- first:
|
||||
4: 400030
|
||||
second: shoulder_R
|
||||
- first:
|
||||
4: 400032
|
||||
second: hand_L
|
||||
- first:
|
||||
4: 400034
|
||||
second: forearm_L
|
||||
- first:
|
||||
4: 400036
|
||||
second: upper_arm_L
|
||||
- first:
|
||||
4: 400038
|
||||
second: shoulder_L
|
||||
- first:
|
||||
4: 400040
|
||||
second: ribs
|
||||
- first:
|
||||
4: 400042
|
||||
second: spine
|
||||
- first:
|
||||
4: 400044
|
||||
second: hips
|
||||
- first:
|
||||
4: 400046
|
||||
second: Armature
|
||||
- first:
|
||||
4: 400048
|
||||
second: Dude
|
||||
- first:
|
||||
4: 400050
|
||||
second: wrist_L
|
||||
- first:
|
||||
4: 400052
|
||||
second: wrist_R
|
||||
- first:
|
||||
43: 4300000
|
||||
second: Mesh
|
||||
- first:
|
||||
43: 4300002
|
||||
second: Dude
|
||||
- first:
|
||||
74: 7400000
|
||||
second: Default Take
|
||||
- first:
|
||||
95: 9500000
|
||||
second: //RootNode
|
||||
- first:
|
||||
111: 11100000
|
||||
second: //RootNode
|
||||
- first:
|
||||
137: 13700000
|
||||
second: hips
|
||||
- first:
|
||||
137: 13700002
|
||||
second: Dude
|
||||
externalObjects: {}
|
||||
materials:
|
||||
materialImportMode: 0
|
||||
materialName: 0
|
||||
materialSearch: 1
|
||||
materialLocation: 0
|
||||
animations:
|
||||
legacyGenerateAnimations: 4
|
||||
bakeSimulation: 0
|
||||
resampleCurves: 1
|
||||
optimizeGameObjects: 0
|
||||
removeConstantScaleCurves: 0
|
||||
motionNodeName:
|
||||
animationImportErrors:
|
||||
animationImportWarnings:
|
||||
animationRetargetingWarnings:
|
||||
animationDoRetargetingWarnings: 0
|
||||
importAnimatedCustomProperties: 0
|
||||
importConstraints: 0
|
||||
animationCompression: 3
|
||||
animationRotationError: 0.5
|
||||
animationPositionError: 0.5
|
||||
animationScaleError: 0.5
|
||||
animationWrapMode: 0
|
||||
extraExposedTransformPaths: []
|
||||
extraUserProperties: []
|
||||
clipAnimations: []
|
||||
isReadable: 1
|
||||
meshes:
|
||||
lODScreenPercentages: []
|
||||
globalScale: 1
|
||||
meshCompression: 3
|
||||
addColliders: 0
|
||||
useSRGBMaterialColor: 1
|
||||
sortHierarchyByName: 1
|
||||
importPhysicalCameras: 1
|
||||
importVisibility: 0
|
||||
importBlendShapes: 0
|
||||
importCameras: 0
|
||||
importLights: 0
|
||||
nodeNameCollisionStrategy: 0
|
||||
fileIdsGeneration: 1
|
||||
swapUVChannels: 0
|
||||
generateSecondaryUV: 0
|
||||
useFileUnits: 1
|
||||
keepQuads: 0
|
||||
weldVertices: 1
|
||||
bakeAxisConversion: 0
|
||||
preserveHierarchy: 0
|
||||
skinWeightsMode: 0
|
||||
maxBonesPerVertex: 4
|
||||
minBoneWeight: 0.001
|
||||
optimizeBones: 1
|
||||
meshOptimizationFlags: -1
|
||||
indexFormat: 1
|
||||
secondaryUVAngleDistortion: 8
|
||||
secondaryUVAreaDistortion: 15.000001
|
||||
secondaryUVHardAngle: 88
|
||||
secondaryUVMarginMethod: 0
|
||||
secondaryUVMinLightmapResolution: 40
|
||||
secondaryUVMinObjectScale: 1
|
||||
secondaryUVPackMargin: 4
|
||||
useFileScale: 0
|
||||
strictVertexDataChecks: 0
|
||||
tangentSpace:
|
||||
normalSmoothAngle: 60
|
||||
normalImportMode: 0
|
||||
tangentImportMode: 4
|
||||
normalCalculationMode: 0
|
||||
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 1
|
||||
blendShapeNormalImportMode: 1
|
||||
normalSmoothingSource: 0
|
||||
referencedClips: []
|
||||
importAnimation: 0
|
||||
humanDescription:
|
||||
serializedVersion: 3
|
||||
human: []
|
||||
skeleton: []
|
||||
armTwist: 0.5
|
||||
foreArmTwist: 0.5
|
||||
upperLegTwist: 0.5
|
||||
legTwist: 0.5
|
||||
armStretch: 0.05
|
||||
legStretch: 0.05
|
||||
feetSpacing: 0
|
||||
globalScale: 1
|
||||
rootMotionBoneName: Armature
|
||||
hasTranslationDoF: 0
|
||||
hasExtraRoot: 0
|
||||
skeletonHasParents: 0
|
||||
lastHumanDescriptionAvatarSource: {instanceID: 0}
|
||||
autoGenerateAvatarMappingIfUnspecified: 1
|
||||
animationType: 2
|
||||
humanoidOversampling: 1
|
||||
avatarSetup: 1
|
||||
addHumanoidExtraRootOnlyWhenUsingAvatar: 0
|
||||
importBlendShapeDeformPercent: 0
|
||||
remapMaterialsIfMaterialImportModeIsNone: 1
|
||||
additionalBone: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Integrations/LimbHacker-master/Example/Checkerperson/mesh.fbx
|
||||
uploadId: 889948
|
||||
Binary file not shown.
@@ -0,0 +1,196 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7a571e18b998b154190a06f1dd7da67b
|
||||
ModelImporter:
|
||||
serializedVersion: 15
|
||||
fileIDToRecycleName:
|
||||
100000: Armature
|
||||
100002: foot_L
|
||||
100004: foot_R
|
||||
100006: forearm_L
|
||||
100008: forearm_R
|
||||
100010: hand_L
|
||||
100012: hand_R
|
||||
100014: head
|
||||
100016: hips
|
||||
100018: //RootNode
|
||||
100020: neck
|
||||
100022: neck_000
|
||||
100024: ribs
|
||||
100026: shin_L
|
||||
100028: shin_R
|
||||
100030: shoulder_L
|
||||
100032: shoulder_R
|
||||
100034: spine
|
||||
100036: thigh_L
|
||||
100038: thigh_R
|
||||
100040: toe_L
|
||||
100042: toe_R
|
||||
100044: upper_arm_L
|
||||
100046: upper_arm_R
|
||||
400000: Armature
|
||||
400002: foot_L
|
||||
400004: foot_R
|
||||
400006: forearm_L
|
||||
400008: forearm_R
|
||||
400010: hand_L
|
||||
400012: hand_R
|
||||
400014: head
|
||||
400016: hips
|
||||
400018: //RootNode
|
||||
400020: neck
|
||||
400022: neck_000
|
||||
400024: ribs
|
||||
400026: shin_L
|
||||
400028: shin_R
|
||||
400030: shoulder_L
|
||||
400032: shoulder_R
|
||||
400034: spine
|
||||
400036: thigh_L
|
||||
400038: thigh_R
|
||||
400040: toe_L
|
||||
400042: toe_R
|
||||
400044: upper_arm_L
|
||||
400046: upper_arm_R
|
||||
7400000: Rise
|
||||
7400002: Crouched
|
||||
7400004: Standing
|
||||
9500000: //RootNode
|
||||
materials:
|
||||
importMaterials: 1
|
||||
materialName: 0
|
||||
materialSearch: 1
|
||||
animations:
|
||||
legacyGenerateAnimations: 4
|
||||
bakeSimulation: 0
|
||||
optimizeGameObjects: 0
|
||||
animationCompression: 1
|
||||
animationRotationError: .5
|
||||
animationPositionError: .5
|
||||
animationScaleError: .5
|
||||
animationWrapMode: 0
|
||||
extraExposedTransformPaths: []
|
||||
clipAnimations:
|
||||
- serializedVersion: 16
|
||||
name: Rise
|
||||
takeName: mixamo.com
|
||||
firstFrame: 10
|
||||
lastFrame: 76
|
||||
wrapMode: 0
|
||||
orientationOffsetY: 0
|
||||
level: 0
|
||||
cycleOffset: 0
|
||||
loop: 0
|
||||
loopTime: 0
|
||||
loopBlend: 0
|
||||
loopBlendOrientation: 0
|
||||
loopBlendPositionY: 0
|
||||
loopBlendPositionXZ: 0
|
||||
keepOriginalOrientation: 1
|
||||
keepOriginalPositionY: 0
|
||||
keepOriginalPositionXZ: 0
|
||||
heightFromFeet: 1
|
||||
mirror: 0
|
||||
bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000
|
||||
curves: []
|
||||
events: []
|
||||
transformMask: []
|
||||
maskType: 0
|
||||
maskSource: {instanceID: 0}
|
||||
- serializedVersion: 16
|
||||
name: Crouched
|
||||
takeName: mixamo.com
|
||||
firstFrame: 0
|
||||
lastFrame: 10
|
||||
wrapMode: 0
|
||||
orientationOffsetY: 0
|
||||
level: 0
|
||||
cycleOffset: 0
|
||||
loop: 0
|
||||
loopTime: 0
|
||||
loopBlend: 0
|
||||
loopBlendOrientation: 0
|
||||
loopBlendPositionY: 0
|
||||
loopBlendPositionXZ: 0
|
||||
keepOriginalOrientation: 0
|
||||
keepOriginalPositionY: 1
|
||||
keepOriginalPositionXZ: 0
|
||||
heightFromFeet: 0
|
||||
mirror: 0
|
||||
bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000
|
||||
curves: []
|
||||
events: []
|
||||
transformMask: []
|
||||
maskType: 0
|
||||
maskSource: {instanceID: 0}
|
||||
- serializedVersion: 16
|
||||
name: Standing
|
||||
takeName: mixamo.com
|
||||
firstFrame: 65
|
||||
lastFrame: 76
|
||||
wrapMode: 0
|
||||
orientationOffsetY: 0
|
||||
level: 0
|
||||
cycleOffset: 0
|
||||
loop: 0
|
||||
loopTime: 1
|
||||
loopBlend: 1
|
||||
loopBlendOrientation: 1
|
||||
loopBlendPositionY: 0
|
||||
loopBlendPositionXZ: 0
|
||||
keepOriginalOrientation: 0
|
||||
keepOriginalPositionY: 1
|
||||
keepOriginalPositionXZ: 0
|
||||
heightFromFeet: 0
|
||||
mirror: 0
|
||||
bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000
|
||||
curves: []
|
||||
events: []
|
||||
transformMask: []
|
||||
maskType: 0
|
||||
maskSource: {instanceID: 0}
|
||||
isReadable: 1
|
||||
meshes:
|
||||
lODScreenPercentages: []
|
||||
globalScale: .00999999978
|
||||
meshCompression: 0
|
||||
addColliders: 0
|
||||
importBlendShapes: 1
|
||||
swapUVChannels: 0
|
||||
generateSecondaryUV: 0
|
||||
useFileUnits: 1
|
||||
optimizeMeshForGPU: 1
|
||||
weldVertices: 1
|
||||
secondaryUVAngleDistortion: 8
|
||||
secondaryUVAreaDistortion: 15.000001
|
||||
secondaryUVHardAngle: 88
|
||||
secondaryUVPackMargin: 4
|
||||
tangentSpace:
|
||||
normalSmoothAngle: 60
|
||||
splitTangentsAcrossUV: 1
|
||||
normalImportMode: 0
|
||||
tangentImportMode: 1
|
||||
importAnimation: 1
|
||||
copyAvatar: 1
|
||||
humanDescription:
|
||||
human: []
|
||||
skeleton: []
|
||||
armTwist: .5
|
||||
foreArmTwist: .5
|
||||
upperLegTwist: .5
|
||||
legTwist: .5
|
||||
armStretch: .0500000007
|
||||
legStretch: .0500000007
|
||||
feetSpacing: 0
|
||||
rootMotionBoneName: Armature
|
||||
lastHumanDescriptionAvatarSource: {fileID: 9000000, guid: b9355d8f5f5d8c6409897381301de0ea,
|
||||
type: 3}
|
||||
animationType: 2
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Integrations/LimbHacker-master/Example/Checkerperson/mesh@Rise.fbx
|
||||
uploadId: 889948
|
||||
Binary file not shown.
@@ -0,0 +1,119 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 38d92e05d165d4bdebebb06c2b6cd053
|
||||
ModelImporter:
|
||||
serializedVersion: 15
|
||||
fileIDToRecycleName:
|
||||
100000: //RootNode
|
||||
100002: toe_R
|
||||
100004: foot_R
|
||||
100006: shin_R
|
||||
100008: thigh_R
|
||||
100010: toe_L
|
||||
100012: foot_L
|
||||
100014: shin_L
|
||||
100016: thigh_L
|
||||
100018: head
|
||||
100020: neck_000
|
||||
100022: neck
|
||||
100024: hand_R
|
||||
100026: wrist_R
|
||||
100028: forearm_R
|
||||
100030: upper_arm_R
|
||||
100032: shoulder_R
|
||||
100034: hand_L
|
||||
100036: wrist_L
|
||||
100038: forearm_L
|
||||
100040: upper_arm_L
|
||||
100042: shoulder_L
|
||||
100044: ribs
|
||||
100046: spine
|
||||
100048: hips
|
||||
100050: Armature
|
||||
400000: //RootNode
|
||||
400002: toe_R
|
||||
400004: foot_R
|
||||
400006: shin_R
|
||||
400008: thigh_R
|
||||
400010: toe_L
|
||||
400012: foot_L
|
||||
400014: shin_L
|
||||
400016: thigh_L
|
||||
400018: head
|
||||
400020: neck_000
|
||||
400022: neck
|
||||
400024: hand_R
|
||||
400026: wrist_R
|
||||
400028: forearm_R
|
||||
400030: upper_arm_R
|
||||
400032: shoulder_R
|
||||
400034: hand_L
|
||||
400036: wrist_L
|
||||
400038: forearm_L
|
||||
400040: upper_arm_L
|
||||
400042: shoulder_L
|
||||
400044: ribs
|
||||
400046: spine
|
||||
400048: hips
|
||||
400050: Armature
|
||||
7400000: mixamo.com
|
||||
11100000: //RootNode
|
||||
materials:
|
||||
importMaterials: 1
|
||||
materialName: 0
|
||||
materialSearch: 1
|
||||
animations:
|
||||
legacyGenerateAnimations: 4
|
||||
bakeSimulation: 0
|
||||
optimizeGameObjects: 0
|
||||
animationCompression: 1
|
||||
animationRotationError: .5
|
||||
animationPositionError: .5
|
||||
animationScaleError: .5
|
||||
animationWrapMode: 0
|
||||
extraExposedTransformPaths: []
|
||||
clipAnimations: []
|
||||
isReadable: 1
|
||||
meshes:
|
||||
lODScreenPercentages: []
|
||||
globalScale: 1
|
||||
meshCompression: 0
|
||||
addColliders: 0
|
||||
importBlendShapes: 1
|
||||
swapUVChannels: 0
|
||||
generateSecondaryUV: 0
|
||||
useFileUnits: 1
|
||||
optimizeMeshForGPU: 1
|
||||
weldVertices: 1
|
||||
secondaryUVAngleDistortion: 8
|
||||
secondaryUVAreaDistortion: 15.000001
|
||||
secondaryUVHardAngle: 88
|
||||
secondaryUVPackMargin: 4
|
||||
tangentSpace:
|
||||
normalSmoothAngle: 60
|
||||
splitTangentsAcrossUV: 1
|
||||
normalImportMode: 0
|
||||
tangentImportMode: 1
|
||||
importAnimation: 1
|
||||
copyAvatar: 0
|
||||
humanDescription:
|
||||
human: []
|
||||
skeleton: []
|
||||
armTwist: .5
|
||||
foreArmTwist: .5
|
||||
upperLegTwist: .5
|
||||
legTwist: .5
|
||||
armStretch: .0500000007
|
||||
legStretch: .0500000007
|
||||
feetSpacing: 0
|
||||
rootMotionBoneName:
|
||||
lastHumanDescriptionAvatarSource: {instanceID: 0}
|
||||
animationType: 1
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Integrations/LimbHacker-master/Example/Checkerperson/mesh@hit_reaction_1.fbx
|
||||
uploadId: 889948
|
||||
@@ -0,0 +1,25 @@
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace NobleMuffins.LimbHacker.Examples
|
||||
{
|
||||
public class MarkOfCain : MonoBehaviour
|
||||
{
|
||||
private readonly static List<GameObject> markedObjects = new List<GameObject>();
|
||||
|
||||
void Start()
|
||||
{
|
||||
markedObjects.Add(gameObject);
|
||||
}
|
||||
|
||||
public static void DestroyAllMarkedObjects()
|
||||
{
|
||||
foreach (var go in markedObjects)
|
||||
{
|
||||
if (go != null) Destroy(go);
|
||||
}
|
||||
|
||||
markedObjects.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a831c20dd08af2f47adc8aede0ed3ef7
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Integrations/LimbHacker-master/Example/MarkOfCain.cs
|
||||
uploadId: 889948
|
||||
@@ -0,0 +1,28 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace NobleMuffins.LimbHacker.Examples
|
||||
{
|
||||
[RequireComponent(typeof(Button))]
|
||||
public class RestartButton : MonoBehaviour
|
||||
{
|
||||
public Spawner spawner;
|
||||
|
||||
private Button button;
|
||||
|
||||
void Start()
|
||||
{
|
||||
button = gameObject.GetComponent<Button>();
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
button.visible = spawner.CanInstantiate;
|
||||
}
|
||||
|
||||
void OnClick()
|
||||
{
|
||||
spawner.Instantiate();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3df59312996834b4b823ade7ab630bfd
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Integrations/LimbHacker-master/Example/RestartButton.cs
|
||||
uploadId: 889948
|
||||
@@ -0,0 +1,45 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace NobleMuffins.LimbHacker.Examples
|
||||
{
|
||||
public class Spawner : MonoBehaviour
|
||||
{
|
||||
|
||||
public GameObject puppet;
|
||||
|
||||
public Object prefab;
|
||||
|
||||
public System.Action<GameObject> instantiationListeners;
|
||||
|
||||
public GUISkin skin;
|
||||
|
||||
// Use this for initialization
|
||||
void Start()
|
||||
{
|
||||
Instantiate();
|
||||
}
|
||||
|
||||
public void Instantiate()
|
||||
{
|
||||
if (CanInstantiate)
|
||||
{
|
||||
MarkOfCain.DestroyAllMarkedObjects();
|
||||
|
||||
if (puppet == null)
|
||||
{
|
||||
puppet = GameObject.Instantiate(prefab, transform.position, transform.rotation) as GameObject;
|
||||
}
|
||||
|
||||
instantiationListeners(puppet);
|
||||
}
|
||||
}
|
||||
|
||||
public bool CanInstantiate
|
||||
{
|
||||
get
|
||||
{
|
||||
return puppet == null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 94e16bde5a8c4c04e8c3aadf1455d858
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Integrations/LimbHacker-master/Example/Spawner.cs
|
||||
uploadId: 889948
|
||||
Binary file not shown.
@@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ecb038663812037469362e4c20786b37
|
||||
DefaultImporter:
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Integrations/LimbHacker-master/Example/Sword
|
||||
Demo.unity
|
||||
uploadId: 889948
|
||||
@@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 311925ff44bdb11429398b5885460737
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
||||
Binary file not shown.
@@ -0,0 +1,44 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fc74e81d1012e8b49828233a25bb42d5
|
||||
TextureImporter:
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -1
|
||||
maxTextureSize: 1024
|
||||
textureSettings:
|
||||
filterMode: 0
|
||||
aniso: 0
|
||||
mipBias: -1
|
||||
wrapMode: -1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
alphaIsTransparency: 0
|
||||
textureType: -1
|
||||
buildTargetSettings: []
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Integrations/LimbHacker-master/Example/Sword/metalDiffuse.png
|
||||
uploadId: 889948
|
||||
Binary file not shown.
@@ -0,0 +1,56 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9f661c9c6520d5b4a9c9dc34a59f0b34
|
||||
TextureImporter:
|
||||
fileIDToRecycleName:
|
||||
8900000: generatedCubemap
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 5
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -1
|
||||
maxTextureSize: 1024
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: 2
|
||||
mipBias: -1
|
||||
wrapMode: 1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 0
|
||||
textureType: 3
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Integrations/LimbHacker-master/Example/Sword/metalReflection.png
|
||||
uploadId: 889948
|
||||
Binary file not shown.
@@ -0,0 +1,72 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6cd367af2a3596145937b3e3071be4c9
|
||||
ModelImporter:
|
||||
serializedVersion: 15
|
||||
fileIDToRecycleName:
|
||||
100000: //RootNode
|
||||
400000: //RootNode
|
||||
2300000: //RootNode
|
||||
3300000: //RootNode
|
||||
4300000: Sword
|
||||
7400000: Default Take
|
||||
9500000: //RootNode
|
||||
materials:
|
||||
importMaterials: 0
|
||||
materialName: 0
|
||||
materialSearch: 1
|
||||
animations:
|
||||
legacyGenerateAnimations: 4
|
||||
bakeSimulation: 0
|
||||
animationCompression: 1
|
||||
animationRotationError: .5
|
||||
animationPositionError: .5
|
||||
animationScaleError: .5
|
||||
animationWrapMode: 0
|
||||
clipAnimations: []
|
||||
isReadable: 0
|
||||
meshes:
|
||||
lODScreenPercentages: []
|
||||
globalScale: .0599999987
|
||||
meshCompression: 3
|
||||
addColliders: 0
|
||||
importBlendShapes: 1
|
||||
swapUVChannels: 0
|
||||
generateSecondaryUV: 0
|
||||
useFileUnits: 1
|
||||
optimizeMeshForGPU: 1
|
||||
weldVertices: 1
|
||||
secondaryUVAngleDistortion: 8
|
||||
secondaryUVAreaDistortion: 15.000001
|
||||
secondaryUVHardAngle: 88
|
||||
secondaryUVPackMargin: 4
|
||||
tangentSpace:
|
||||
normalSmoothAngle: 60
|
||||
splitTangentsAcrossUV: 1
|
||||
normalImportMode: 1
|
||||
tangentImportMode: 1
|
||||
importAnimation: 1
|
||||
copyAvatar: 0
|
||||
humanDescription:
|
||||
human: []
|
||||
skeleton: []
|
||||
handles: []
|
||||
armTwist: .5
|
||||
foreArmTwist: .5
|
||||
upperLegTwist: .5
|
||||
legTwist: .5
|
||||
armStretch: .0500000007
|
||||
legStretch: .0500000007
|
||||
feetSpacing: 0
|
||||
rootMotionBoneName:
|
||||
lastHumanDescriptionAvatarSource: {instanceID: 0}
|
||||
additionalBone: 1
|
||||
animationType: 0
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Integrations/LimbHacker-master/Example/Sword/swordMesh.fbx
|
||||
uploadId: 889948
|
||||
@@ -0,0 +1,111 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &-4018318121080751760
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 10
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: swordMetal
|
||||
m_Shader: {fileID: 4800000, guid: 8d2bb70cbf9db8d4da26e15b26e74248, type: 3}
|
||||
m_Parent: {fileID: 0}
|
||||
m_ModifiedSerializedProperties: 0
|
||||
m_ValidKeywords:
|
||||
- _EMISSION
|
||||
- _GLOSSINESS_FROM_BASE_ALPHA
|
||||
- _SPECULAR_COLOR
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 1
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap:
|
||||
RenderType: Opaque
|
||||
disabledShaderPasses:
|
||||
- MOTIONVECTORS
|
||||
m_LockedProperties:
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _BaseMap:
|
||||
m_Texture: {fileID: 2800000, guid: fc74e81d1012e8b49828233a25bb42d5, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _BumpMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _Cube:
|
||||
m_Texture: {fileID: 8900000, guid: 9f661c9c6520d5b4a9c9dc34a59f0b34, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _EmissionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _SpecGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_Lightmaps:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_LightmapsInd:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_ShadowMasks:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Ints: []
|
||||
m_Floats:
|
||||
- _AddPrecomputedVelocity: 0
|
||||
- _AlphaClip: 0
|
||||
- _AlphaToMask: 0
|
||||
- _Blend: 0
|
||||
- _BlendModePreserveSpecular: 1
|
||||
- _BumpScale: 1
|
||||
- _Cull: 2
|
||||
- _Cutoff: 0.5
|
||||
- _DstBlend: 0
|
||||
- _DstBlendAlpha: 0
|
||||
- _GlossinessSource: 0
|
||||
- _QueueOffset: 0
|
||||
- _ReceiveShadows: 1
|
||||
- _Shininess: 0
|
||||
- _Smoothness: 0.5
|
||||
- _SmoothnessSource: 1
|
||||
- _SpecSource: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _SrcBlendAlpha: 1
|
||||
- _Surface: 0
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _BaseColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _ReflectColor: {r: 0.8235294, g: 0.905071, b: 1, a: 0.5019608}
|
||||
- _SpecColor: {r: 0.5, g: 0.5, b: 0.5, a: 0.5}
|
||||
m_BuildTextureStacks: []
|
||||
m_AllowLocking: 1
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 71e8e5bf0611d9b478047369cc73480f
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Integrations/LimbHacker-master/Example/Sword/swordMetal.mat
|
||||
uploadId: 889948
|
||||
@@ -0,0 +1,74 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace NobleMuffins.LimbHacker.Examples
|
||||
{
|
||||
public class SwordTransformController : MonoBehaviour
|
||||
{
|
||||
|
||||
// Rotation order is YXZ
|
||||
|
||||
private new Transform transform;
|
||||
private Transform cameraTransform;
|
||||
|
||||
public new Camera camera;
|
||||
|
||||
private Vector3 idealForward = Vector3.forward;
|
||||
private Vector3 forward = Vector3.forward;
|
||||
private Vector3 forwardVelocity = Vector3.zero;
|
||||
|
||||
private Vector3 idealUp = Vector3.up;
|
||||
private Vector3 up = Vector3.up;
|
||||
private Vector3 upVelocity = Vector3.zero;
|
||||
|
||||
public float trackingTime = 0.1f;
|
||||
|
||||
public float deadzone = 5f;
|
||||
|
||||
public float reach = 3f;
|
||||
|
||||
private Vector3 previousMousePosition = Vector3.zero;
|
||||
|
||||
// Use this for initialization
|
||||
void Start()
|
||||
{
|
||||
transform = GetComponent<Transform>();
|
||||
|
||||
if (camera == null)
|
||||
{
|
||||
Debug.LogError("TSD3SwordTransformController requires a camera to orient the sword.");
|
||||
enabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
cameraTransform = camera.transform;
|
||||
}
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
Vector3 mousePosition = Input.mousePosition;
|
||||
|
||||
Vector3 mouseDelta = previousMousePosition - mousePosition;
|
||||
|
||||
if (mouseDelta.magnitude > deadzone)
|
||||
{
|
||||
Vector3 cursorInThreeSpace = mousePosition;
|
||||
cursorInThreeSpace.z = reach;
|
||||
|
||||
idealForward = (camera.ScreenToWorldPoint(cursorInThreeSpace) - transform.position).normalized;
|
||||
|
||||
Matrix4x4 cameraLocalToWorld = cameraTransform.localToWorldMatrix;
|
||||
|
||||
idealUp = cameraLocalToWorld.MultiplyVector(previousMousePosition - mousePosition).normalized;
|
||||
|
||||
previousMousePosition = mousePosition;
|
||||
}
|
||||
|
||||
forward = Vector3.SmoothDamp(forward, idealForward, ref forwardVelocity, trackingTime);
|
||||
up = Vector3.SmoothDamp(up, idealUp, ref upVelocity, trackingTime);
|
||||
transform.rotation = Quaternion.LookRotation(forward, up);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cf65669bb61917e4bb9db084960985b2
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Integrations/LimbHacker-master/Example/SwordTransformController.cs
|
||||
uploadId: 889948
|
||||
@@ -0,0 +1,49 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace NobleMuffins.LimbHacker.Examples
|
||||
{
|
||||
public class SwordVelocityFilter : MonoBehaviour
|
||||
{
|
||||
public float tipSpeedForCutting = 1f;
|
||||
public float lengthInWorldUnits = 5f;
|
||||
|
||||
private new Transform transform;
|
||||
|
||||
void Start()
|
||||
{
|
||||
transform = GetComponent<Transform>();
|
||||
|
||||
priorTipPositionInWorldSpace = deriveTipPosition();
|
||||
}
|
||||
|
||||
private Vector3 priorTipPositionInWorldSpace;
|
||||
|
||||
private bool _IsFastEnoughToCut = false;
|
||||
public bool IsFastEnoughToCut
|
||||
{
|
||||
get
|
||||
{
|
||||
return _IsFastEnoughToCut;
|
||||
}
|
||||
}
|
||||
|
||||
private Vector3 deriveTipPosition()
|
||||
{
|
||||
return transform.localToWorldMatrix.MultiplyPoint3x4(Vector3.forward * lengthInWorldUnits);
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
Vector3 tipPositionInWorldSpace = deriveTipPosition();
|
||||
|
||||
Vector3 tipDelta = tipPositionInWorldSpace - priorTipPositionInWorldSpace;
|
||||
|
||||
float tipSpeed = tipDelta.magnitude / Time.deltaTime;
|
||||
|
||||
_IsFastEnoughToCut = tipSpeed > tipSpeedForCutting;
|
||||
|
||||
priorTipPositionInWorldSpace = tipPositionInWorldSpace;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3c8ece18c9b9f954ba586bb9f7a32645
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Integrations/LimbHacker-master/Example/SwordVelocityFilter.cs
|
||||
uploadId: 889948
|
||||
@@ -0,0 +1,39 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace NobleMuffins.LimbHacker.Examples
|
||||
{
|
||||
public class TimeForSlicingFilter : MonoBehaviour
|
||||
{
|
||||
public string nameOfAnimationStateForSlicing = "Standing";
|
||||
public Spawner spawner;
|
||||
|
||||
public bool isAlwaysTimeForSlicing;
|
||||
|
||||
private Animator animator;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
spawner.instantiationListeners += HandleInstantiation;
|
||||
}
|
||||
|
||||
void HandleInstantiation(GameObject go)
|
||||
{
|
||||
animator = go.GetComponent<Animator>();
|
||||
}
|
||||
|
||||
public bool IsTimeForSlicing
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Input.GetKey(KeyCode.A)) return true;
|
||||
if (isAlwaysTimeForSlicing) return true;
|
||||
#if UNITY_5 || UNITY_5_3_OR_NEWER //Starting with 5.3 we can use UNITY_X_Y_OR_NEWER
|
||||
return animator != null && animator.GetCurrentAnimatorStateInfo(0).fullPathHash == Animator.StringToHash(nameOfAnimationStateForSlicing);
|
||||
#else
|
||||
return animator != null && animator.GetCurrentAnimatorStateInfo(0).nameHash == Animator.StringToHash(nameOfAnimationStateForSlicing);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 225ccc6ade55a684d9041a853b5720dd
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Integrations/LimbHacker-master/Example/TimeForSlicingFilter.cs
|
||||
uploadId: 889948
|
||||
@@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 56e05db80da544ab696707cec1d9ba2a
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace NobleMuffins.LimbHacker.Guts
|
||||
{
|
||||
public abstract class AbstractDisposableProduct: IDisposable
|
||||
{
|
||||
IEnumerable<IDisposable> dependencies;
|
||||
|
||||
public AbstractDisposableProduct(IEnumerable<IDisposable> dependecies)
|
||||
{
|
||||
this.dependencies = dependecies;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
foreach(var dependency in dependencies)
|
||||
{
|
||||
dependency.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 393b98cf83f194a5fb1bfd3ff004fbbd
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Integrations/LimbHacker-master/Guts/AbstractDisposableProduct.cs
|
||||
uploadId: 889948
|
||||
@@ -0,0 +1,181 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace NobleMuffins.LimbHacker.Guts {
|
||||
|
||||
//This is an unsafe white-box class that is part of the Turbo Slicer black-box. The
|
||||
//differences between it and the .NET List are esoteric, specific and not relevant
|
||||
//to your needs.
|
||||
|
||||
//Do not, under any circumstances, see it as a faster List for general use.
|
||||
//Read on only if you are studying or modifying TurboSlice.
|
||||
|
||||
/* Shea's Law states, "The ability to improve a design occurs primarily at the interfaces.
|
||||
* This is also the prime location for screwing it up."
|
||||
*
|
||||
* This class provides nice examples of both.
|
||||
*
|
||||
* List.AddRange was eating up a large chunk of time according to the profiler. This method only
|
||||
* accepts IEnumerable. While this is good in its use case, it doesn't have access to the given
|
||||
* set's size and discovering its size creates a lot of unnecessary work. Therefore, the first
|
||||
* special feature of TurboList is that its interface lets it observe a given set's size.
|
||||
*
|
||||
* The second is more dangerous; its model is directly exposed. Another chunk of time spent was getting
|
||||
* at the data, copying it and sometimes simply getting an array from the List.
|
||||
*
|
||||
* Do not use this class for anything else and do not assume that this will make anything else faster.
|
||||
* It was designed to meet a particular use case - the Muffin Slicer's - and is a private subset of that class
|
||||
* for a reason.
|
||||
*/
|
||||
public class ArrayBuilder<T>: IList<T> {
|
||||
public T[] array;
|
||||
public int length = 0;
|
||||
|
||||
public T[] ToArray()
|
||||
{
|
||||
T[] a = new T[length];
|
||||
System.Array.Copy(array, a, length);
|
||||
return a;
|
||||
}
|
||||
|
||||
public ArrayBuilder(T[] copySource)
|
||||
{
|
||||
var capacity = RoundUpToNearestSquare(copySource.Length);
|
||||
array = new T[capacity];
|
||||
System.Array.Copy(copySource, array, copySource.Length);
|
||||
length = copySource.Length;
|
||||
}
|
||||
|
||||
public ArrayBuilder(): this(0) {
|
||||
}
|
||||
|
||||
public ArrayBuilder(int desiredCapacity)
|
||||
{
|
||||
var capacity = RoundUpToNearestSquare(desiredCapacity);
|
||||
array = new T[capacity];
|
||||
length = 0;
|
||||
}
|
||||
|
||||
public void EnsureCapacity(int i)
|
||||
{
|
||||
bool mustExpand = i > array.Length;
|
||||
|
||||
if(mustExpand)
|
||||
{
|
||||
System.Array.Resize<T>(ref array, RoundUpToNearestSquare(i));
|
||||
}
|
||||
}
|
||||
|
||||
public void AddArray(T[] source)
|
||||
{
|
||||
EnsureCapacity(source.Length + length);
|
||||
System.Array.Copy(source, 0, array, length, source.Length);
|
||||
length += source.Length;
|
||||
}
|
||||
|
||||
public void AddArray(T[] source, int count)
|
||||
{
|
||||
count = System.Math.Min(count, source.Length);
|
||||
EnsureCapacity(count + length);
|
||||
System.Array.Copy(source, 0, array, length, count);
|
||||
length += count;
|
||||
}
|
||||
|
||||
private int RoundUpToNearestSquare(int minimum) {
|
||||
int newCapacity = 1;
|
||||
do {
|
||||
newCapacity *= 2;
|
||||
}
|
||||
while(newCapacity < minimum);
|
||||
return newCapacity;
|
||||
}
|
||||
|
||||
public int Capacity
|
||||
{
|
||||
get
|
||||
{
|
||||
return array.Length;
|
||||
}
|
||||
}
|
||||
|
||||
public int Count {
|
||||
get {
|
||||
return length;
|
||||
}
|
||||
}
|
||||
|
||||
public T this [int index]
|
||||
{
|
||||
get
|
||||
{
|
||||
return array[index];
|
||||
}
|
||||
set
|
||||
{
|
||||
array[index] = value;
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveAt(int i)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public void Insert(int index, T figure)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public int IndexOf(T figure)
|
||||
{
|
||||
return System.Array.IndexOf(array, figure);
|
||||
}
|
||||
|
||||
public void Add (T item)
|
||||
{
|
||||
EnsureCapacity(length + 1);
|
||||
array[length] = item;
|
||||
length++;
|
||||
}
|
||||
|
||||
public bool Contains (T item)
|
||||
{
|
||||
throw new System.NotImplementedException ();
|
||||
}
|
||||
|
||||
public void CopyTo (T[] array, int arrayIndex)
|
||||
{
|
||||
throw new System.NotImplementedException ();
|
||||
}
|
||||
|
||||
public IEnumerator<T> GetEnumerator ()
|
||||
{
|
||||
throw new System.NotImplementedException ();
|
||||
}
|
||||
public void Clear() {
|
||||
length = 0;
|
||||
}
|
||||
|
||||
public object SyncRoot {
|
||||
get {
|
||||
throw new System.NotImplementedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public bool Remove (T item)
|
||||
{
|
||||
throw new System.NotImplementedException ();
|
||||
}
|
||||
|
||||
public bool IsReadOnly {
|
||||
get {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator ()
|
||||
{
|
||||
return array.GetEnumerator();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ca71475b3d2fa064180fa2ed82f65045
|
||||
timeCreated: 1488541202
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Integrations/LimbHacker-master/Guts/ArrayBuilder.cs
|
||||
uploadId: 889948
|
||||
@@ -0,0 +1,97 @@
|
||||
using System;
|
||||
|
||||
namespace NobleMuffins.LimbHacker.Guts
|
||||
{
|
||||
public class ArrayPool<TElement>
|
||||
{
|
||||
private readonly object key = new object ();
|
||||
|
||||
private readonly int poolSize;
|
||||
private readonly TElement[][] poolTable;
|
||||
private readonly bool[] useTable;
|
||||
|
||||
public ArrayPool (int poolSize)
|
||||
{
|
||||
this.poolSize = poolSize;
|
||||
poolTable = new TElement[poolSize][];
|
||||
useTable = new bool[poolSize];
|
||||
}
|
||||
|
||||
public DisposableBundle<TElement[]> Get (int desiredCapacity, bool clear)
|
||||
{
|
||||
TElement[] array = null;
|
||||
lock (key) {
|
||||
for(int i = 0; i < poolSize; i++) {
|
||||
if(!useTable[i] && !object.ReferenceEquals(poolTable[i], null) && poolTable[i].Length >= desiredCapacity) {
|
||||
array = poolTable[i];
|
||||
useTable[i] = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(array == null) {
|
||||
var capacity = RoundUpToNearestSquare(desiredCapacity);
|
||||
array = new TElement[capacity];
|
||||
}
|
||||
else if(clear) {
|
||||
for(int i = 0; i < array.Length; i++) {
|
||||
array[i] = default(TElement);
|
||||
}
|
||||
}
|
||||
return new DisposableBundle<TElement[]>(array, Release);
|
||||
}
|
||||
|
||||
public IDisposable Get(int desiredCapacity, bool clear, out TElement[] collection) {
|
||||
var bundle = Get(desiredCapacity, clear);
|
||||
collection = bundle.Object;
|
||||
return bundle;
|
||||
}
|
||||
|
||||
private void Release (TElement[] array)
|
||||
{
|
||||
lock(key) {
|
||||
var foundPlace = false;
|
||||
|
||||
//First try to find its place, if it's already in the pool table.
|
||||
for(int i = 0; i < poolSize; i++) {
|
||||
if(object.ReferenceEquals(poolTable[i], array)) {
|
||||
useTable[i] = false;
|
||||
foundPlace = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//If that failed, than try to find an empty slot.
|
||||
if(foundPlace == false) {
|
||||
for(int i = 0; i < poolSize; i++) {
|
||||
if(object.ReferenceEquals(poolTable[i], null)) {
|
||||
poolTable[i] = array;
|
||||
useTable[i] = false;
|
||||
foundPlace = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//If that failed, than try to find a smaller collection that isn't in use and replace it.
|
||||
if(foundPlace == false) {
|
||||
for(int i = 0; i < poolSize; i++) {
|
||||
if(!useTable[i] && !object.ReferenceEquals(poolTable[i], null) && poolTable[i].Length < array.Length) {
|
||||
poolTable[i] = array;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private int RoundUpToNearestSquare(int minimum) {
|
||||
int newCapacity = 1;
|
||||
do {
|
||||
newCapacity *= 2;
|
||||
}
|
||||
while(newCapacity < minimum);
|
||||
return newCapacity;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 68409e20be087364bb94e44e4310390a
|
||||
timeCreated: 1488541205
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Integrations/LimbHacker-master/Guts/ArrayPool.cs
|
||||
uploadId: 889948
|
||||
@@ -0,0 +1,18 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace NobleMuffins.LimbHacker.Guts
|
||||
{
|
||||
public class BoneMetadata
|
||||
{
|
||||
public BoneMetadata(int index, string nameInViewGraph, Matrix4x4 bindPose)
|
||||
{
|
||||
Index = index;
|
||||
NameInViewGraph = nameInViewGraph;
|
||||
BindPose = bindPose;
|
||||
}
|
||||
|
||||
public int Index { get; private set; }
|
||||
public string NameInViewGraph { get; private set; }
|
||||
public Matrix4x4 BindPose { get; private set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 41b3baa47fe006b4580834a7d8339eda
|
||||
timeCreated: 1488443658
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Integrations/LimbHacker-master/Guts/BoneMetadata.cs
|
||||
uploadId: 889948
|
||||
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NobleMuffins.LimbHacker.Guts
|
||||
{
|
||||
public class ChildOfHackable : MonoBehaviour, ISliceable
|
||||
{
|
||||
[HideInInspector]
|
||||
public Hackable parentHackable;
|
||||
|
||||
void Start ()
|
||||
{
|
||||
if (parentHackable == null) {
|
||||
Debug.LogWarning ("Unconfigured ChildOfHackable found. Removing. If you added this to an object yourself, please remove it.");
|
||||
GameObject.DestroyImmediate (this);
|
||||
}
|
||||
}
|
||||
|
||||
void ISliceable.Slice (Vector3 positionInWorldSpace, Vector3 normalInWorldSpace)
|
||||
{
|
||||
parentHackable.Slice (positionInWorldSpace, normalInWorldSpace);
|
||||
}
|
||||
#pragma warning disable 0067
|
||||
public event EventHandler<SliceEventArgs> Sliced;
|
||||
#pragma warning restore 0067
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6547491be3d3f2047bb9029f766a7ebd
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Integrations/LimbHacker-master/Guts/ChildOfHackable.cs
|
||||
uploadId: 889948
|
||||
@@ -0,0 +1,88 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace NobleMuffins.LimbHacker.Guts
|
||||
{
|
||||
public class CollectionPool<TCollection, TElement> where TCollection: class, ICollection<TElement>
|
||||
{
|
||||
private readonly object key = new object ();
|
||||
|
||||
private readonly int poolSize;
|
||||
private readonly TCollection[] poolTable;
|
||||
private readonly bool[] useTable;
|
||||
private readonly Func<int, TCollection> instantiateWithCapacity;
|
||||
private readonly Func<TCollection, int> getCapacity;
|
||||
|
||||
public CollectionPool (int poolSize, Func<TCollection, int> getCapacity, Func<int, TCollection> instantiateWithCapacity)
|
||||
{
|
||||
this.poolSize = poolSize;
|
||||
this.getCapacity = getCapacity;
|
||||
this.instantiateWithCapacity = instantiateWithCapacity;
|
||||
poolTable = new TCollection[poolSize];
|
||||
useTable = new bool[poolSize];
|
||||
}
|
||||
|
||||
public DisposableBundle<TCollection> Get (int desiredCapacity)
|
||||
{
|
||||
TCollection o = null;
|
||||
lock (key) {
|
||||
for(int i = 0; i < poolSize; i++) {
|
||||
if(!useTable[i] && !object.ReferenceEquals(poolTable[i], null) && getCapacity(poolTable[i]) >= desiredCapacity) {
|
||||
o = poolTable[i];
|
||||
o.Clear();
|
||||
useTable[i] = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(o == null) {
|
||||
o = instantiateWithCapacity(desiredCapacity);
|
||||
}
|
||||
return new DisposableBundle<TCollection>(o, Release);
|
||||
}
|
||||
|
||||
public IDisposable Get(int desiredCapacity, out TCollection collection) {
|
||||
var bundle = Get(desiredCapacity);
|
||||
collection = bundle.Object;
|
||||
return bundle;
|
||||
}
|
||||
|
||||
private void Release (TCollection o)
|
||||
{
|
||||
lock(key) {
|
||||
var foundPlace = false;
|
||||
|
||||
//First try to find its place, if it's already in the pool table.
|
||||
for(int i = 0; i < poolSize; i++) {
|
||||
if(object.ReferenceEquals(poolTable[i], o)) {
|
||||
useTable[i] = false;
|
||||
foundPlace = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//If that failed, than try to find an empty slot.
|
||||
if(foundPlace == false) {
|
||||
for(int i = 0; i < poolSize; i++) {
|
||||
if(object.ReferenceEquals(poolTable[i], null)) {
|
||||
poolTable[i] = o;
|
||||
useTable[i] = false;
|
||||
foundPlace = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//If that failed, than try to find a smaller collection that isn't in use and replace it.
|
||||
if(foundPlace == false) {
|
||||
for(int i = 0; i < poolSize; i++) {
|
||||
if(!useTable[i] && !object.ReferenceEquals(poolTable[i], null) && poolTable[i].Count < o.Count) {
|
||||
poolTable[i] = o;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f0bfe31883c77e045b6c78336c24c94d
|
||||
timeCreated: 1488541472
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Integrations/LimbHacker-master/Guts/CollectionPool.cs
|
||||
uploadId: 889948
|
||||
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
|
||||
namespace NobleMuffins.LimbHacker.Guts
|
||||
{
|
||||
public class DisposableBundle<TObject>: IDisposable {
|
||||
public DisposableBundle(TObject datum, Action<TObject> callback) {
|
||||
this.datum = datum;
|
||||
this.callback = callback;
|
||||
disposed = false;
|
||||
}
|
||||
|
||||
private readonly TObject datum;
|
||||
private readonly Action<TObject> callback;
|
||||
private bool disposed;
|
||||
|
||||
public TObject Object { get {
|
||||
return datum;
|
||||
} }
|
||||
|
||||
public void Dispose() {
|
||||
if(!disposed) {
|
||||
disposed = true;
|
||||
callback(Object);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0da8d18f01e487546bb17a88240b45b8
|
||||
timeCreated: 1488541274
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Integrations/LimbHacker-master/Guts/DisposableBundle.cs
|
||||
uploadId: 889948
|
||||
@@ -0,0 +1,9 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NobleMuffins.LimbHacker.Guts
|
||||
{
|
||||
public class ForwardPassAgent : MonoBehaviour {
|
||||
public IEnumerable<MeshSnapshot> Snapshot { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6702f03e674fa534cb59ba5d812b638a
|
||||
timeCreated: 1487682864
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Integrations/LimbHacker-master/Guts/ForwardPassAgent.cs
|
||||
uploadId: 889948
|
||||
@@ -0,0 +1,12 @@
|
||||
using UnityEngine;
|
||||
using System;
|
||||
|
||||
namespace NobleMuffins.LimbHacker.Guts
|
||||
{
|
||||
public interface ISliceable
|
||||
{
|
||||
void Slice (Vector3 positionInWorldSpace, Vector3 normalInWorldSpace);
|
||||
|
||||
event EventHandler<SliceEventArgs> Sliced;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bcc767bb9b7e87a4eae74de3cb16a718
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Integrations/LimbHacker-master/Guts/ISliceable.cs
|
||||
uploadId: 889948
|
||||
@@ -0,0 +1,4 @@
|
||||
namespace NobleMuffins.LimbHacker.Guts
|
||||
{
|
||||
public enum InfillMode { Sloppy, Meticulous };
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c6dd1f49b6f4861409d411c9d30385fc
|
||||
timeCreated: 1490779351
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Integrations/LimbHacker-master/Guts/Infill.cs
|
||||
uploadId: 889948
|
||||
@@ -0,0 +1,46 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NobleMuffins.LimbHacker.Guts
|
||||
{
|
||||
public class JobSpecification
|
||||
{
|
||||
public JobSpecification(GameObject subject, Hackable hackable,
|
||||
IEnumerable<MeshSnapshot> meshSnapshots,
|
||||
Dictionary<string, NodeMetadata> nodeMetadata,
|
||||
Material infillMaterial,
|
||||
string jointName, float rootTipProgression, Vector3? tiltPlane, InfillMode infillMode,
|
||||
bool destroyOriginal) {
|
||||
Subject = subject;
|
||||
Hackable = hackable;
|
||||
MeshSnapshots = meshSnapshots;
|
||||
InfillMaterial = infillMaterial;
|
||||
NodeMetadata = nodeMetadata;
|
||||
JointName = jointName;
|
||||
RootTipProgression = rootTipProgression;
|
||||
TiltPlane = tiltPlane;
|
||||
InfillMode = infillMode;
|
||||
DestroyOriginal = destroyOriginal;
|
||||
}
|
||||
|
||||
public GameObject Subject { get; private set; }
|
||||
|
||||
public Hackable Hackable { get; private set; }
|
||||
|
||||
public Material InfillMaterial { get; private set; }
|
||||
|
||||
public bool DestroyOriginal { get; private set; }
|
||||
|
||||
public IEnumerable<MeshSnapshot> MeshSnapshots { get; private set; }
|
||||
|
||||
public Dictionary<string, NodeMetadata> NodeMetadata { get; private set; }
|
||||
|
||||
public string JointName { get; private set; }
|
||||
|
||||
public float RootTipProgression { get; private set; }
|
||||
|
||||
public Vector3? TiltPlane { get; private set; }
|
||||
|
||||
public InfillMode InfillMode { get; private set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2bc3a68970c1cd7448f8b20f3ddf557f
|
||||
timeCreated: 1487680054
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Integrations/LimbHacker-master/Guts/JobSpecification.cs
|
||||
uploadId: 889948
|
||||
@@ -0,0 +1,44 @@
|
||||
using UnityEngine;
|
||||
using System;
|
||||
|
||||
namespace NobleMuffins.LimbHacker.Guts
|
||||
{
|
||||
public class JobState
|
||||
{
|
||||
public JobState(JobSpecification specification) {
|
||||
Specification = specification;
|
||||
}
|
||||
|
||||
public JobSpecification Specification { get; private set; }
|
||||
|
||||
JobYield yield;
|
||||
public JobYield Yield {
|
||||
get {
|
||||
return yield;
|
||||
}
|
||||
set {
|
||||
Debug.Assert(IsDone == false, "JobYield was given a yield more than once.");
|
||||
yield = value;
|
||||
HasYield = true;
|
||||
}
|
||||
}
|
||||
public bool HasYield { get; private set; }
|
||||
|
||||
Exception exception;
|
||||
public Exception Exception {
|
||||
get {
|
||||
return exception;
|
||||
}
|
||||
set {
|
||||
Debug.Assert(IsDone == false, "JobYield was given an exception more than once.");
|
||||
exception = value;
|
||||
HasException = true;
|
||||
}
|
||||
}
|
||||
public bool HasException { get; private set; }
|
||||
|
||||
public bool IsDone { get {
|
||||
return HasException || HasYield;
|
||||
} }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 44492980717cde24e82433f3c58428e3
|
||||
timeCreated: 1487680054
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Integrations/LimbHacker-master/Guts/JobState.cs
|
||||
uploadId: 889948
|
||||
@@ -0,0 +1,23 @@
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace NobleMuffins.LimbHacker.Guts
|
||||
{
|
||||
public class JobYield
|
||||
{
|
||||
public JobYield(JobSpecification job, Vector4 planeInWorldSpace, Vector3 focalPointInWorldSpace, IEnumerable<MeshSnapshot> alfa, IEnumerable<MeshSnapshot> bravo) {
|
||||
Job = job;
|
||||
PlaneInWorldSpace = planeInWorldSpace;
|
||||
FocalPointInWorldSpace = focalPointInWorldSpace;
|
||||
Alfa = alfa;
|
||||
Bravo = bravo;
|
||||
}
|
||||
|
||||
public JobSpecification Job { get; private set; }
|
||||
public Vector4 PlaneInWorldSpace { get; private set; }
|
||||
public IEnumerable<MeshSnapshot> Alfa { get; private set; }
|
||||
public IEnumerable<MeshSnapshot> Bravo { get; private set; }
|
||||
public Vector3 FocalPointInWorldSpace { get; private set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 49f1f8b86482ca94a8723e8e13dde502
|
||||
timeCreated: 1487680054
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Integrations/LimbHacker-master/Guts/JobYield.cs
|
||||
uploadId: 889948
|
||||
@@ -0,0 +1,637 @@
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace NobleMuffins.LimbHacker.Guts
|
||||
{
|
||||
public class LimbHackerAgent : MonoBehaviour
|
||||
{
|
||||
public Mesh[] preloadMeshes;
|
||||
public WorkerThreadMode workerThreadMode;
|
||||
|
||||
private readonly HashSet<JobState> jobStates = new HashSet<JobState> ();
|
||||
private readonly List<JobState> jobStateQueue = new List<JobState> ();
|
||||
private readonly ICollection<JobState> jobStateRemovalQueue = new List<JobState> ();
|
||||
|
||||
private readonly IDictionary<int, MeshSnapshot> preloadedMeshes = new Dictionary<int, MeshSnapshot> ();
|
||||
|
||||
private static LimbHackerAgent _instance;
|
||||
|
||||
public static LimbHackerAgent instance {
|
||||
get {
|
||||
if (_instance == null) {
|
||||
GameObject go = new GameObject ();
|
||||
_instance = go.AddComponent<LimbHackerAgent> ();
|
||||
}
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
|
||||
public void Awake ()
|
||||
{
|
||||
#if UNITY_WEBGL
|
||||
if (workerThreadMode == WorkerThreadMode.Asynchronous) {
|
||||
Debug.LogWarning ("Turbo Slicer will run synchronously because WebGL does not support threads.", this);
|
||||
workerThreadMode = WorkerThreadMode.Synchronous;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (preloadMeshes != null) {
|
||||
for (int i = 0; i < preloadMeshes.Length; i++) {
|
||||
var mesh = preloadMeshes [i];
|
||||
var indices = new int[mesh.subMeshCount][];
|
||||
for (int j = 0; j < mesh.subMeshCount; j++) {
|
||||
indices [j] = mesh.GetIndices (j);
|
||||
}
|
||||
|
||||
//Note that this is NOT a usable mesh snapshot. It will need to be combined with live data at runtime.
|
||||
var rom = new MeshSnapshot (null, mesh.vertices, mesh.normals, mesh.uv, mesh.tangents, mesh.boneWeights, new Material[0], new BoneMetadata[0], null, indices);
|
||||
preloadedMeshes [mesh.GetInstanceID ()] = rom;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Use this for initialization
|
||||
void Start ()
|
||||
{
|
||||
_instance = this;
|
||||
}
|
||||
|
||||
//These buffers are used in ConsumeJobYield. This method is executed only on the event dispatch thread and therefore will not be clobbered.
|
||||
readonly Dictionary<string, bool> bonePresenceAlfaBuffer = new Dictionary<string, bool> ();
|
||||
readonly Dictionary<string, bool> bonePresenceBravoBuffer = new Dictionary<string, bool> ();
|
||||
|
||||
void ConsumeJobYield (JobState jobState)
|
||||
{
|
||||
if (jobState.HasException) {
|
||||
Debug.LogException (jobState.Exception);
|
||||
} else {
|
||||
var jobSpecification = jobState.Specification;
|
||||
var jobYield = jobState.Yield;
|
||||
|
||||
bonePresenceAlfaBuffer.Clear ();
|
||||
bonePresenceBravoBuffer.Clear ();
|
||||
|
||||
foreach (var kvp in jobSpecification.NodeMetadata) {
|
||||
bonePresenceAlfaBuffer [kvp.Key] = kvp.Value.IsConsideredSevered;
|
||||
bonePresenceBravoBuffer [kvp.Key] = !kvp.Value.IsConsideredSevered;
|
||||
}
|
||||
|
||||
var originalSubjectTransform = jobSpecification.Subject.transform;
|
||||
|
||||
bool useAlternateForFront, useAlternateForBack;
|
||||
|
||||
if (jobSpecification.Hackable.alternatePrefab == null) {
|
||||
useAlternateForFront = false;
|
||||
useAlternateForBack = false;
|
||||
} else {
|
||||
useAlternateForFront = jobSpecification.Hackable.cloneAlternate (bonePresenceAlfaBuffer);
|
||||
useAlternateForBack = jobSpecification.Hackable.cloneAlternate (bonePresenceBravoBuffer);
|
||||
}
|
||||
|
||||
GameObject alfaObject, bravoObject;
|
||||
|
||||
var backIsNew = useAlternateForBack;
|
||||
|
||||
if (backIsNew) {
|
||||
var backSource = useAlternateForBack ? jobSpecification.Hackable.alternatePrefab : jobSpecification.Subject;
|
||||
bravoObject = (GameObject)Instantiate (backSource);
|
||||
bravoObject.name = string.Format ("{0} (Bravo)", jobSpecification.Subject);
|
||||
} else
|
||||
bravoObject = jobSpecification.Subject;
|
||||
|
||||
var alfaSource = useAlternateForFront ? jobSpecification.Hackable.alternatePrefab : jobSpecification.Subject;
|
||||
alfaObject = (GameObject)Instantiate (alfaSource);
|
||||
|
||||
HandleHierarchy (alfaObject.transform, bonePresenceAlfaBuffer, jobSpecification.NodeMetadata);
|
||||
HandleHierarchy (bravoObject.transform, bonePresenceBravoBuffer, jobSpecification.NodeMetadata);
|
||||
|
||||
var parent = originalSubjectTransform.parent;
|
||||
|
||||
var position = originalSubjectTransform.localPosition;
|
||||
var scale = originalSubjectTransform.localScale;
|
||||
|
||||
var rotation = originalSubjectTransform.localRotation;
|
||||
|
||||
alfaObject.transform.parent = parent;
|
||||
alfaObject.transform.localPosition = position;
|
||||
alfaObject.transform.localScale = scale;
|
||||
|
||||
alfaObject.transform.localRotation = rotation;
|
||||
|
||||
alfaObject.layer = jobSpecification.Subject.layer;
|
||||
|
||||
alfaObject.name = string.Format ("{0} (Alfa)", jobSpecification.Subject);
|
||||
|
||||
if (backIsNew) {
|
||||
bravoObject.transform.parent = parent;
|
||||
bravoObject.transform.localPosition = position;
|
||||
bravoObject.transform.localScale = scale;
|
||||
|
||||
bravoObject.transform.localRotation = rotation;
|
||||
|
||||
bravoObject.layer = jobSpecification.Subject.layer;
|
||||
}
|
||||
|
||||
ApplySnapshotsToRoot (alfaObject, jobYield.Alfa);
|
||||
ApplySnapshotsToRoot (bravoObject, jobYield.Bravo);
|
||||
|
||||
var results = new GameObject[] {
|
||||
alfaObject, bravoObject
|
||||
};
|
||||
|
||||
jobSpecification.Hackable.handleSlice (results, jobState.Yield.PlaneInWorldSpace, jobState.Yield.FocalPointInWorldSpace);
|
||||
|
||||
if (backIsNew) {
|
||||
// print ("destroy sliced object value " + jobSpecification.Hackable.ignoreDestroyOriginalObject);
|
||||
|
||||
if (jobSpecification.Hackable.ignoreDestroyOriginalObject) {
|
||||
jobSpecification.Hackable.eventsOnIgnoreDestroyOriginalObject.Invoke ();
|
||||
|
||||
if (jobSpecification.Hackable.setCustomIDOnSliceSpieces) {
|
||||
Hackable alfaObjectHackable = alfaObject.GetComponent<Hackable> ();
|
||||
|
||||
if (alfaObjectHackable != null) {
|
||||
alfaObjectHackable.setCustomIDOnSliceSpieces = true;
|
||||
|
||||
alfaObjectHackable.setRandomString (jobSpecification.Hackable.getRandomString ());
|
||||
}
|
||||
|
||||
Hackable bravoObjectHackable = bravoObject.GetComponent<Hackable> ();
|
||||
|
||||
if (bravoObjectHackable != null) {
|
||||
bravoObjectHackable.setCustomIDOnSliceSpieces = true;
|
||||
|
||||
bravoObjectHackable.setRandomString (jobSpecification.Hackable.getRandomString ());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Destroy (jobSpecification.Subject);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//These buffers are used in HandleHierarchy. This method is executed only on the event dispatch thread and therefore will not be clobbered.
|
||||
readonly ICollection<Transform> boneBuffer = new HashSet<Transform> ();
|
||||
readonly ICollection<GameObject> rendererHolderBuffer = new HashSet<GameObject> ();
|
||||
readonly List<Transform> childrenBuffer = new List<Transform> ();
|
||||
|
||||
private void HandleHierarchy (Transform root, Dictionary<string, bool> bonePresenceByName, IDictionary<string, NodeMetadata> originalsByName)
|
||||
{
|
||||
boneBuffer.Clear ();
|
||||
|
||||
var smrs = root.GetComponentsInChildren<SkinnedMeshRenderer> ();
|
||||
|
||||
rendererHolderBuffer.Clear ();
|
||||
|
||||
foreach (var smr in smrs) {
|
||||
rendererHolderBuffer.Add (smr.gameObject);
|
||||
|
||||
var _bones = smr.bones;
|
||||
|
||||
for (int i = 0; i < _bones.Length; i++) {
|
||||
var bone = _bones [i];
|
||||
|
||||
boneBuffer.Add (bone);
|
||||
|
||||
// Hierarchies often have transforms between bones and the root that are not
|
||||
// part of the bones collection pulled from the SMR. However if we turn these
|
||||
// intermediaries off, the ragdoll will not work. For the purposes of this
|
||||
// procedure, we're going to treat these AS bones.
|
||||
|
||||
boneBuffer.Add (bone.parent);
|
||||
}
|
||||
}
|
||||
|
||||
childrenBuffer.Clear ();
|
||||
if (childrenBuffer.Capacity < bonePresenceByName.Count) {
|
||||
childrenBuffer.Capacity = bonePresenceByName.Count;
|
||||
}
|
||||
|
||||
ConcatenateHierarchy (root, childrenBuffer);
|
||||
|
||||
for (int i = 0; i < childrenBuffer.Count; i++) {
|
||||
var t = childrenBuffer [i];
|
||||
var go = t.gameObject;
|
||||
var thisIsTheSkinnedMeshRenderer = rendererHolderBuffer.Contains (go);
|
||||
var shouldBePresent = true;
|
||||
|
||||
var presenceKeySource = t;
|
||||
do {
|
||||
string presenceKey = presenceKeySource.name;
|
||||
if (bonePresenceByName.ContainsKey (presenceKey)) {
|
||||
shouldBePresent = bonePresenceByName [presenceKey];
|
||||
break;
|
||||
} else {
|
||||
presenceKeySource = presenceKeySource.parent;
|
||||
}
|
||||
} while (childrenBuffer.Contains (presenceKeySource));
|
||||
|
||||
NodeMetadata sourceMetadata;
|
||||
if (originalsByName.TryGetValue (t.name, out sourceMetadata)) {
|
||||
t.localPosition = sourceMetadata.LocalPosition;
|
||||
t.localRotation = sourceMetadata.LocalRotation;
|
||||
t.localScale = sourceMetadata.LocalScale;
|
||||
|
||||
shouldBePresent &= sourceMetadata.IsActive;
|
||||
}
|
||||
|
||||
bool isBone = boneBuffer.Contains (t);
|
||||
|
||||
if (!shouldBePresent && isBone) {
|
||||
var c = t.GetComponent<Collider> ();
|
||||
if (c != null) {
|
||||
c.enabled = shouldBePresent;
|
||||
}
|
||||
|
||||
var r = t.GetComponent<Rigidbody> ();
|
||||
if (r != null) {
|
||||
r.mass = float.Epsilon;
|
||||
}
|
||||
} else {
|
||||
shouldBePresent |= thisIsTheSkinnedMeshRenderer;
|
||||
|
||||
go.SetActive (shouldBePresent || thisIsTheSkinnedMeshRenderer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private ICollection<Transform> GetConcatenatedHierarchy (Transform t)
|
||||
{
|
||||
var children = new HashSet<Transform> () as ICollection<Transform>;
|
||||
ConcatenateHierarchy (t, children);
|
||||
return children;
|
||||
}
|
||||
|
||||
static void ConcatenateHierarchy (Transform root, ICollection<Transform> resultBuffer)
|
||||
{
|
||||
for (int i = 0; i < root.childCount; i++) {
|
||||
var child = root.GetChild (i);
|
||||
resultBuffer.Add (child);
|
||||
ConcatenateHierarchy (child, resultBuffer);
|
||||
}
|
||||
}
|
||||
|
||||
static void ApplySnapshotsToRoot (GameObject root, IEnumerable<MeshSnapshot> snapshots)
|
||||
{
|
||||
var skinnedMeshRenderers = root.GetComponentsInChildren<SkinnedMeshRenderer> (true);
|
||||
|
||||
foreach (var snapshot in snapshots) {
|
||||
for (int i = 0; i < skinnedMeshRenderers.Length; i++) {
|
||||
if (skinnedMeshRenderers [i] != null) {
|
||||
if (skinnedMeshRenderers [i].name.Equals (snapshot.key)) {
|
||||
var skinnedMeshRenderer = skinnedMeshRenderers [i];
|
||||
|
||||
if (snapshot.vertices.Length > 0) {
|
||||
var bindPoses = new Matrix4x4[snapshot.boneMetadata.Length];
|
||||
|
||||
for (int j = 0; j < bindPoses.Length; j++) {
|
||||
bindPoses [j] = snapshot.boneMetadata [j].BindPose;
|
||||
}
|
||||
|
||||
//Note that we do not explicitly call recalculate bounds because (as per the manual) this is implicit in an
|
||||
//assignment to vertices whenever the vertex count changes from zero to non-zero.
|
||||
|
||||
var mesh = new Mesh ();
|
||||
|
||||
skinnedMeshRenderer.materials = snapshot.materials;
|
||||
|
||||
mesh.vertices = snapshot.vertices;
|
||||
mesh.normals = snapshot.normals;
|
||||
mesh.uv = snapshot.coords;
|
||||
mesh.boneWeights = snapshot.boneWeights;
|
||||
mesh.tangents = snapshot.tangents;
|
||||
mesh.subMeshCount = snapshot.indices.Length;
|
||||
mesh.bindposes = bindPoses;
|
||||
|
||||
for (int j = 0; j < snapshot.indices.Length; j++) {
|
||||
mesh.SetTriangles (snapshot.indices [j], j, false);
|
||||
}
|
||||
|
||||
mesh.UploadMeshData (true);
|
||||
|
||||
skinnedMeshRenderer.sharedMesh = mesh;
|
||||
} else {
|
||||
DestroyImmediate (skinnedMeshRenderer);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var forwardPassAgent = root.GetComponent<ForwardPassAgent> ();
|
||||
|
||||
if (forwardPassAgent == null)
|
||||
forwardPassAgent = root.AddComponent<ForwardPassAgent> ();
|
||||
|
||||
forwardPassAgent.Snapshot = snapshots;
|
||||
}
|
||||
|
||||
public static bool DetermineSlice (Hackable hackable, Vector3 pointInWorldSpace, ref string boneName, ref float rootTipProgression)
|
||||
{
|
||||
const int nothing = -1;
|
||||
|
||||
var severables = hackable.severables;
|
||||
|
||||
|
||||
//in progress to add an option to priorize certain body parts to slice
|
||||
//Transform [] temporalSeverables = new Transform [2];
|
||||
//for (var i = 0; i < temporalSeverables.Length; i++) {
|
||||
// temporalSeverables [i] = severables [i];
|
||||
//}
|
||||
|
||||
//severables = new Transform [temporalSeverables.Length];
|
||||
|
||||
//for (var i = 0; i < temporalSeverables.Length; i++) {
|
||||
// severables [i] = temporalSeverables [i];
|
||||
//}
|
||||
|
||||
//print (severables.Length);
|
||||
|
||||
|
||||
var indexByObject = new Dictionary<Transform, int> ();
|
||||
for (var i = 0; i < severables.Length; i++) {
|
||||
indexByObject [severables [i]] = i;
|
||||
}
|
||||
|
||||
var severablesInThreeSpace = new Vector3[severables.Length];
|
||||
for (var i = 0; i < severables.Length; i++) {
|
||||
severablesInThreeSpace [i] = severables [i].position;
|
||||
}
|
||||
|
||||
var deltas = new Vector3[severables.Length];
|
||||
for (var i = 0; i < severables.Length; i++) {
|
||||
deltas [i] = severablesInThreeSpace [i] - pointInWorldSpace;
|
||||
}
|
||||
|
||||
var mags = new float[severables.Length];
|
||||
for (var i = 0; i < severables.Length; i++) {
|
||||
mags [i] = deltas [i].magnitude;
|
||||
}
|
||||
|
||||
var indexOfNearestThing = nothing;
|
||||
var distanceToNearestThing = float.PositiveInfinity;
|
||||
for (var i = 0; i < severables.Length; i++) {
|
||||
if (mags [i] < distanceToNearestThing) {
|
||||
indexOfNearestThing = i;
|
||||
distanceToNearestThing = mags [i];
|
||||
}
|
||||
}
|
||||
|
||||
if (indexOfNearestThing != nothing) {
|
||||
var nearestThing = severables [indexOfNearestThing];
|
||||
|
||||
if (indexByObject.ContainsKey (nearestThing.parent)) {
|
||||
var parentIndex = indexByObject [nearestThing.parent];
|
||||
|
||||
var hereDelta = severablesInThreeSpace [indexOfNearestThing] - severablesInThreeSpace [parentIndex];
|
||||
|
||||
var touchDelta = pointInWorldSpace - severablesInThreeSpace [parentIndex];
|
||||
|
||||
//If the touch is closer to the parent than the severable is, than it's between them.
|
||||
//We'll use that and then use the root tip progression to slice just the right spot.
|
||||
if (touchDelta.magnitude < hereDelta.magnitude) {
|
||||
indexOfNearestThing = parentIndex;
|
||||
nearestThing = severables [indexOfNearestThing];
|
||||
}
|
||||
}
|
||||
|
||||
var childIndices = new List<int> ();
|
||||
|
||||
for (var i = 0; i < severables.Length; i++) {
|
||||
var candidate = severables [i];
|
||||
|
||||
if (candidate.parent == nearestThing) {
|
||||
childIndices.Add (i);
|
||||
}
|
||||
}
|
||||
|
||||
rootTipProgression = 0f;
|
||||
|
||||
if (childIndices.Count > 0) {
|
||||
var aggregatedChildPositions = Vector3.zero;
|
||||
|
||||
foreach (var i in childIndices) {
|
||||
aggregatedChildPositions += severablesInThreeSpace [i];
|
||||
}
|
||||
|
||||
var meanChildPosition = aggregatedChildPositions / childIndices.Count;
|
||||
|
||||
var alfa = (pointInWorldSpace - nearestThing.position).sqrMagnitude;
|
||||
var bravo = (pointInWorldSpace - meanChildPosition).sqrMagnitude;
|
||||
|
||||
rootTipProgression = Mathf.Clamp (alfa / bravo, 0.0f, 0.99f);
|
||||
}
|
||||
|
||||
boneName = nearestThing.name;
|
||||
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void SeverByJoint (GameObject subject, string jointName, float rootTipProgression, Vector3? planeNormal)
|
||||
{
|
||||
//Sanity check: are we already slicing this?
|
||||
foreach (var extantState in jobStates) {
|
||||
if (ReferenceEquals (extantState.Specification.Subject, subject)) {
|
||||
//Debug.LogErrorFormat("Turbo Slicer was asked to slice '{0}' but this target is already enqueued.", subject.name);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
rootTipProgression = Mathf.Clamp01 (rootTipProgression);
|
||||
|
||||
//These here are in local space because they're only used to copy to the resultant meshes; they're not used
|
||||
//to transform the vertices. We expect a world-space slice input.
|
||||
|
||||
Hackable hackable = null;
|
||||
|
||||
{
|
||||
var hackables = subject.GetComponentsInChildren<Hackable> ();
|
||||
|
||||
if (hackables.Length > 0) {
|
||||
if (hackables.Length > 1) {
|
||||
Debug.LogWarning ("Limb Hacker found multiple slice configurations on object '" + subject.name + "'! Behavior is undefined.");
|
||||
}
|
||||
|
||||
hackable = hackables [0];
|
||||
} else {
|
||||
Debug.LogWarning ("Limb Hacker found no slice configuration on object '" + subject.name + "'.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//We need information about which BONES are getting severed.
|
||||
var metadataByNodeName = new Dictionary<string, NodeMetadata> ();
|
||||
{
|
||||
var childTransformByName = new Dictionary<string, Transform> ();
|
||||
var parentKeyByKey = new Dictionary<string, string> ();
|
||||
|
||||
foreach (Transform t in GetConcatenatedHierarchy(subject.transform)) {
|
||||
childTransformByName [t.name] = t;
|
||||
|
||||
var parent = t.parent;
|
||||
|
||||
if (t == subject.transform)
|
||||
parent = null;
|
||||
|
||||
parentKeyByKey [t.name] = parent == null ? null : parent.name;
|
||||
}
|
||||
|
||||
var severedByChildName = new Dictionary<string, bool> ();
|
||||
{
|
||||
foreach (string childName in childTransformByName.Keys) {
|
||||
severedByChildName [childName] = childName.Equals (jointName);
|
||||
}
|
||||
|
||||
bool changesMade;
|
||||
do {
|
||||
changesMade = false;
|
||||
|
||||
foreach (string childKey in childTransformByName.Keys) {
|
||||
bool severed = severedByChildName [childKey];
|
||||
|
||||
if (severed)
|
||||
continue;
|
||||
|
||||
string parentKey = parentKeyByKey [childKey];
|
||||
|
||||
bool parentSevered;
|
||||
|
||||
if (severedByChildName.TryGetValue (parentKey, out parentSevered) == false)
|
||||
continue;
|
||||
|
||||
if (parentSevered) {
|
||||
severedByChildName [childKey] = true;
|
||||
|
||||
changesMade = true;
|
||||
}
|
||||
}
|
||||
} while (changesMade);
|
||||
}
|
||||
|
||||
foreach (var kvp in severedByChildName) {
|
||||
var t = childTransformByName [kvp.Key];
|
||||
var isConsideredSevered = kvp.Value;
|
||||
metadataByNodeName [kvp.Key] = new NodeMetadata (t, isConsideredSevered);
|
||||
}
|
||||
}
|
||||
|
||||
IEnumerable<MeshSnapshot> snapshots;
|
||||
var forwardPassAgent = subject.GetComponent<ForwardPassAgent> ();
|
||||
if (forwardPassAgent == null) {
|
||||
var snapshotBuilder = new List<MeshSnapshot> ();
|
||||
var skinnedMeshRenderers = subject.GetComponentsInChildren<SkinnedMeshRenderer> (true);
|
||||
foreach (var smr in skinnedMeshRenderers) {
|
||||
var mesh = smr.sharedMesh;
|
||||
|
||||
var boneMetadata = new BoneMetadata[smr.bones.Length];
|
||||
|
||||
var bones = smr.bones;
|
||||
var bindPoses = mesh.bindposes;
|
||||
|
||||
for (int i = 0; i < boneMetadata.Length; i++) {
|
||||
boneMetadata [i] = new BoneMetadata (i, bones [i].name, bindPoses [i]);
|
||||
}
|
||||
|
||||
int? infillIndex = null;
|
||||
if (hackable.infillMaterial != null) {
|
||||
var mats = smr.sharedMaterials;
|
||||
for (int i = 0; i < mats.Length; i++) {
|
||||
if (hackable.infillMaterial == mats [i]) {
|
||||
infillIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MeshSnapshot snapshot;
|
||||
|
||||
MeshSnapshot preloadedFragment;
|
||||
if (preloadedMeshes.TryGetValue (mesh.GetInstanceID (), out preloadedFragment)) {
|
||||
//The preloaded fragments are missing data which is particular to the SMR. We'll combine it with such data here.
|
||||
|
||||
snapshot = preloadedFragment.WithKey (smr.name).WithMaterials (smr.sharedMaterials).WithBoneMetadata (boneMetadata).WithInfillIndex (infillIndex);
|
||||
} else {
|
||||
var indices = new int[mesh.subMeshCount][];
|
||||
for (int i = 0; i < mesh.subMeshCount; i++) {
|
||||
indices [i] = mesh.GetIndices (i);
|
||||
}
|
||||
|
||||
snapshot = new MeshSnapshot (
|
||||
smr.name,
|
||||
mesh.vertices,
|
||||
mesh.normals,
|
||||
mesh.uv,
|
||||
mesh.tangents,
|
||||
mesh.boneWeights,
|
||||
smr.sharedMaterials,
|
||||
boneMetadata,
|
||||
infillIndex,
|
||||
indices);
|
||||
}
|
||||
|
||||
snapshotBuilder.Add (snapshot);
|
||||
}
|
||||
snapshots = snapshotBuilder;
|
||||
} else {
|
||||
snapshots = forwardPassAgent.Snapshot;
|
||||
}
|
||||
|
||||
var jobSpec = new JobSpecification (subject, hackable, snapshots, metadataByNodeName, hackable.infillMaterial, jointName, rootTipProgression, planeNormal, hackable.infillMode, true);
|
||||
var jobState = new JobState (jobSpec);
|
||||
|
||||
try {
|
||||
switch (workerThreadMode) {
|
||||
case WorkerThreadMode.Asynchronous:
|
||||
jobStates.Add (jobState);
|
||||
#if NETFX_CORE && !UNITY_EDITOR
|
||||
System.Threading.Tasks.Task.Factory.StartNew(ThreadSafeHack.Slice, jobState);
|
||||
#else
|
||||
System.Threading.ThreadPool.QueueUserWorkItem (ThreadSafeHack.Slice, jobState);
|
||||
#endif
|
||||
break;
|
||||
case WorkerThreadMode.Synchronous:
|
||||
ThreadSafeHack.Slice (jobState);
|
||||
if (jobState.HasYield) {
|
||||
ConsumeJobYield (jobState);
|
||||
} else if (jobState.HasException) {
|
||||
throw jobState.Exception;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw new System.NotImplementedException ();
|
||||
}
|
||||
} catch (System.Exception ex) {
|
||||
Debug.LogException (ex, subject);
|
||||
}
|
||||
}
|
||||
|
||||
void Update ()
|
||||
{
|
||||
jobStateRemovalQueue.Clear ();
|
||||
jobStateQueue.Clear ();
|
||||
jobStateQueue.AddRange (jobStates);
|
||||
foreach (var jobState in jobStateQueue) {
|
||||
if (jobState.IsDone) {
|
||||
try {
|
||||
if (jobState.HasYield) {
|
||||
ConsumeJobYield (jobState);
|
||||
} else if (jobState.HasException) {
|
||||
throw jobState.Exception;
|
||||
}
|
||||
} catch (System.Exception ex) {
|
||||
Debug.LogException (ex, jobState.Specification.Subject);
|
||||
|
||||
} finally {
|
||||
jobStateRemovalQueue.Add (jobState);
|
||||
}
|
||||
}
|
||||
}
|
||||
jobStates.ExceptWith (jobStateRemovalQueue);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: de80f123464224c8f923cc6be8e0d121
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Integrations/LimbHacker-master/Guts/LimbHackerAgent.cs
|
||||
uploadId: 889948
|
||||
@@ -0,0 +1,86 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NobleMuffins.LimbHacker.Guts
|
||||
{
|
||||
public class MeshSnapshot
|
||||
{
|
||||
public static readonly Vector4[] EmptyTangents = new Vector4[0];
|
||||
|
||||
public MeshSnapshot (string key,
|
||||
Vector3[] vertices, Vector3[] normals, Vector2[] coords, Vector4[] tangents, BoneWeight[] boneWeights,
|
||||
Material[] materials,
|
||||
BoneMetadata[] boneMetadata,
|
||||
int? infillIndex, int[][] indices)
|
||||
{
|
||||
this.key = key;
|
||||
this.vertices = vertices;
|
||||
this.normals = normals;
|
||||
this.coords = coords;
|
||||
this.tangents = tangents;
|
||||
this.materials = materials;
|
||||
this.boneMetadata = boneMetadata;
|
||||
this.boneWeights = boneWeights;
|
||||
this.infillIndex = infillIndex;
|
||||
this.indices = indices;
|
||||
}
|
||||
|
||||
public readonly string key;
|
||||
public readonly Vector3[] vertices;
|
||||
public readonly Vector3[] normals;
|
||||
public readonly Vector2[] coords;
|
||||
public readonly Vector4[] tangents;
|
||||
public readonly int? infillIndex;
|
||||
public readonly Material[] materials;
|
||||
public readonly BoneMetadata[] boneMetadata;
|
||||
public readonly BoneWeight[] boneWeights;
|
||||
|
||||
public readonly int[][] indices;
|
||||
|
||||
public MeshSnapshot WithKey(string figure)
|
||||
{
|
||||
return new MeshSnapshot(figure, vertices, normals, coords, tangents, boneWeights, materials, boneMetadata, infillIndex, indices);
|
||||
}
|
||||
|
||||
public MeshSnapshot WithInfillIndex(int? infillIndex)
|
||||
{
|
||||
return new MeshSnapshot(key, vertices, normals, coords, tangents, boneWeights, materials, boneMetadata, infillIndex, indices);
|
||||
}
|
||||
|
||||
public MeshSnapshot WithBoneMetadata(BoneMetadata[] figure)
|
||||
{
|
||||
return new MeshSnapshot(key, vertices, normals, coords, tangents, boneWeights, materials, figure, infillIndex, indices);
|
||||
}
|
||||
|
||||
public MeshSnapshot WithBoneWeights(BoneWeight[] figure)
|
||||
{
|
||||
return new MeshSnapshot(key, vertices, normals, coords, tangents, figure, materials, boneMetadata, infillIndex, indices);
|
||||
}
|
||||
|
||||
public MeshSnapshot WithMaterials(Material[] figure)
|
||||
{
|
||||
return new MeshSnapshot(key, vertices, normals, coords, tangents, boneWeights, figure, boneMetadata, infillIndex, indices);
|
||||
}
|
||||
|
||||
public MeshSnapshot WithVertices(Vector3[] figure) {
|
||||
return new MeshSnapshot(key, figure, normals, coords, tangents, boneWeights, materials, boneMetadata, infillIndex, indices);
|
||||
}
|
||||
|
||||
public MeshSnapshot WithNormals(Vector3[] figure) {
|
||||
return new MeshSnapshot(key, vertices, figure, coords, tangents, boneWeights, materials, boneMetadata, infillIndex, indices);
|
||||
}
|
||||
|
||||
public MeshSnapshot WithCoords(Vector2[] figure) {
|
||||
return new MeshSnapshot(key, vertices, normals, figure, tangents, boneWeights, materials, boneMetadata, infillIndex, indices);
|
||||
}
|
||||
|
||||
public MeshSnapshot WithTangents(Vector4[] figure) {
|
||||
return new MeshSnapshot(key, vertices, normals, coords, figure, boneWeights, materials, boneMetadata, infillIndex, indices);
|
||||
}
|
||||
|
||||
public MeshSnapshot WithIndices(int[][] figure)
|
||||
{
|
||||
return new MeshSnapshot(key, vertices, normals, coords, tangents, boneWeights, materials, boneMetadata, infillIndex, figure);
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user