public void SpawnLargePipe() { AxisPipe newPipe = Instantiate(largePipePrefab, transform); newPipe.distanceToTravelBeforeDespawn = lengthOfAxis_c; newPipe.transform.localPosition = largePipeSpawnPosition; }
void OnTriggerExit(Collider other) { if (pipeInContact != null) { pipeInContact.state = state = AxisPipeState.rotatingAndMoving; } pipeInContact = null; }
void OnTriggerEnter(Collider other) { pipeInContact = other.gameObject.GetComponent <AxisPipe>(); if (pipeInContact != null) { pipeInContact.state = state = AxisPipeState.rotating; } }
// Use this for initialization void Start() { string pathToPrefabs = "Prefabs/LevelSpecific/_Axis/"; smallPipePrefab = Resources.Load <AxisPipe>(pathToPrefabs + "PipeSmall"); largePipePrefab = Resources.Load <AxisPipe>(pathToPrefabs + "PipeLarge"); StartCoroutine(SpawnSmallPipesCoroutine()); StartCoroutine(SpawnLargePipesCoroutine()); }