Guest User

Untitled

a guest
Jan 13th, 2018
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.83 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class LavaController : MonoBehaviour
  6. {
  7.  
  8.     public float riseSpeed = 1f;
  9.     public GameObject rb;
  10.  
  11.     // Use this for initialization
  12.     void Start ()
  13.     {
  14.         SpeedAugmenter();
  15.         rb = GameObject.Find("lavaPosition");
  16.     }
  17.    
  18.     void SpeedAugmenter()
  19.     {
  20.         StartCoroutine("SpeedChanger");
  21.     }
  22.  
  23.     IEnumerator SpeedChanger()
  24.     {
  25.         yield return new WaitForSecondsRealtime(15);
  26.         riseSpeed++;
  27.         print(riseSpeed);
  28.         SpeedAugmenter();
  29.     }
  30.  
  31.     // Update is called once per frame
  32.     void FixedUpdate ()
  33.     {
  34.         StartCoroutine("LavaRiser");
  35.         rb.transform.position.y += 10;
  36.     }
  37.  
  38.     IEnumerator LavaRiser()
  39.     {
  40.         yield return new WaitForSecondsRealtime(1);
  41.  
  42.     }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment