private void Start() { _guid = GerstnerWavesJobs.GenId(); _rend = GetComponent <Renderer>(); GetComponent <MeshFilter>().mesh = Mesh2DGrid(0, 2, -0.5f, -0.5f, 1f, 1f, GEOM_HORIZ_DIVISIONS, 1); }
private int _guid; // GUID for the height system public void Start() { m_buoyancy = GetComponentsInChildren <FBuoyancyPart>(); body = GetComponent <Rigidbody>(); heights = new float3[m_buoyancy.Length]; // new NativeSlice<float3>(); normals = new float3[m_buoyancy.Length]; //new NativeSlice<float3>(); samplePoints = new float3[m_buoyancy.Length]; _guid = GerstnerWavesJobs.GenId(); }
public float _speed = 3f; // how long the wake lasts for void OnEnable() { // Initial setup for wakes foreach (Wake w in _wakes) { for (int i = 0; i < 2; i++) { WakeLine wl = new WakeLine(); GameObject go = GameObject.Instantiate(_wakePrefab, Vector3.zero, Quaternion.Euler(90f, 0, 0)); LineRenderer LR = go.GetComponent <LineRenderer>(); wl.points = new List <WakePoint>(); wl._lineRenderer = LR; wl.guid = GerstnerWavesJobs.GenId(); wl.go = go; w.lines.Add(wl); go.hideFlags = HideFlags.HideAndDontSave; } } }
private void Start() { _guid = GerstnerWavesJobs.GenId(); module = ps.main; offset = transform.localPosition; }