void SetOpacity(FloatMsg msg) { Material mat = GetComponent <MeshRenderer>().material; Color color = mat.color; color.a = msg.value; mat.color = color; }
void SetBrightness(FloatMsg msg) { ActorObject act = GetComponent <ActorObject>(); if (act != null) { DisplayObject disp = act.display; if (disp != null) { disp.currentBrightness = msg.value; } else { Debug.LogError(string.Format("{0}: Tried to set screen brightness but object has no display attached.", name)); } } else { Debug.LogError(string.Format("{0}: Tried to set screen brightness but object is not an actor.", name)); } }
void RotateTo(FloatMsg msg) { transform.rotation = Quaternion.Euler(0, msg.value, 0); }
void Rotate(FloatMsg msg) { transform.Rotate(new Vector3(0, msg.value, 0)); }