void Awake() { thisTrans = transform; lineWaveObj = Instantiate(lineWavePrefab, lineWaveStartPos, harpoonBody.rotation) as GameObject; lineWaveTrans = lineWaveObj.transform; lineWave = lineWaveObj.GetComponent <LineWave>(); lineWaveMat = lineWaveObj.renderer.material; }
public void ActivateTrail() { lineWaveStartPos = thisTrans.position; if (lineWaveObj == null) { lineWaveObj = Instantiate(lineWavePrefab, lineWaveStartPos, harpoonBody.rotation) as GameObject; lineWaveTrans = lineWaveObj.transform; lineWave = lineWaveObj.GetComponent <LineWave>(); } else { lineWaveTrans.position = lineWaveStartPos; lineWaveTrans.rotation = harpoonBody.rotation; } lastDotPosition = thisTrans.position; InvokeRepeating("MakeEdgeCol", 0.1f, colliderGenFrequency); trailActivated = true; }