修改mesh

This commit is contained in:
2025-11-04 23:11:56 +08:00
parent 32f07eb14e
commit e8f6308580
93 changed files with 1587 additions and 491 deletions

8
Assets/Scripts/ThirdParty/Rope.meta vendored Normal file
View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 77bf606826b396b4892cee2a10698bdc
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 4894eb7559b3e1043bf7580ed860fd68
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,10 @@
using UnityEngine;
namespace NBF
{
public class DisableInPlayModeAttribute : PropertyAttribute
{
public DisableInPlayModeAttribute()
{ }
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 41aa8ad4cfb989c4bba7e1e5615356cd
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2f8ad20496e568346942cb85d75a2bde
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,44 @@
using UnityEngine;
using UnityEditor;
using UnityEngine.UIElements;
namespace NBF
{
[CustomPropertyDrawer(typeof(DisableInPlayModeAttribute))]
public class BeginLockInPlayModeDecoratorDrawer : PropertyDrawer
{
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
{
return EditorGUI.GetPropertyHeight(property, label, true);
}
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
var playing = Application.isPlaying;
if (playing)
{
GUI.enabled = false;
}
var ranges = fieldInfo.GetCustomAttributes(typeof(RangeAttribute), true);
var range = ranges != null && ranges.Length > 0 ? ranges[0] as RangeAttribute : null;
if (range != null && property.propertyType == SerializedPropertyType.Float)
{
EditorGUI.Slider(position, property, range.min, range.max);
}
else if (range != null && property.propertyType == SerializedPropertyType.Integer)
{
EditorGUI.IntSlider(position, property, (int)range.min, (int)range.max);
}
else
{
EditorGUI.PropertyField(position, property, label, true);
}
if (playing)
{
GUI.enabled = true;
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: f096bd19e16171c4bad990519eddc8b7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,80 @@
using UnityEngine;
using UnityEditor;
using System.Collections.Generic;
using Unity.Collections;
using Unity.Mathematics;
namespace NBF
{
[CustomEditor(typeof(Rope)), CanEditMultipleObjects]
public class RopeEditor : Editor
{
public override void OnInspectorGUI()
{
base.OnInspectorGUI();
}
public void OnSceneGUI()
{
if (Application.isPlaying)
{
return;
}
var rope = target as Rope;
if (rope == null)
{
return;
}
// Draw floating window with buttons
if (Selection.objects.Length == 1)
{
Handles.BeginGUI();
GUI.skin = EditorGUIUtility.GetBuiltinSkin(EditorSkin.Scene);
var lastSpawn = rope.spawnPoints.Count > 0 ? rope.spawnPoints[rope.spawnPoints.Count - 1] : float3.zero;
var location = HandleUtility.WorldToGUIPoint(rope.transform.TransformPoint(lastSpawn)) + Vector2.right * 64.0f;
GUILayout.Window(0, new Rect(location, Vector2.one), (id) =>
{
if (GUILayout.Button("Push spawn point"))
{
Undo.RecordObject(rope, "Push Rope Spawn Point");
rope.PushSpawnPoint();
}
if (rope.spawnPoints.Count > 2 && GUILayout.Button("Pop spawn point"))
{
Undo.RecordObject(rope, "Pop Rope Spawn Point");
rope.PopSpawnPoint();
}
}, rope.gameObject.name);
Handles.EndGUI();
}
// Draw position handles
Handles.color = Rope.Colors.spawnPointHandle;
for (int i = 0; i < rope.spawnPoints.Count; i++)
{
var spawnPoint = rope.spawnPoints[i];
var position = rope.transform.TransformPoint(spawnPoint);
EditorGUI.BeginChangeCheck();
if (Event.current.modifiers.HasFlag(EventModifiers.Shift))
{
position = Handles.PositionHandle(position, Quaternion.identity);
}
else
{
var fmh_69_65_638978072337815361 = Quaternion.identity; position = Handles.FreeMoveHandle(position, rope.radius * 4.0f, Vector3.one * 0.5f, Handles.SphereHandleCap);
}
if (EditorGUI.EndChangeCheck())
{
Undo.RecordObject(rope, "Move Rope Spawn Point");
spawnPoint = rope.transform.InverseTransformPoint(position);
rope.spawnPoints[i] = spawnPoint;
}
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: cb712eea104baa44597cd77e9a7f2cb1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,206 @@
using UnityEngine;
using Unity.Mathematics;
using Unity.Collections;
using System.Collections.Generic;
using System.Linq;
namespace NBF
{
public static class PointsExtensions
{
// Curve length
public static float GetLengthOfCurve(this NativeArray<float3> curve, ref float4x4 transform, bool isLoop = false)
{
if (curve == null || curve.Length == 0)
{
return 0.0f;
}
var sum = 0.0f;
var firstPoint = math.mul(transform, new float4(curve[0], 1.0f)).xyz;
var lastPoint = firstPoint;
for (int i = 1; i < curve.Length; i++)
{
var point = math.mul(transform, new float4(curve[i], 1.0f)).xyz;
sum += math.distance(lastPoint, point);
lastPoint = point;
}
if (isLoop)
{
sum += math.distance(lastPoint, firstPoint);
}
return sum;
}
public static float GetLengthOfCurve(this NativeArray<float3> curve, bool isLoop = false)
{
var transform = float4x4.identity;
return curve.GetLengthOfCurve(ref transform, isLoop);
}
public static float GetLengthOfCurve(this IEnumerable<float3> curve, ref float4x4 transform, bool isLoop = false)
{
var array = new NativeArray<float3>(curve.ToArray(), Allocator.Temp);
var sum = array.GetLengthOfCurve(ref transform, isLoop);
array.Dispose();
return sum;
}
public static float GetLengthOfCurve(this IEnumerable<float3> curve, bool isLoop = false)
{
var transform = float4x4.identity;
return curve.GetLengthOfCurve(ref transform, isLoop);
}
// Curve points
private static void GetPointAlongCurve(this NativeArray<float3> curve, ref float4x4 transform, float distance, out float3 point, ref int currentTargetIndex, ref float accumulatedLength)
{
if (curve.Length < 2)
{
throw new System.ArgumentException(nameof(curve));
}
if (currentTargetIndex < 1 || currentTargetIndex >= curve.Length)
{
throw new System.ArgumentOutOfRangeException(nameof(currentTargetIndex));
}
var previousTarget = curve[currentTargetIndex - 1];
while (currentTargetIndex < curve.Length)
{
var target = curve[currentTargetIndex];
var segmentLength = math.distance(previousTarget, target);
if (distance <= accumulatedLength + segmentLength)
{
var interpolated = math.lerp(previousTarget, target, (distance - accumulatedLength) / segmentLength);
point = math.mul(transform, new float4(interpolated, 1.0f)).xyz;
return;
}
currentTargetIndex++;
accumulatedLength += segmentLength;
previousTarget = target;
}
// numerical precision made this happen, just return last point
currentTargetIndex = curve.Length - 1;
point = math.mul(transform, new float4(previousTarget, 1.0f)).xyz;
}
public static void GetPointAlongCurve(this NativeArray<float3> curve, ref float4x4 transform, float distance, out float3 point)
{
var currentTargetIndex = 1;
var accumulatedLength = 0.0f;
curve.GetPointAlongCurve(ref transform, distance, out point, ref currentTargetIndex, ref accumulatedLength);
}
public static void GetPointAlongCurve(this NativeArray<float3> curve, float distance, out float3 point)
{
var transform = float4x4.identity;
curve.GetPointAlongCurve(ref transform, distance, out point);
}
public static void GetPointAlongCurve(this IEnumerable<float3> curve, ref float4x4 transform, float distance, out float3 point)
{
var array = new NativeArray<float3>(curve.ToArray(), Allocator.Temp);
array.GetPointAlongCurve(ref transform, distance, out point);
array.Dispose();
}
public static void GetPointAlongCurve(this IEnumerable<float3> curve, float distance, out float3 point)
{
var transform = float4x4.identity;
curve.GetPointAlongCurve(ref transform, distance, out point);
}
public static void GetPointsAlongCurve(this NativeArray<float3> curve, ref float4x4 transform, float desiredPointDistance, NativeArray<float3> result)
{
var currentTargetIndex = 1;
var accumulatedLength = 0.0f;
for (int i = 0; i < result.Length; i++)
{
curve.GetPointAlongCurve(ref transform, desiredPointDistance * i, out float3 point, ref currentTargetIndex, ref accumulatedLength);
result[i] = point;
}
}
public static void GetPointsAlongCurve(this NativeArray<float3> curve, float desiredPointDistance, NativeArray<float3> result)
{
var transform = float4x4.identity;
curve.GetPointsAlongCurve(ref transform, desiredPointDistance, result);
}
public static void GetPointsAlongCurve(this IEnumerable<float3> curve, ref float4x4 transform, float desiredPointDistance, NativeArray<float3> result)
{
var array = new NativeArray<float3>(curve.ToArray(), Allocator.Temp);
array.GetPointsAlongCurve(ref transform, desiredPointDistance, result);
array.Dispose();
}
public static void GetPointsAlongCurve(this IEnumerable<float3> curve, float desiredPointDistance, NativeArray<float3> result)
{
var transform = float4x4.identity;
curve.GetPointsAlongCurve(ref transform, desiredPointDistance, result);
}
// Closest point
public static void GetClosestPoint(this NativeArray<float3> curve, float3 point, out int index, out float distance)
{
index = 0;
var closestDistanceSq = math.distancesq(curve[0], point);
for (int i = 1; i < curve.Length; i++)
{
var distSq = math.distancesq(curve[i], point);
if (distSq < closestDistanceSq)
{
index = i;
closestDistanceSq = distSq;
}
}
distance = math.sqrt(closestDistanceSq);
}
public static void GetClosestPoint(this NativeArray<float3> curve, Ray ray, out int index, out float distance, out float distanceAlongRay)
{
index = 0;
var origin = (float3)ray.origin;
var dir = math.normalizesafe(ray.direction);
var closestDistanceAlongRay = math.dot(curve[0] - origin, dir);
var closestDistanceSq = math.distancesq(origin + closestDistanceAlongRay * dir, curve[0]);
for (int i = 1; i < curve.Length; i++)
{
var position = curve[i];
var rayDist = math.dot(position - origin, dir);
var distSq = math.distancesq(origin + rayDist * dir, position);
if (distSq < closestDistanceSq)
{
index = i;
closestDistanceAlongRay = rayDist;
closestDistanceSq = distSq;
}
}
distance = math.sqrt(closestDistanceSq);
distanceAlongRay = closestDistanceAlongRay;
}
// Distance
public static void KeepAtDistance(this ref float3 point, ref float3 otherPoint, float distance, float stiffness = 1.0f)
{
var delta = otherPoint - point;
var currentDistance = math.length(delta);
if (currentDistance > 0.0f)
{
delta /= currentDistance;
}
else
{
delta = float3.zero;
}
delta *= (currentDistance - distance) * stiffness;
point += delta;
otherPoint -= delta;
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 460fdf7888d541b48bd9e15bfcb51528
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,92 @@
using UnityEngine;
using Unity.Mathematics;
using Unity.Collections;
using System.Collections.Generic;
using System.Linq;
namespace NBF
{
public static class RigidbodyExtensions
{
public static void GetLocalInertiaTensor(this Rigidbody rb, out float3x3 localInertiaTensor)
{
var rot = new float3x3(rb.inertiaTensorRotation);
var invRot = math.transpose(rot);
localInertiaTensor = math.mul(math.mul(rot, float3x3.Scale(rb.inertiaTensor)), invRot);
}
public static void GetInertiaTensor(this Rigidbody rb, out float3x3 inertiaTensor)
{
rb.GetLocalInertiaTensor(out float3x3 localInertiaTensor);
var rot = new float3x3(rb.rotation);
var invRot = math.transpose(rot);
inertiaTensor = math.mul(math.mul(rot, localInertiaTensor), invRot);
}
public static void GetInvInertiaTensor(this Rigidbody rb, out float3x3 invInertiaTensor)
{
rb.GetLocalInertiaTensor(out float3x3 localTensor);
float3x3 invLocalTensor = float3x3.zero;
if (math.determinant(localTensor) != 0.0f)
{
invLocalTensor = math.inverse(localTensor);
}
var rot = new float3x3(rb.rotation);
var invRot = math.transpose(rot);
invInertiaTensor = math.mul(math.mul(rot, invLocalTensor), invRot);
}
public static void ApplyImpulseNow(this Rigidbody rb, ref float3x3 invInertiaTensor, float3 point, float3 impulse)
{
if (rb.mass == 0.0f)
{
return;
}
var relativePoint = point - (float3)rb.worldCenterOfMass;
var angularMomentumChange = math.cross(relativePoint, impulse);
var angularVelocityChange = math.mul(invInertiaTensor, angularMomentumChange);
rb.linearVelocity += (Vector3)impulse / rb.mass;
rb.angularVelocity += (Vector3)angularVelocityChange;
}
public static void ApplyImpulseNow(this Rigidbody rb, float3 point, float3 impulse)
{
rb.GetInvInertiaTensor(out float3x3 invInertiaTensor);
rb.ApplyImpulseNow(ref invInertiaTensor, point, impulse);
}
public static void SetPointVelocityNow(this Rigidbody rb, ref float3x3 invInertiaTensor, float3 point, float3 normal, float desiredSpeed, float damping = 1.0f)
{
if (rb.mass == 0.0f)
{
return;
}
var velocityChange = desiredSpeed - math.dot(rb.GetPointVelocity(point), normal) * damping;
var relativePoint = point - (float3)rb.worldCenterOfMass;
var denominator = (1.0f / rb.mass) + math.dot(math.cross(math.mul(invInertiaTensor, math.cross(relativePoint, normal)), relativePoint), normal);
if (denominator == 0.0f)
{
return;
}
var j = velocityChange / denominator;
rb.ApplyImpulseNow(ref invInertiaTensor, point, j * normal);
}
public static void SetPointVelocityNow(this Rigidbody rb, float3 point, float3 normal, float desiredSpeed, float damping = 1.0f)
{
rb.GetInvInertiaTensor(out float3x3 invInertiaTensor);
rb.SetPointVelocityNow(ref invInertiaTensor, point, normal, desiredSpeed, damping);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 40ab74e53dce5804b8debdf053bccfae
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 274ad94c8d1c74add9a9cc85a946ad59
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 386748bc44dcf2c4cb5f81bbd7a1dbbe
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,34 @@
using UnityEngine;
namespace NBF.Example
{
public class ApplyTorqueOnKey : MonoBehaviour
{
public Vector3 relativeTorque;
public float maxAngularSpeed;
public KeyCode key;
protected Rigidbody rb;
public void Start()
{
rb = GetComponent<Rigidbody>();
}
public void FixedUpdate()
{
if (rb == null)
{
return;
}
if (Input.GetKey(key))
{
var torqueAxis = relativeTorque.normalized;
var strength = Mathf.SmoothStep(relativeTorque.magnitude, 0.0f, Vector3.Dot(torqueAxis, rb.angularVelocity) / maxAngularSpeed);
rb.AddRelativeTorque(torqueAxis * strength, ForceMode.Force);
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c1451225f8bdb1545ae082cfd03cddfd
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: cbda5c1a7c14e1841af127f4317557d0
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 39ca96bd67a9a8849a1c06e8b5e7a5c9
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 4300000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,165 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1807824197224447177
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6355862402819174107}
- component: {fileID: 1550045192011495150}
- component: {fileID: 4833510063135446916}
- component: {fileID: 7215318252446853067}
- component: {fileID: 7215318252446853068}
- component: {fileID: 7215318252446853069}
- component: {fileID: 7215318252446853070}
- component: {fileID: 7215318252446853071}
- component: {fileID: 7215318252446853072}
m_Layer: 0
m_Name: Environment
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 1
m_IsActive: 1
--- !u!4 &6355862402819174107
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1807824197224447177}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &1550045192011495150
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1807824197224447177}
m_Mesh: {fileID: 4300000, guid: 39ca96bd67a9a8849a1c06e8b5e7a5c9, type: 2}
--- !u!23 &4833510063135446916
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1807824197224447177}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 0a79fb9ef489c6f499e041e89836a841, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 2
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!65 &7215318252446853067
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1807824197224447177}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 0.5, y: 4.5, z: 0.49999952}
m_Center: {x: -4.75, y: 0.25, z: 1.7500002}
--- !u!65 &7215318252446853068
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1807824197224447177}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 20, y: 1, z: 20}
m_Center: {x: 0, y: -2.5, z: 0}
--- !u!65 &7215318252446853069
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1807824197224447177}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 3, y: 3.9999998, z: 3}
m_Center: {x: -5.5, y: -1.0000001, z: -5.5}
--- !u!65 &7215318252446853070
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1807824197224447177}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 0.5, y: 0.5, z: 6.499998}
m_Center: {x: -4.75, y: 2.75, z: 4.750001}
--- !u!65 &7215318252446853071
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1807824197224447177}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 0.5, y: 4.5, z: 0.4999981}
m_Center: {x: -4.75, y: 0.25, z: 7.750001}
--- !u!65 &7215318252446853072
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1807824197224447177}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 3, y: 3.9999998, z: 3}
m_Center: {x: 5.5, y: -1.0000001, z: -5.5}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: fc3b5a3644d842a44a1bc8eb5e72a975
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 3c7f7f1f33c7e2e41a67b885755052ee
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 419c43e82b41f804d988778df605183a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,139 @@
%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: Chain
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 1
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap:
RenderType: Opaque
disabledShaderPasses:
- MOTIONVECTORS
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 0}
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}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 4, 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}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
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
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 1
- _Glossiness: 0
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _UVSec: 0
- _WorkflowMode: 1
- _XRMotionVectorsPass: 1
- _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.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1
--- !u!114 &2579454104811510204
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: Unity.RenderPipelines.Universal.Editor::UnityEditor.Rendering.Universal.AssetVersion
version: 10

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 85feedf64f0c16d4182fd4c33e342d2a
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

