гигантский ассет
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
using UnityEngine;
|
||||
using UHFPS.Tools;
|
||||
|
||||
namespace UHFPS.Runtime
|
||||
{
|
||||
public class ZiplineBuilder : MonoBehaviour
|
||||
{
|
||||
public GameObject ZiplineRack;
|
||||
public Axis ZiplineForward;
|
||||
public Axis ZiplineUpward;
|
||||
|
||||
public Vector3 ZiplineEnd;
|
||||
public Vector3 CenterOffset;
|
||||
|
||||
public ProceduralCable.CableSettings CableSettings;
|
||||
public ProceduralCable Cable;
|
||||
|
||||
public bool PreviewCable;
|
||||
public bool PreviewPlayer;
|
||||
public float PlayerRadius = 0.3f;
|
||||
public float PlayerHeight = 1.8f;
|
||||
|
||||
private void Reset()
|
||||
{
|
||||
ResetEndPosition();
|
||||
}
|
||||
|
||||
public void ResetEndPosition()
|
||||
{
|
||||
ZiplineEnd = transform.position + new Vector3(1, 0, 0);
|
||||
}
|
||||
|
||||
private void OnDrawGizmosSelected()
|
||||
{
|
||||
if (!PreviewCable || Cable == null || Cable.curvatorePoints == null)
|
||||
return;
|
||||
|
||||
Gizmos.color = Color.red;
|
||||
for (int i = 1; i < Cable.curvatorePoints.Count; i++)
|
||||
{
|
||||
Vector3 start = transform.TransformPoint(Cable.curvatorePoints[i - 1]) + CenterOffset;
|
||||
Vector3 end = transform.TransformPoint(Cable.curvatorePoints[i]) + CenterOffset;
|
||||
Gizmos.DrawLine(start, end);
|
||||
|
||||
if (i == 1) Gizmos.DrawWireSphere(start, 0.05f);
|
||||
Gizmos.DrawWireSphere(end, 0.05f);
|
||||
}
|
||||
|
||||
if (PreviewPlayer)
|
||||
{
|
||||
Vector3 eval = Cable.EvalRaw(0.5f);
|
||||
Vector3 center = eval + CenterOffset;
|
||||
|
||||
float height = (PlayerHeight - 0.6f) / 2f;
|
||||
Vector3 p1 = new Vector3(center.x, center.y - height, center.z);
|
||||
Vector3 p2 = new Vector3(center.x, center.y + height, center.z);
|
||||
|
||||
Gizmos.color = Color.green;
|
||||
GizmosE.DrawWireCapsule(p1, p2, PlayerRadius);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e8c2379ee6c9fa84495acd4c27a0985f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,31 @@
|
||||
using UnityEngine;
|
||||
using ThunderWire.Attributes;
|
||||
|
||||
namespace UHFPS.Runtime
|
||||
{
|
||||
[InspectorHeader("Zipline Interact")]
|
||||
public class ZiplineInteract : MonoBehaviour, IStateInteract
|
||||
{
|
||||
public ZiplineBuilder ZiplineBuilder;
|
||||
|
||||
public StateParams OnStateInteract()
|
||||
{
|
||||
Vector3 start = ZiplineBuilder.Cable._startTransform.position;
|
||||
Vector3 end = ZiplineBuilder.Cable._endTransform.position;
|
||||
Vector3 curvatore = ZiplineBuilder.Cable.CurvatorePoint;
|
||||
|
||||
return new StateParams()
|
||||
{
|
||||
stateKey = PlayerStateMachine.ZIPLINE_STATE,
|
||||
stateData = new StorableCollection()
|
||||
{
|
||||
{ "object", gameObject },
|
||||
{ "start", start },
|
||||
{ "end", end },
|
||||
{ "curvatore", curvatore },
|
||||
{ "center", ZiplineBuilder.CenterOffset }
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 634fa3c1035fdc747a95ecc77fcffe77
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user