public override void OnMouseDown(Troll3D.MouseEvent e) { if (e.mouse_.rightbutton) { RaycastResult result = TRaycast.FireRayFromMouse(); if (result.GetEntity() != null) { MeshRenderer mr = ( MeshRenderer )result.GetEntity().GetComponent(ComponentType.MeshRenderer); mr.material_.SetMainColor(1.0f, 1.0f, 0.0f, 1.0F); } } }