Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class LavaController : MonoBehaviour
- {
- public float riseSpeed = 1f;
- public GameObject rb;
- // Use this for initialization
- void Start ()
- {
- SpeedAugmenter();
- rb = GameObject.Find("lavaPosition");
- }
- void SpeedAugmenter()
- {
- StartCoroutine("SpeedChanger");
- }
- IEnumerator SpeedChanger()
- {
- yield return new WaitForSecondsRealtime(15);
- riseSpeed++;
- print(riseSpeed);
- SpeedAugmenter();
- }
- // Update is called once per frame
- void FixedUpdate ()
- {
- StartCoroutine("LavaRiser");
- rb.transform.position.y += 10;
- }
- IEnumerator LavaRiser()
- {
- yield return new WaitForSecondsRealtime(1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment