private float startLightIntensity; // the intensity of the player light when the player is initially spawned // Use this for initialization void Start() { playerLightType = TypeOfLight.White; // the player is intilized as white light playerLight = gameObject.GetComponent <Light>(); startLightIntensity = playerLight.intensity; lightLeft = maxLight; }
public void changeLightType(TypeOfLight newLightType) { playerLightType = newLightType; switch (newLightType) { case TypeOfLight.White: playerLight.color = color_white; break; case TypeOfLight.Red: playerLight.color = color_red; break; case TypeOfLight.Orange: playerLight.color = color_orange; break; case TypeOfLight.Yellow: playerLight.color = color_yellow; break; case TypeOfLight.Green: playerLight.color = color_green; break; case TypeOfLight.Blue: playerLight.color = color_blue; break; case TypeOfLight.Violet: playerLight.color = color_violet; break; default: Debug.Log("changeLightType switch defaulted"); playerLight.color = color_white; break; } }