add and setup light
GameObject lightGameObjecteffect = new GameObject("The Light"); lightGameObjecteffect.AddComponent<Light> (); lightGameObjecteffect.light.type= LightType.Spot; lightGameObjecteffect.light.color = t_color; // Color. // Color. //Color.red ; lightGameObjecteffect.light.range=200; lightGameObjecteffect.transform.position = new Vector3(30, 30, -9); lightGameObjecteffect.light.spotAngle=36;