Initial code commit

This commit is contained in:
Dario Zubovic
2016-09-16 18:25:05 +02:00
parent bfdb6e4c2d
commit f47ba9286b
299 changed files with 23022 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
using UnityEngine;
using System.Collections;
[RequireComponent(typeof(Light))]
public class MetaLight : MonoBehaviour {
public Ball linkedMetaball;
public float intensity;
private float phaseShift;
private Light lightComponent;
void Start () {
this.phaseShift = Random.Range(0, Mathf.PI);
this.lightComponent = this.GetComponent<Light>();
}
void Update () {
this.lightComponent.intensity = this.intensity * (this.linkedMetaball.transform.localPosition.magnitude + (1 + Mathf.Sin(this.phaseShift + Time.time/2)));
}
}