Beispiel #1
0
        public void SpawnLargePipe()
        {
            AxisPipe newPipe = Instantiate(largePipePrefab, transform);

            newPipe.distanceToTravelBeforeDespawn = lengthOfAxis_c;
            newPipe.transform.localPosition       = largePipeSpawnPosition;
        }
Beispiel #2
0
 void OnTriggerExit(Collider other)
 {
     if (pipeInContact != null)
     {
         pipeInContact.state = state = AxisPipeState.rotatingAndMoving;
     }
     pipeInContact = null;
 }
Beispiel #3
0
 void OnTriggerEnter(Collider other)
 {
     pipeInContact = other.gameObject.GetComponent <AxisPipe>();
     if (pipeInContact != null)
     {
         pipeInContact.state = state = AxisPipeState.rotating;
     }
 }
Beispiel #4
0
        // 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());
        }