View File

@@ -0,0 +1,90 @@
fileFormatVersion: 2
guid: b03a2c419a85b4840a89514be8b05bfd
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 10
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,140 @@
%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: Environment
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _DETAIL_MULX2
m_InvalidKeywords: []
m_LightmapFlags: 4
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: 0}
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}
- _DetailAlbedoMap:
m_Texture: {fileID: 2800000, guid: b03a2c419a85b4840a89514be8b05bfd, type: 3}
m_Scale: {x: 40, y: 40}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
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}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
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
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _UVSec: 1
- _WorkflowMode: 1
- _XRMotionVectorsPass: 1
- _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.6132076, g: 0.6132076, b: 0.6132076, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1
--- !u!114 &5545626930051578360
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: Unity.RenderPipelines.Universal.Editor::UnityEditor.Rendering.Universal.AssetVersion
version: 10

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 0a79fb9ef489c6f499e041e89836a841
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,141 @@
%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: PickedIndicator
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
- _SPECULARHIGHLIGHTS_OFF
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 1
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap:
RenderType: Opaque
disabledShaderPasses:
- MOTIONVECTORS
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 0}
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}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
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}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
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
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 1
- _Glossiness: 0
- _GlossyReflections: 0
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 1
- _SpecularHighlights: 0
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _UVSec: 0
- _WorkflowMode: 1
- _XRMotionVectorsPass: 1
- _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.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1
--- !u!114 &8815966263303209791
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: Unity.RenderPipelines.Universal.Editor::UnityEditor.Rendering.Universal.AssetVersion
version: 10

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d35e58ef8c9e0e1429517c447ba73497
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,140 @@
%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: Plank
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _SPECULARHIGHLIGHTS_OFF
m_InvalidKeywords: []
m_LightmapFlags: 4
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: 0}
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}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
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}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
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
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 1
- _Glossiness: 0
- _GlossyReflections: 0
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 0
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _UVSec: 0
- _WorkflowMode: 1
- _XRMotionVectorsPass: 1
- _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.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1
--- !u!114 &765885419054481354
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: Unity.RenderPipelines.Universal.Editor::UnityEditor.Rendering.Universal.AssetVersion
version: 10

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b908b9053476d604fae11ed6727c9902
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,141 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-763135438911210145
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: Unity.RenderPipelines.Universal.Editor::UnityEditor.Rendering.Universal.AssetVersion
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: Rigidbody
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _SPECULARHIGHLIGHTS_OFF
m_InvalidKeywords:
- _GLOSSYREFLECTIONS_OFF
m_LightmapFlags: 4
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: 0}
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}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
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}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
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
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 1
- _Glossiness: 0
- _GlossyReflections: 0
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 0
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _UVSec: 0
- _WorkflowMode: 1
- _XRMotionVectorsPass: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 0.8301887, g: 0.8301887, b: 0.8301887, a: 1}
- _Color: {r: 0.8301887, g: 0.8301887, b: 0.8301887, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e26b4c54b2b9d934e9bbba88b5f9b449
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,139 @@
%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: Rope
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
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: 0}
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}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 4, 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}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
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
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 1
- _Glossiness: 0
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _UVSec: 0
- _WorkflowMode: 1
- _XRMotionVectorsPass: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 0.83, g: 0.5958974, b: 0.36179486, a: 1}
- _Color: {r: 0.83, g: 0.5958974, b: 0.36179483, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1
--- !u!114 &8466111474512429427
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: Unity.RenderPipelines.Universal.Editor::UnityEditor.Rendering.Universal.AssetVersion
version: 10

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 189732c736fdb544f98524f96c34aff6
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,84 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Sky
m_Shader: {fileID: 106, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _SUNDISK_HIGH_QUALITY
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
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}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _AtmosphereThickness: 1
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _Exposure: 1.3
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SunDisk: 2
- _SunSize: 0.04
- _SunSizeConvergence: 5
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _GroundColor: {r: 0.51139194, g: 0.6415094, b: 0.55893487, a: 1}
- _SkyTint: {r: 0.5, g: 0.5, b: 0.5, a: 1}

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8fe2b67874cb22f43800c75dcf38673f
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,142 @@
%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: TargetIndicator
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
- _SPECULARHIGHLIGHTS_OFF
m_InvalidKeywords:
- _GLOSSYREFLECTIONS_OFF
m_LightmapFlags: 4
m_EnableInstancingVariants: 1
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap:
RenderType: Opaque
disabledShaderPasses:
- MOTIONVECTORS
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 0}
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}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
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}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
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
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 1
- _Glossiness: 0
- _GlossyReflections: 0
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0
- _SmoothnessTextureChannel: 1
- _SpecularHighlights: 0
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _UVSec: 0
- _WorkflowMode: 1
- _XRMotionVectorsPass: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 0, b: 0, a: 1}
- _Color: {r: 1, g: 0, b: 0, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1
--- !u!114 &2538396416694341757
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: Unity.RenderPipelines.Universal.Editor::UnityEditor.Rendering.Universal.AssetVersion
version: 10

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f1f2a238089ca461f9383525476c3a2b
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c7d88827e637e814c9839af75749cce3
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@@ -0,0 +1,94 @@
fileFormatVersion: 2
guid: dc3ad6005b4f0514982b05eb88b9ed3f
ModelImporter:
serializedVersion: 25
internalIDToNameTable: []
externalObjects: {}
materials:
importMaterials: 0
materialName: 0
materialSearch: 1
materialLocation: 1
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0
resampleCurves: 1
optimizeGameObjects: 0
motionNodeName:
rigImportErrors:
rigImportWarnings:
animationImportErrors:
animationImportWarnings:
animationRetargetingWarnings:
animationDoRetargetingWarnings: 0
importAnimatedCustomProperties: 0
importConstraints: 0
animationCompression: 1
animationRotationError: 0.5
animationPositionError: 0.5
animationScaleError: 0.5
animationWrapMode: 0
extraExposedTransformPaths: []
extraUserProperties: []
clipAnimations: []
isReadable: 0
meshes:
lODScreenPercentages: []
globalScale: 1
meshCompression: 0
addColliders: 0
useSRGBMaterialColor: 0
importVisibility: 1
importBlendShapes: 1
importCameras: 1
importLights: 1
swapUVChannels: 0
generateSecondaryUV: 0
useFileUnits: 1
keepQuads: 0
weldVertices: 1
preserveHierarchy: 0
skinWeightsMode: 0
maxBonesPerVertex: 4
minBoneWeight: 0.001
meshOptimizationFlags: -1
indexFormat: 0
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVPackMargin: 4
useFileScale: 1
tangentSpace:
normalSmoothAngle: 60
normalImportMode: 0
tangentImportMode: 3
normalCalculationMode: 4
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
blendShapeNormalImportMode: 1
normalSmoothingSource: 0
referencedClips: []
importAnimation: 0
copyAvatar: 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:
hasTranslationDoF: 0
hasExtraRoot: 0
skeletonHasParents: 1
lastHumanDescriptionAvatarSource: {instanceID: 0}
animationType: 0
humanoidOversampling: 1
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,123 @@
using UnityEngine;
using Unity.Mathematics;
namespace NBF.Example
{
[RequireComponent(typeof(Rigidbody))]
public class RopeBridgePlank : MonoBehaviour
{
public Rope ropeLeft;
public Rope ropeRight;
public float extentLeft = -0.5f;
public float extentRight = 0.5f;
public float extentPivot = 0.5f;
[Tooltip("A measure of the longitudal stiffness of the plank. That is, how quickly should the particles on the opposite ropes move to the correct distance between them.")]
[Range(0.0f, 1.0f)] public float longitudalStiffness = 0.25f;
public float restingRigidbodyMassMultiplier = 5.0f;
protected Rigidbody rb;
protected int particleLeft;
protected int particleRight;
protected int particlePivotLeft;
protected int particlePivotRight;
protected float distance;
protected float frameTotalMass;
public void Start()
{
rb = GetComponent<Rigidbody>();
if (rb != null)
{
rb.isKinematic = true;
}
var pointOnBodyLeft = transform.TransformPoint(Vector3.right * extentLeft);
var pointOnBodyRight = transform.TransformPoint(Vector3.right * extentRight);
var pointOnBodyPivot = transform.TransformPoint(Vector3.forward * extentPivot);
if (ropeLeft != null)
{
ropeLeft.GetClosestParticle(pointOnBodyLeft, out particleLeft, out float distance);
ropeLeft.GetClosestParticle(pointOnBodyPivot, out particlePivotLeft, out distance);
}
if (ropeRight != null)
{
ropeRight.GetClosestParticle(pointOnBodyRight, out particleRight, out float distance);
ropeRight.GetClosestParticle(pointOnBodyPivot, out particlePivotRight, out distance);
}
if (ropeLeft != null && ropeRight != null)
{
distance = math.distance(ropeLeft.GetPositionAt(particleLeft), ropeRight.GetPositionAt(particleRight));
}
}
public void FixedUpdate()
{
if (rb == null)
{
return;
}
if (ropeLeft == null || ropeRight == null)
{
rb.isKinematic = false;
return;
}
var left = ropeLeft.GetPositionAt(particleLeft);
var right = ropeRight.GetPositionAt(particleRight);
var pivot = (ropeLeft.GetPositionAt(particlePivotLeft) + ropeRight.GetPositionAt(particlePivotRight)) * 0.5f;
left.KeepAtDistance(ref right, distance, longitudalStiffness);
var middle = (left + right) * 0.5f;
rb.MoveRotation(Quaternion.LookRotation(pivot - middle, Vector3.Cross(pivot - middle, right - left)));
rb.MovePosition((Vector3)middle - transform.TransformVector(Vector3.right * (extentLeft + extentRight) * 0.5f));
ropeLeft.SetPositionAt(particleLeft, left);
ropeRight.SetPositionAt(particleRight, right);
var massMultiplier = 1.0f + frameTotalMass * restingRigidbodyMassMultiplier;
frameTotalMass = 0.0f;
if (ropeLeft.GetMassMultiplierAt(particleLeft) > 0.0f)
{
ropeLeft.SetMassMultiplierAt(particleLeft, massMultiplier);
}
if (ropeRight.GetMassMultiplierAt(particleRight) > 0.0f)
{
ropeRight.SetMassMultiplierAt(particleRight, massMultiplier);
}
}
public void OnCollisionStay(Collision collision)
{
if (collision.rigidbody != null)
{
frameTotalMass += collision.rigidbody.mass;
}
}
#if UNITY_EDITOR
public void OnDrawGizmosSelected()
{
var pointOnBodyLeft = transform.TransformPoint(Vector3.right * extentLeft);
var pointOnBodyRight = transform.TransformPoint(Vector3.right * extentRight);
var pointOnBodyPivot = transform.TransformPoint(Vector3.forward * extentPivot);
Gizmos.color = Color.red;
Gizmos.DrawWireSphere(pointOnBodyLeft, 0.05f);
Gizmos.DrawWireSphere(pointOnBodyRight, 0.05f);
Gizmos.DrawLine(pointOnBodyLeft, pointOnBodyRight);
Gizmos.color = Color.blue;
Gizmos.DrawWireSphere(pointOnBodyPivot, 0.05f);
Gizmos.DrawLine(pointOnBodyLeft, pointOnBodyPivot);
Gizmos.DrawLine(pointOnBodyRight, pointOnBodyPivot);
}
#endif
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 1a91ac0b60b8b4d4eba00ef9563d2003
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: de6eaa42470305f4387d207e869cac1e
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 3feeca0c11fd0d84aa1834e0e22da648
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,92 @@
fileFormatVersion: 2
guid: 81c0b82e5d054694c950a9710e93c3ca
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 1
seamlessCubemap: 1
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 2
aniso: 0
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 2
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 100
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: bdff8c3d11d364e329c121bae08cb6ab
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,23 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace NBF.Example
{
public class BackAndForthMovement : MonoBehaviour
{
public Vector3 amount = new Vector3(2.0f, 0.0f, 0.0f);
protected Vector3 startPos;
public void Start()
{
startPos = transform.position;
}
public void Update()
{
transform.position = startPos + amount * Mathf.Sin(Time.time);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e4453a595a14042518c9341023037a8d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,89 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace NBF.Example
{
public class DynamicAttach : MonoBehaviour
{
public Material ropeMaterial;
public Vector3 attachPoint;
public Transform target;
public Vector3 targetAttachPoint;
public SimpleRopeInteraction ropeInteraction;
protected GameObject ropeObject;
protected Rect guiRect = new Rect(Screen.width - 210, 10, 200, 0);
public void Detach()
{
if (ropeObject)
{
Destroy(ropeObject);
}
ropeObject = null;
if (ropeInteraction)
{
ropeInteraction.ropes.Clear();
}
}
public void Attach()
{
Detach();
ropeObject = new GameObject();
ropeObject.name = "Rope";
var start = transform.TransformPoint(attachPoint);
var end = target.TransformPoint(targetAttachPoint);
var rope = ropeObject.AddComponent<Rope>();
rope.material = ropeMaterial;
rope.spawnPoints.Add(ropeObject.transform.InverseTransformPoint(start));
rope.spawnPoints.Add(ropeObject.transform.InverseTransformPoint(end));
var conn0 = ropeObject.AddComponent<RopeConnection>();
conn0.type = RopeConnectionType.PinRopeToTransform;
conn0.ropeLocation = 0.0f;
conn0.transformSettings.transform = transform;
conn0.localConnectionPoint = attachPoint;
var conn1 = ropeObject.AddComponent<RopeConnection>();
conn1.type = RopeConnectionType.PinRopeToTransform;
conn1.ropeLocation = 1.0f;
conn1.transformSettings.transform = target;
conn1.localConnectionPoint = targetAttachPoint;
if (ropeInteraction)
{
ropeInteraction.ropes.Add(rope);
}
}
protected void Window(int id)
{
if (GUILayout.Button("Attach"))
{
Attach();
}
if (GUILayout.Button("Detach"))
{
Detach();
}
GUI.enabled = false;
GUILayout.Label("Instructions: Use the buttons above to dynamically attach and detach a rope from the scene.");
GUI.enabled = true;
}
public void OnGUI()
{
guiRect = GUILayout.Window(1, guiRect, Window, "Dynamic attach");
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 6ae913a7495f9445da3517bf946c1e9f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 77ae7d5711108d246af147db29624f40
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,689 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 10
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 3
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 13
m_BakeOnSceneLoad: 1
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
serializedVersion: 12
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAmbientOcclusion: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 512
m_PVRBounces: 2
m_PVREnvironmentSampleCount: 256
m_PVREnvironmentReferencePointCount: 2048
m_PVRFilteringMode: 1
m_PVRDenoiserTypeDirect: 1
m_PVRDenoiserTypeIndirect: 1
m_PVRDenoiserTypeAO: 1
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVREnvironmentMIS: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 112000000, guid: 6845e77b07ddf4e48936c563b2cb9c9a, type: 2}
m_LightingSettings: {fileID: 1476623454}
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 3
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
buildHeightMesh: 0
maxJobWorkers: 0
preserveTilesOutsideBounds: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &609470541
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 609470546}
- component: {fileID: 609470545}
- component: {fileID: 609470544}
- component: {fileID: 609470543}
- component: {fileID: 609470542}
m_Layer: 0
m_Name: Sphere
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &609470542
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 609470541}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e4453a595a14042518c9341023037a8d, type: 3}
m_Name:
m_EditorClassIdentifier:
amount: {x: 2, y: 0, z: 0}
--- !u!135 &609470543
SphereCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 609470541}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Radius: 0.5
m_Center: {x: 0, y: 0, z: 0}
--- !u!23 &609470544
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 609470541}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_ForceMeshLod: -1
m_MeshLodSelectionBias: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 96e3708e6a4c8cd41adfeab52a6c8498, type: 3}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_GlobalIlluminationMeshLod: 0
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!33 &609470545
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 609470541}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &609470546
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 609470541}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.5, y: 0.5, z: 0.5}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &823804522
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 823804525}
- component: {fileID: 823804524}
- component: {fileID: 823804526}
- component: {fileID: 823804523}
m_Layer: 0
m_Name: Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &823804523
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 823804522}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0383ecb7d718b4bd682ab0d0f68bce82, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!20 &823804524
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 823804522}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_Iso: 200
m_ShutterSpeed: 0.005
m_Aperture: 16
m_FocusDistance: 10
m_FocalLength: 50
m_BladeCount: 5
m_Curvature: {x: 2, y: 11}
m_BarrelClipping: 0.25
m_Anamorphism: 0
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &823804525
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 823804522}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &823804526
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 823804522}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d741c2b5cb0190448822896128d51f8a, type: 3}
m_Name:
m_EditorClassIdentifier:
pickedMesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
targetMesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
pickedMaterial: {fileID: 2100000, guid: d35e58ef8c9e0e1429517c447ba73497, type: 2}
targetMaterial: {fileID: 2100000, guid: f1f2a238089ca461f9383525476c3a2b, type: 2}
maxPickDistance: 2
maxImpulseStrength: 3
leverage: 10
splitPickedRopeOnKey: 32
ropes: []
--- !u!1 &858275400
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 858275404}
- component: {fileID: 858275403}
- component: {fileID: 858275402}
- component: {fileID: 858275401}
- component: {fileID: 858275405}
m_Layer: 0
m_Name: Attacher
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!65 &858275401
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 858275400}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!23 &858275402
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 858275400}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_ForceMeshLod: -1
m_MeshLodSelectionBias: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 96e3708e6a4c8cd41adfeab52a6c8498, type: 3}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_GlobalIlluminationMeshLod: 0
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!33 &858275403
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 858275400}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &858275404
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 858275400}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 2, z: 0}
m_LocalScale: {x: 2, y: 0.5, z: 0.5}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &858275405
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 858275400}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6ae913a7495f9445da3517bf946c1e9f, type: 3}
m_Name:
m_EditorClassIdentifier:
ropeMaterial: {fileID: 2100000, guid: 189732c736fdb544f98524f96c34aff6, type: 2}
attachPoint: {x: 0, y: -0.5, z: 0}
target: {fileID: 609470546}
targetAttachPoint: {x: 0, y: 0.5, z: 0}
ropeInteraction: {fileID: 823804526}
--- !u!850595691 &1476623454
LightingSettings:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Settings.lighting
serializedVersion: 9
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 0
m_RealtimeEnvironmentLighting: 1
m_BounceScale: 1
m_AlbedoBoost: 1
m_IndirectOutputScale: 1
m_UsingShadowmask: 1
m_BakeBackend: 1
m_LightmapMaxSize: 1024
m_LightmapSizeFixed: 0
m_UseMipmapLimits: 1
m_BakeResolution: 40
m_Padding: 2
m_LightmapCompression: 3
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAO: 0
m_MixedBakeMode: 2
m_LightmapsBakeMode: 1
m_FilterMode: 1
m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0}
m_ExportTrainingData: 0
m_EnableWorkerProcessBaking: 1
m_TrainingDataDestination: TrainingData
m_RealtimeResolution: 2
m_ForceWhiteAlbedo: 0
m_ForceUpdates: 0
m_PVRCulling: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 512
m_PVREnvironmentSampleCount: 256
m_PVREnvironmentReferencePointCount: 2048
m_LightProbeSampleCountMultiplier: 4
m_PVRBounces: 2
m_PVRMinBounces: 2
m_PVREnvironmentImportanceSampling: 1
m_PVRFilteringMode: 1
m_PVRDenoiserTypeDirect: 1
m_PVRDenoiserTypeIndirect: 1
m_PVRDenoiserTypeAO: 1
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_RespectSceneVisibilityWhenBakingGI: 0
--- !u!1 &1579321095
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1579321097}
- component: {fileID: 1579321096}
- component: {fileID: 1579321098}
m_Layer: 0
m_Name: Light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!108 &1579321096
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1579321095}
m_Enabled: 1
serializedVersion: 11
m_Type: 1
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
m_Intensity: 1
m_Range: 10
m_SpotAngle: 30
m_InnerSpotAngle: 21.80208
m_CookieSize: 10
m_Shadows:
m_Type: 2
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_CullingMatrixOverride:
e00: 1
e01: 0
e02: 0
e03: 0
e10: 0
e11: 1
e12: 0
e13: 0
e20: 0
e21: 0
e22: 1
e23: 0
e30: 0
e31: 0
e32: 0
e33: 1
m_UseCullingMatrixOverride: 0
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingLayerMask: 1
m_Lightmapping: 4
m_LightShadowCasterMode: 0
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
m_UseBoundingSphereOverride: 0
m_UseViewFrustumForShadowCasterCull: 1
m_ForceVisible: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
m_LightUnit: 1
m_LuxAtDistance: 1
m_EnableSpotReflector: 1
--- !u!4 &1579321097
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1579321095}
serializedVersion: 2
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
--- !u!114 &1579321098
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1579321095}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.UniversalAdditionalLightData
m_UsePipelineSettings: 1
m_AdditionalLightsShadowResolutionTier: 2
m_CustomShadowLayers: 0
m_LightCookieSize: {x: 1, y: 1}
m_LightCookieOffset: {x: 0, y: 0}
m_SoftShadowQuality: 0
m_RenderingLayersMask:
serializedVersion: 0
m_Bits: 1
m_ShadowRenderingLayersMask:
serializedVersion: 0
m_Bits: 1
m_Version: 4
m_LightLayerMask: 1
m_ShadowLayerMask: 1
m_RenderingLayers: 1
m_ShadowRenderingLayers: 1
--- !u!1660057539 &9223372036854775807
SceneRoots:
m_ObjectHideFlags: 0
m_Roots:
- {fileID: 823804525}
- {fileID: 1579321097}
- {fileID: 858275404}
- {fileID: 609470546}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: b95b6dec15a3f486eb7218c14664c415
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6845e77b07ddf4e48936c563b2cb9c9a
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 112000000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b2df19aa793a345a69e9944050057067
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,139 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-5372188565135992000
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: Unity.RenderPipelines.Universal.Editor::UnityEditor.Rendering.Universal.AssetVersion
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: Ball
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
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: b03a2c419a85b4840a89514be8b05bfd, 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}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
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: 2800000, guid: b03a2c419a85b4840a89514be8b05bfd, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
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
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 1
- _Glossiness: 0
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _UVSec: 0
- _WorkflowMode: 1
- _XRMotionVectorsPass: 1
- _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.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 05dfe89e2a8b04019aa2fd84b55f8c8e
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 11c2fb45774632e45a97d249b1c25cbd
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 235f1ac58214e4e8aa0911cc8cab844e
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: fb17f1c0387cfc242b64938cee6c6079
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 112000000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,139 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-8110553798369416356
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: Unity.RenderPipelines.Universal.Editor::UnityEditor.Rendering.Universal.AssetVersion
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: Ground
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
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: 0}
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}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
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}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
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
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 1
- _Glossiness: 1
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 1
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _UVSec: 0
- _WorkflowMode: 1
- _XRMotionVectorsPass: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 0.2002492, g: 0.29765657, b: 0.5660378, a: 1}
- _Color: {r: 0.20024917, g: 0.29765654, b: 0.5660378, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 1ed915716adf4441cbc55196b3610a75
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,31 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Spawner : MonoBehaviour
{
public Transform prefab;
public float randomRange = 0.5f;
public float timeToSpawn = 4.0f;
private float timer;
public void Update()
{
timer += Time.deltaTime;
if (timer >= timeToSpawn)
{
timer = 0.0f;
var obj = Instantiate(prefab, transform.position + Random.insideUnitSphere * randomRange, transform.rotation);
obj.gameObject.SetActive(true);
}
}
public void OnDrawGizmos()
{
Gizmos.color = Color.yellow;
Gizmos.DrawWireSphere(transform.position, randomRange);
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d7f10005d854a49a4b3371d4701441fd
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 56f8fa0293ae146a0a38a90388439416
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b31243ee8abab458088c6fccccfb5c58
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,21 @@
using UnityEngine;
using UnityEditor;
using UnityEditor.SceneManagement;
using System.Linq;
namespace NBF
{
[CustomEditor(typeof(SimpleRopeInteraction))]
public class SimpleRopeInteractionEditor : Editor
{
public override void OnInspectorGUI()
{
DrawDefaultInspector();
if (GUILayout.Button("Find ropes in current scene"))
{
((SimpleRopeInteraction)target).ropes = StageUtility.GetMainStageHandle().FindComponentsOfType<Rope>().ToList();
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 690ba92ccc18546d09d046bf31fa4887
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,171 @@
using UnityEngine;
using Unity.Mathematics;
using System.Collections.Generic;
namespace NBF
{
public class SimpleRopeInteraction : MonoBehaviour
{
[Tooltip("The mesh to show on the picked particle position. May be empty.")]
public Mesh pickedMesh;
[Tooltip("The mesh to show on the target position. May be empty.")]
public Mesh targetMesh;
[Tooltip("The material to use for the picked mesh")]
public Material pickedMaterial;
[Tooltip("The material to use for the target mesh")]
public Material targetMaterial;
[Tooltip("The maximum distance a rope can be picked from")]
public float maxPickDistance = 2.0f;
[Tooltip("The max allowable impulse strength to use. If zero, no limit is applied.")]
public float maxImpulseStrength = 3.0f;
[Tooltip("The mass multiplier to apply to the pulled rope particle. Increasing the mass multiplier for a particle increases its influence on neighboring particles. As this script pulls a single particle at a time only, it is beneficial to set the mass multiplier above 1 to improve the stability of the overall rope simulation.")]
public float leverage = 10.0f;
[Tooltip("The keyboard key to use to split a picked rope. May be set to None to disable this feature.")]
public KeyCode splitPickedRopeOnKey = KeyCode.Space;
[Tooltip("The list of ropes that may be picked")]
public List<Rope> ropes;
protected bool ready;
protected Rope rope;
protected int particle;
protected float distance;
protected float3 pickedPosition;
protected float3 targetPosition;
public void SplitPickedRope()
{
if (rope == null)
{
return;
}
ropes.Remove(rope);
var newRopes = new Rope[2];
rope.SplitAt(particle, newRopes);
if (newRopes[0] != null) ropes.Add(newRopes[0]);
if (newRopes[1] != null) ropes.Add(newRopes[1]);
rope = null;
}
protected Rope GetClosestRope(Ray ray, out int closestParticleIndex, out float closestDistanceAlongRay)
{
closestParticleIndex = -1;
closestDistanceAlongRay = 0.0f;
var closestRopeIndex = -1;
var closestDistance = 0.0f;
for (int i = 0; i < ropes.Count; i++)
{
ropes[i].GetClosestParticle(ray, out int particleIndex, out float distance, out float distanceAlongRay);
if (distance > maxPickDistance)
{
continue;
}
if (closestRopeIndex != -1 && distance > closestDistance)
{
continue;
}
closestRopeIndex = i;
closestParticleIndex = particleIndex;
closestDistance = distance;
closestDistanceAlongRay = distanceAlongRay;
}
return closestRopeIndex != -1 ? ropes[closestRopeIndex] : null;
}
public void FixedUpdate()
{
var ray = Camera.main.ScreenPointToRay(Input.mousePosition);
if (Input.GetMouseButton(0))
{
// Mouse down
if (ready && rope == null)
{
// Not pulling a rope, find the closest one to the mouse
var closestRope = GetClosestRope(ray, out int closestParticleIndex, out float closestDistanceAlongRay);
if (closestRope != null && closestParticleIndex != -1 && closestRope.GetMassMultiplierAt(closestParticleIndex) > 0.0f)
{
// Found a rope and particle on the rope, start pulling that particle!
rope = closestRope;
particle = closestParticleIndex;
distance = closestDistanceAlongRay;
ready = false;
}
}
}
else
{
// Mouse up
if (rope != null)
{
// Stop pulling the rope
rope.SetMassMultiplierAt(particle, 1.0f);
rope = null;
}
}
if (rope != null)
{
// We are pulling the rope
// Move the rope particle to the mouse position on the grab-plane
pickedPosition = rope.GetPositionAt(particle);
targetPosition = ray.GetPoint(distance);
if (maxImpulseStrength == 0.0f)
{
rope.SetMassMultiplierAt(particle, 0.0f);
}
else
{
rope.SetMassMultiplierAt(particle, leverage);
}
rope.SetPositionAt(particle, targetPosition, maxImpulseStrength);
// Split the rope on key if keybind is set
if (Input.GetKey(splitPickedRopeOnKey))
{
SplitPickedRope();
}
}
}
public void Update()
{
if (!Input.GetMouseButton(0))
{
ready = true;
}
if (rope != null)
{
if (pickedMesh != null && pickedMaterial != null)
{
Graphics.DrawMesh(pickedMesh, Matrix4x4.TRS(pickedPosition, Quaternion.identity, Vector3.one * 0.25f), pickedMaterial, 0);
}
if (targetMesh != null && targetMaterial != null)
{
Graphics.DrawMesh(targetMesh, Matrix4x4.TRS(targetPosition, Quaternion.identity, Vector3.one * 0.25f), targetMaterial, 0);
}
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d741c2b5cb0190448822896128d51f8a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,57 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace NBF.Example
{
[RequireComponent(typeof(SimpleRopeInteraction))]
public class SimpleRopeInteractionGUI : MonoBehaviour
{
protected float desiredMaxImpulseStrength;
protected Rect guiRect = new Rect(10, 10, 200, 0);
public void Start()
{
desiredMaxImpulseStrength = GetComponent<SimpleRopeInteraction>().maxImpulseStrength;
}
public void Window(int id)
{
var interact = GetComponent<SimpleRopeInteraction>();
bool isLimiting = interact.maxImpulseStrength > 0.0f;
bool shouldLimit = GUILayout.Toggle(isLimiting, "Limit max impulse strength");
if (isLimiting != shouldLimit)
{
Event.current.Use();
if (shouldLimit)
{
interact.maxImpulseStrength = desiredMaxImpulseStrength;
}
else
{
desiredMaxImpulseStrength = interact.maxImpulseStrength;
interact.maxImpulseStrength = 0.0f;
}
}
var limitString = shouldLimit ? interact.maxImpulseStrength.ToString("0.0") + " Ns" : "Infinite";
GUILayout.Label("Max impulse strength: " + limitString);
interact.maxImpulseStrength = GUILayout.HorizontalSlider(interact.maxImpulseStrength, 0.0f, 10.0f);
GUI.enabled = false;
GUILayout.Label("Instructions: Use the left mouse button to interact with the ropes in the scene. While holding on to a rope using the mouse, press <SPACE> on the keyboard to cut it at the held position.");
GUI.enabled = true;
}
public void OnGUI()
{
guiRect = GUILayout.Window(0, guiRect, Window, "Interaction settings");
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 0383ecb7d718b4bd682ab0d0f68bce82
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,327 @@
<meta charset="utf-8">
**Rope Toolkit**
version 2.2.3
The Rope Toolkit brings *stable* and *fast* rope physics to your project. The rope component can be used to simulate simple wires or more advanced setups with pulleys and weights that require active collision detection. The bundled example scenes show how to connect the rope up to simulate cranes, rope bridges, swings and a boxing ring.
The rope component is written with performance in mind and many compute intensive tasks are handled by [Unity jobs on separate threads accelerated using the Burst compiler](https://unity.com/dots). As a result, the toolkit has excellent performance on mobile devices.
Overview
========
(##) Features
* Stable & fast rope physics
* Mobile friendly!
* Many tweakable user parameters
* Ability to dynamically split ropes using the SplitAt() method
* 4 different rope connection types allow interaction with the rest of the scene
- Pin Rope To Transform
- Pin Transform To Rope
- Pull Rigidbody To Rope
- Two Way Coupling Between Rigidbody And Rope
* Scene view handles for adjusting rope spawn curve
* High performance is achieved using Unity jobs and the Burst compiler
- Typical performance for the example scene with collisions enabled:
- ~0.2 ms spent in job threads
- ~0.7 ms spent on the main thread
- Typical performance for the example scene with collisions disabled:
- ~0.15 ms spent in job threads
- ~0.35 ms spent on the main thread
* Full source code
* Example scenes
- Main
- Shows how ropes and rigidbodies can be connected together in a typical scene
- Use the mouse to interact with the rope and the Space key to split ropes being interacted with
- DynamicAttach
- Shows how to attach and detach ropes using the scripts
- BoxingRing
- Shows how ropes and rigidbodies can influence each other through collisions
(##) Current Limitations
* Collision support for convex Mesh, Box, Sphere and Capsule colliders only
* Scripting knowledge required for advanced rope interactions
Requirements
============
* Burst 1.1.2 or above
Components
==========
(##) Rope
This is the main component that simulates and renders the rope
(##) RopeConnection
This component connects the rope it is attached to to a transform or rigidbody component in the scene. The resulting behaviour depends on what type of connection is used:
Pin Rope To Transform
: Pins a point on the rope to a point on a transform. The transform can move freely and the rope will always follow along.
Pin Transform To Rope
: Pins a point on a transform to a point on the rope. The rope will move freely and the transform will always follow along. This connection takes control of the transform.
Pull Rigidbody To Rope
: Pulls a point on a rigidbody towards a point on the rope by applying velocity changes to the rigidbody. This connection does not take control of the rigidbody, other forces and constraints are respected.
Two Way Coupling Between Rigidbody And Rope
: Introduces a two-way coupling between the rope and a rigidbody. The rope will react to the rigidbody and feedback impulses back to the rigidbody allowing for complicated setups such as the crane in the example scene. Care must be taken so that the rope `mass per meter` value is comparable to the masses of connected rigidbodies, otherwise the simulation may blow up. This connection does not take control of the rigidbody, other forces and constraints are respected.
Instructions
============
(##) First time use in a new project
The **Rope Toolkit requires the Burst package (by Unity) to function properly**. Make sure to import it using the Package Manager before importing the Rope Toolkit into your project. Follow these steps to import the Burst package:
1. Choose `Window -> Package Manager` from the menu bar
2. In the window that appears, select `Unity Registry` from the drop-down menu next to the `+` sign
3. In the list to the left, select the `Burst` package and press `Install` in the lower right corner
4. The Rope Toolkit can be found in the `My Assets` drop-down menu of the Package Manager (instead of `Unity Registry` in step 2). Import it in the same way as the Burst package.
(##) Workflow
1. Create an empty game object
2. Attach the Rope script to it
3. Add a few spawn points either using the scene view buttons (`Push spawn point`, `Pop spawn point`) or by manually changing the `Spawn Points` property in the inspector
4. Move around the spawn points using the scene view handles
- Hold down left `Shift` to switch to the ordinary transform tool for more fine-grained control
5. Assign a material to the `Material` property of the rope
- Optionally adjust the `Tiling` of the material
- 1 scene unit is mapped to 1 texture tile (x-axis) lengt-wise
- 1 texture tile (y-axis) wraps around the rope curlwise
6. Optionally attach any number of `RopeConnection` components to the rope
- Set the `Body` or `Transform` reference to the object the rope should be connected to
- Set the `Local Connection Point` to be the point in object local space to which the rope should be attached
(##) General tips
* Examine the example scenes to get an understanding for how to connect the rope in a typical scene
* Change the tweakable parameters when in play-mode to get a feel for what they do
* There are tooltips for all tweakable parameters
* Look at the helper scripts to get an understanding for how one can interact with the rope using custom scripts
(##) Performance tips
* Avoid enabling collisions unless absolutely necessary
* Disable simulation of ropes that are far away or out of view using a custom script (they will still be rendered)
* Only call rope methods in a custom script from `FixedUpdate()` or `LateUpdate()`
(##) Collisions
Collision detection is very performance intensive, as all physics queries have to be performed on the main thread. Aim to keep the `Stride` value as high as possible to reduce the amount of queries. Another approach is to disable simulation of ropes that require collisions more aggressively and keep the number of active ropes with collisions enabled to a bare minimum, even though the total number in the scene is high.
(##) Stiffness
Rope stiffness depends on many factors: the `Stiffness` value of the rope, the `Resolution` of the rope, the `Substeps` and `Solver Iterations` of the rope and finally the `Fixed Timestep` value in `Project Settings` -> `Time`. To achieve a stiff rope, choose a high stiffness value, a low resolution value, many substeps and solver iterations and a low fixed time step.
Scripting interface
===================
The rope is simuated using a set of inter-connected particles (visuaized by spheres when selecting a rope in edit-mode). Since the physics simulation is inherently stable, one can move around these particles in almost any way imaginable. This enables many custom setups such as the rope bridge in the example scene (see `RopeBridgePlank.cs`).
(##) Interface
To fascilitate custom interactions with ropes, the rope component exposes a small scripting interface. The table below shows the properties and methods available. For more information on a particular property or method, see the description in the source file.
`measurements`
: Returns the measurements of the rope. The measurements remain constant after the rope is first initialized.
`currentBounds`
: The current world-space bounds of the visual mesh
`PushSpawnPoint()`
: Adds a new spawn point to the rope. May be called from edit-mode.
`PopSpawnPoint()`
: Removes the last spawn point of the rope. May be called from edit-mode.
`GetParticleIndexAt(distance)`
: Returns the index of the simulation particle at a particular distance along the curve of the rope
`GetScalarDistanceAt(particleIndex)`
: Returns the scalar distance along the curve of the rope that a particular simulation particle is located at. The scalar distance is a value between 0 and 1. The lengthMultiplier is not taken into account. To get the distance along the rope in world space, multiply the scalar distance by the realCurveLength measurement.
`GetPositionAt(particleIndex)`
: Returns the current position of a particular simulation particle
`SetPositionAt(particleIndex, position)`
: Sets the position of a particular simulation particle
`SetPositionAt(particleIndex, position, maxImpulseStrength)`
: Sets the position of a particular simulation particle while at the same time making sure not to apply a larger impulse than the specified max impulse strength. If the max impulse strength is exceeded, the particle will be moved part-way towards the target position. This method is useful when limiting the strength of helper scripts that interact with the rope.
`GetVelocityAt(particleIndex)`
: Returns the current velocity of a particular simulation particle
`SetVelocityAt(particleIndex, velocity)`
: Sets the velocity of a particular simulation particle
`GetMassMultiplierAt(particleIndex)`
: Returns the mass multiplier of a particular simulation particle. This value can be used to increase or decrease a particle's influence on neighboring particles. A value of 0 will make the particle immovable. A value of 2 will make the particle twice as heavy as its neighbors. The default value is 1.
`SetMassMultiplierAt(particleIndex, value)`
: Sets the mass multiplier of a particular simulation particle. This value can be used to increase or decrease a particle's influence on neighboring particles. A value of 0 will make the particle immovable. A value of 2 will make the particle twice as heavy as its neighbors. The default value is 1.
`GetClosestParticle(point, out particleIndex, out distance)`
: Finds the simulation particle closest to a particular point
`GetClosestParticle(ray, out particleIndex, out distance, out distanceAlongRay)`
: Finds the simulation particle closest to a particular ray
`RegisterRigidbodyConnection(particleIndex, rigidbody, rigidbodyDamping, pointOnBody, stiffness)`
: Registers a rigidbody connection for the next simulation frame. A rigidbody connection is a two-way coupling of a simulation particle to a traditional rigidbody. Make sure to call this method from FixedUpdate(). Any simulation particle involved in a rigidbody connection will get its mass multiplier reset to 1 at the end of the simulation frame.
`ResetToSpawnCurve()`
: Resets the rope to its original shape relative to the current transform. Useful when activating a pooled game object that is deactivated and re-activated instead of destroyed and instantiated.
`GetCurrentLength()`
: Computes the current length of the rope. In contrast to the measurements.realCurveLength field, this value includes the stretching of the rope due to stress.
`SplitAt(particleIndex, outNewRopes)`
: Splits the rope at a specific simulation particle and returns the rope components of the newly instantiated game objects. Make sure that the supplied array has exactly 2 slots. A Unity message 'OnRopeSplit(Rope.OnSplitParams)' will be sent to each newly created rope.
(##) Execution order
Make sure the custom script runs before the custom execution order of `Rope.cs`, which defaults to 100. Calling rope methods from `Update()` or after the rope's `FixedUpdate()` will halt the main thread as it waits for the rope simulation jobs to complete. This destroys parallelism and performance.
(##) Example usage
```c#
using RopeToolkit;
public class RopeMover : MonoBehaviour
{
public Rope rope;
public void FixedUpdate()
{
if (rope == null)
{
return;
}
rope.SetMassMultiplierAt(0, 0.0f); // makes particle 0 immovable with respect to the simulation
rope.SetPositionAt(0, transform.position);
}
}
```
FAQ
===
Q: Why does a rigidbody with [a freeze rotation constraint](https://docs.unity3d.com/ScriptReference/Rigidbody-constraints.html) act strange when it is connected to a rope?
: A: This is caused by [a bug in Unity](https://fogbugz.unity3d.com/default.asp?1342781_6lnk429ujeergaf6).
Change log
==========
(##) v2.2.3
* Introduce a "max impulse strength" parameter to SetPositionAt() enabling an easy way to limit the pull strength of helper scripts (such as in the RopeMouseInteraction script)
(##) v2.2.2
* Fix bug where rope length was not preserved accurately when splitting the rope using SplitAt()
(##) v2.2.1
* Use game object layer for rendering
* Add shadow casting mode
* Add setting for using a custom gravity value or the global physics gravity
- **[ACTION REQUIRED]** Update any rope component that has the simulation.gravity property set to use the new simulation.useCustomGravity and simulation.customGravity properties instead
* Move custom mesh settings into their own category
- **[ACTION REQUIRED]** Update any rope component that uses a custom mesh to use the new customMesh category instead
* Add custom mesh scale override
* Add ability to stretch custom meshes instead of them moving too far apart when the rope is stretched
(##) v2.2.0
* Rename package from "Rope Minikit" to "Rope Toolkit" to reflect its fully featured state
- **[ACTION REQURED]** Any custom scripts must now reference the namespace `RopeToolkit`
* Add support for simulation substeps to enable stiffer ropes
- **[ACTION REQURED]** To not have to retweak rope properties in an existing project, set the simulation substeps property (found under `Rope/Simulation/Advanced`) to `1` after importing the new version of the toolkit
* Add ability for ropes to influence rigidbodies when collisions are enabled
- See the `Rope/Collisions/Influence Rigidbodies` property
* Add BoxingRing example scene to show how ropes can now push rigidbodies away
* Remove ability to move one end of a rope by updating its Transform component - use the RopeConnection component instead
- This introduced subtle bugs in certain situations
* Reorganize rope inspector view slightly
(##) v2.1.0
* Add interpolation property that may be used to smooth the motion of the rope
- This is especially useful when a low fixed update rate is used
- The behavior mimics the [RigidbodyInterpolation](https://docs.unity3d.com/ScriptReference/RigidbodyInterpolation.html) setting and has the following values
- None
- Interpolate
- Extrapolate
* Improve performance when generating rope geometry (by taking advantage of newer Unity APIs)
(##) v2.0.0
* Replace the RopePin and RopeRigidbodyConnection components with a single RopeConnection component and add 2 new connection types
- There are now 4 connection types:
- Pin Rope To Transform
- Pin Transform To Rope
- Pull Rigidbody To Rope
- Two Way Coupling Between Rigidbody And Rope
- Warning: This change breaks backwards compatibility!
* Add gravity property for setting the gravity vector on a per-rope basis
* Fix bug where wrong impulse function was used for rigidbody feedback
- Warning: This might require re-tweaking of the stiffness/damping values of your existing rope setups
* Fix bug where rigidbody rotational constraints would not be handled properly when connected to a rope
* Reskin example scene
* Switch to 3 digit semantic versioning
(##) v1.11
* More accurate rope length calculation on SplitAt()
* Fix bug where multiple ropes with custom meshes would allocate unnecessary memory
(##) v1.1
* Add support for dynamically splitting the rope using the new SplitAt() method
- Try it out in the example scene by grabbing a rope with the mouse pointer and pressing space before letting go!
* Add support for custom meshes that can be rendered instead of the default rope cylinder
- To illustrate this, the crane in the example scene now has a chain with links instead of a smooth rope
* Change RopePin and RopeRigidbodyConnection components to be lazily initialized
* Rename RopeMeasurements struct to Measurements and make it a sub-type of Rope
* Fix bug where toggling the simulation.enabled flag could result in an IndexOutOfBounds exception
(##) v1.03
* Fix bug where one end of the rope could be moved if it collided with something even though it was pinned down using a RopePin component
* Fix bug where one end of the rope would show more sag than the other end when the rope was being stretched
* Add Rope.GetCurrentLength() method
* The example scene rope material now uses an explicit texture as the built-in one previously used caused iOS builds to fail
(##) v1.02
* Add soft backdrop to example scene
(##) v1.01
* Fix rope enable/disable logic
* Add ResetToSpawnCurve() method
(##) v1.0
* Initial release
Contact
=======
Please let me know if you run into any problems when using the toolkit or if you have feedback on how I can improve it in the future. I am also interested in seeing projects that use any of my toolkits in practice!
Website: https://gustavolsson.com/
Contact: https://gustavolsson.com/contact/
Copyright 2025 Gustav Olsson
<!-- Markdeep: --><style class="fallback">body{visibility:hidden;white-space:pre;font-family:monospace}</style><script src="markdeep.min.js" charset="utf-8"></script><script src="https://casual-effects.com/markdeep/latest/markdeep.min.js" charset="utf-8"></script><script>window.alreadyProcessedMarkdeep||(document.body.style.visibility="visible")</script>

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 82f3b60f5fab61847b5d567d8c264192
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 9642f7274cbce494eac33c06ff0eb35a
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

1761
Assets/Scripts/ThirdParty/Rope/Rope.cs vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 325b217b839086b4ca705834516bc0d5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 100
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,258 @@
using UnityEngine;
using Unity.Mathematics;
namespace NBF
{
public enum RopeConnectionType : int
{
PinRopeToTransform = 0,
PinTransformToRope = 1,
PullRigidbodyToRope = 2,
TwoWayCouplingBetweenRigidbodyAndRope = 3,
}
[RequireComponent(typeof(Rope))]
public class RopeConnection : MonoBehaviour
{
protected static readonly Color[] colors = new Color[4]
{
new Color(0.69f, 0.0f, 1.0f), // purple
new Color(1.0f, 0.0f, 0.0f), // red
new Color(1.0f, 0.0f, 0.0f), // red
new Color(1.0f, 1.0f, 0.0f), // yellow
};
[System.Serializable]
public struct RigidbodySettings
{
[Tooltip("The rigidbody to connect to")]
public Rigidbody body;
[Tooltip("A measure of the stiffness of the connection. Lower values are usually more stable.")]
[Range(0.0f, 1.0f)] public float stiffness;
[Tooltip("The amount of the rigidbody velocity to remove when the impulse is from the rope is applied to the rigidbody")]
[Range(0.0f, 1.0f)] public float damping;
}
[System.Serializable]
public struct TransformSettings
{
[Tooltip("The transform to connect to")]
public Transform transform;
}
[DisableInPlayMode] public RopeConnectionType type;
[DisableInPlayMode, Range(0.0f, 1.0f)] public float ropeLocation;
public bool autoFindRopeLocation = false;
public RigidbodySettings rigidbodySettings = new RigidbodySettings()
{
stiffness = 0.1f,
damping = 0.1f,
};
public TransformSettings transformSettings = new TransformSettings()
{};
[Tooltip("The point in local object space to connect to")]
public float3 localConnectionPoint;
protected Rope rope;
protected int particleIndex;
public Component connectedObject
{
get
{
switch (type)
{
case RopeConnectionType.PinRopeToTransform:
case RopeConnectionType.PinTransformToRope: {
return transformSettings.transform;
}
case RopeConnectionType.PullRigidbodyToRope:
case RopeConnectionType.TwoWayCouplingBetweenRigidbodyAndRope: {
return rigidbodySettings.body;
}
default: {
return null;
}
}
}
}
public float3 connectionPoint
{
get
{
var obj = connectedObject;
if (obj)
{
return obj.transform.TransformPoint(localConnectionPoint);
}
else
{
return float3.zero;
}
}
}
public void Initialize(bool forceReset)
{
if (rope && !forceReset)
{
return;
}
rope = GetComponent<Rope>();
Debug.Assert(rope); // required component!
if (autoFindRopeLocation)
{
rope.GetClosestParticle(connectionPoint, out particleIndex, out float distance);
ropeLocation = rope.GetScalarDistanceAt(particleIndex);
}
else
{
var ropeDistance = ropeLocation * rope.measurements.realCurveLength;
particleIndex = rope.GetParticleIndexAt(ropeDistance);
}
}
public void OnRopeSplit(Rope.OnSplitParams p)
{
if (autoFindRopeLocation)
{
// There is no way to determine which side of the split this component was located, just remove it...
Destroy(this);
}
else
{
var idx = p.preSplitMeasurements.GetParticleIndexAt(ropeLocation * p.preSplitMeasurements.realCurveLength);
if (idx < p.minParticleIndex || idx > p.maxParticleIndex)
{
Destroy(this);
}
}
}
public void OnDisable()
{
if (rope && type == RopeConnectionType.PinRopeToTransform)
{
rope.SetMassMultiplierAt(particleIndex, 1.0f);
}
}
protected void EnforceConnection()
{
Initialize(false);
if (!rope || !connectedObject)
{
return;
}
switch (type)
{
case RopeConnectionType.PinRopeToTransform:
{
rope.SetMassMultiplierAt(particleIndex, 0.0f);
rope.SetPositionAt(particleIndex, connectionPoint);
break;
}
case RopeConnectionType.PinTransformToRope:
{
var target = rope.GetPositionAt(particleIndex, true);
var offset = (float3)(transformSettings.transform.TransformPoint(localConnectionPoint) - transformSettings.transform.position);
transformSettings.transform.position = target - offset;
break;
}
case RopeConnectionType.PullRigidbodyToRope:
{
var target = rope.GetPositionAt(particleIndex, false);
var current = connectionPoint;
var delta = target - current;
var dist = math.length(delta);
if (dist > 0.0f)
{
var normal = delta / dist;
var correctionVelocity = dist * rigidbodySettings.stiffness / Time.fixedDeltaTime;
rigidbodySettings.body.SetPointVelocityNow(current, normal, correctionVelocity, rigidbodySettings.damping);
}
break;
}
case RopeConnectionType.TwoWayCouplingBetweenRigidbodyAndRope:
{
rope.RegisterRigidbodyConnection(
particleIndex,
rigidbodySettings.body,
rigidbodySettings.damping,
connectionPoint,
rigidbodySettings.stiffness);
break;
}
}
}
protected bool ShouldEnforceInFixedUpdate()
{
// Prefer FixedUpdate() whenever possible to avoid stalling while waiting for jobs to complete
bool isPhysics =
type != RopeConnectionType.PinRopeToTransform &&
type != RopeConnectionType.PinTransformToRope;
bool isInterpolating = rope && rope.interpolation != RopeInterpolation.None;
return isPhysics || !isInterpolating;
}
public void Update()
{
if (!ShouldEnforceInFixedUpdate())
{
EnforceConnection();
}
}
public void FixedUpdate()
{
if (ShouldEnforceInFixedUpdate())
{
EnforceConnection();
}
}
#if UNITY_EDITOR
public void OnDrawGizmos()
{
if (Application.isPlaying)
{
return;
}
var rope = GetComponent<Rope>();
if (!rope || rope.spawnPoints.Count < 2 || !connectedObject)
{
return;
}
var objPoint = connectionPoint;
Gizmos.color = colors[(int)type];
Gizmos.DrawWireCube(objPoint, Vector3.one * 0.05f);
if (!autoFindRopeLocation)
{
var localToWorld = (float4x4)rope.transform.localToWorldMatrix;
var ropeLength = rope.spawnPoints.GetLengthOfCurve(ref localToWorld);
rope.spawnPoints.GetPointAlongCurve(ref localToWorld, ropeLength * ropeLocation, out float3 ropePoint);
Gizmos.DrawWireCube(ropePoint, Vector3.one * 0.05f);
Gizmos.DrawLine(ropePoint, objPoint);
}
}
#endif
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 3c7388c73173748148c4ba5f2ad6c713
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: