Files
jelito/Assets/jelycho/Code/Ropes/RopesSpawnerTest.cs

25 lines
835 B
C#

using RebootKit.Engine.Main;
using Unity.Mathematics;
using UnityEngine;
using UnityEngine.Assertions;
namespace RebootReality.jelycho.Ropes {
public class RopesSpawnerTest : MonoBehaviour {
[SerializeField] int m_RopesCount = 10;
void Start() {
WorldContext worldContext = RR.World.Context as WorldContext;
Assert.IsNotNull(worldContext, "Invalid WorldContext");
RopesManager ropesManager = worldContext.RopesManager;
float3 startPosition = transform.position;
for (int i = 0; i < m_RopesCount; ++i) {
float3 start = startPosition + new float3(i * 1.5f, 0, 0);
float3 end = start + new float3(0, 0, 15.0f);
ropesManager.SpawnRope(start, end, true, true);
}
}
}
}