Commit 8c182d07 authored by Nathan Hertz's avatar Nathan Hertz

Added Earth explosion script

parent eb57b960
using UnityEngine;
using System.Collections;
public class ExplodeEarth : MonoBehaviour {
public Transform explosion;
// Update is called once per frame
void OnCollisionEnter(Collision col)
{
gameObject.GetComponent<Renderer>().material.color = new Color(color.r += 0.1f, color.g, color.b, color.a);
if (gameObject.GetComponent<Renderer>().material.color.r == 1f)
{
gameObject.GetComponent<Renderer>().material.color = new Color(color.r -= 0.9f, color.g -= 0.9f, color.b -= 0.9f, color.a);
explosion.GetComponent<ParticleSystem>().Play();
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment