from unity import *
import Chroma

class Something(object):

	def Start(self):
		self.per = 0.0
		self.chroma = Chroma(Color.red)

		self.trail = self.gameObject.AddComponent("TrailRenderer")
		self.trail.material = Material(Shader.Find("Particles/Additive"))

	def Update(self):
		self.per += Time.deltaTime
		self.chroma.shiftHue(Time.deltaTime * 20)
		self.chroma.shiftSaturation(Time.deltaTime * 15)
		# Debug.Log(self.gameObject.transform.position)
		self.gameObject.transform.position = Vector3(Mathf.Sin(self.per), Mathf.Sin(self.per * 0.3) * 4, Mathf.Cos(self.per))
		self.gameObject.renderer.material.color = self.chroma.getColor()
		Debug.Log("\n".join(dir(self.trail)))
		self.trail.colors[0] = self.chrome.getColor()

	def OnMouseDown(self):
		self.chroma = Chroma(Color.blue)
		self.gameObject.Destroy(self.gameObject)

