working on enemies
This commit is contained in:
@@ -17,6 +17,8 @@ namespace RebootReality.jelycho.Ropes {
|
||||
|
||||
[SerializeField] Material m_Material;
|
||||
|
||||
[SerializeField] int m_Layer;
|
||||
|
||||
[SerializeField] GutMeshGenerationConfig m_GutMeshGenerationConfig = new GutMeshGenerationConfig {
|
||||
radius = 0.2f,
|
||||
resolution = 16
|
||||
@@ -87,7 +89,7 @@ namespace RebootReality.jelycho.Ropes {
|
||||
Graphics.DrawMesh(mesh,
|
||||
transform.localToWorldMatrix,
|
||||
m_Material,
|
||||
gameObject.layer,
|
||||
m_Layer,
|
||||
null,
|
||||
0,
|
||||
null,
|
||||
|
||||
@@ -7,9 +7,12 @@ using Unity.Jobs;
|
||||
using Unity.Mathematics;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Profiling;
|
||||
using Logger = RebootKit.Engine.Foundation.Logger;
|
||||
|
||||
namespace RebootReality.jelycho.Ropes {
|
||||
public class RopesManager : MonoBehaviour {
|
||||
static readonly Logger s_Logger = new Logger(nameof(RopesManager));
|
||||
|
||||
[SerializeField] float m_RopeSegmentLength = 0.5f;
|
||||
[SerializeField] int m_ConstrainIterations = 50;
|
||||
|
||||
@@ -107,8 +110,8 @@ namespace RebootReality.jelycho.Ropes {
|
||||
}
|
||||
|
||||
// @TODO: finish the rope spawning logic.
|
||||
public void SpawnRope(float3 start, float3 end, bool lockFirst = false, bool lockLast = false) {
|
||||
int segmentsCount = (int) (math.distance(start, end) / m_RopeSegmentLength) + 1;
|
||||
public void SpawnRope(float3 start, float3 end, bool lockFirst = false, bool lockLast = false, float lengthMultiplier = 0.5f) {
|
||||
int segmentsCount = (int) ((math.distance(start, end) * lengthMultiplier) / m_RopeSegmentLength) + 1;
|
||||
NativeArray<float3> positions = new NativeArray<float3>(segmentsCount, Allocator.Temp);
|
||||
|
||||
for (int i = 0; i < segmentsCount; ++i) {
|
||||
|
||||
Reference in New Issue
Block a user