Example #1
0
        void SetOpacity(FloatMsg msg)
        {
            Material mat   = GetComponent <MeshRenderer>().material;
            Color    color = mat.color;

            color.a   = msg.value;
            mat.color = color;
        }
Example #2
0
        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));
            }
        }
Example #3
0
 void RotateTo(FloatMsg msg)
 {
     transform.rotation = Quaternion.Euler(0, msg.value, 0);
 }
Example #4
0
 void Rotate(FloatMsg msg)
 {
     transform.Rotate(new Vector3(0, msg.value, 0));
 }