// creates a button that is just the mesh public void Create(fMesh mesh, fMaterial meshMaterial, float fScale, Quaternionf transform) { button = GameObjectFactory.CreateParentGO(UniqueNames.GetNext("HUDButton")); iconMesh = AppendMeshGO("shape", mesh, meshMaterial, button); iconMesh.SetLocalScale(new Vector3f(fScale, fScale, fScale)); iconMesh.SetLocalRotation(iconMesh.GetLocalRotation() * transform); MaterialUtil.DisableShadows(iconMesh); standard_mat = new fMaterial(meshMaterial); }
// creates a button that is just the mesh, basically same as above but without the background disc public void Create(UnityEngine.PrimitiveType eType, fMaterial primMaterial, float fPrimScale = 1.0f) { button = GameObjectFactory.CreateParentGO(UniqueNames.GetNext("HUDButton")); buttonMesh = AppendUnityPrimitiveGO(UniqueNames.GetNext("HUDButton"), eType, primMaterial, button); float primSize = Shape.EffectiveRadius() * fPrimScale; buttonMesh.SetLocalScale(new Vector3f(primSize, primSize, primSize)); buttonMesh.Translate(new Vector3f(0.0f, 0.0f, -primSize), false); Quaternionf rot = buttonMesh.GetLocalRotation(); rot = rot * Quaternionf.AxisAngleD(Vector3f.AxisY, 45.0f); rot = rot * Quaternionf.AxisAngleD(Vector3f.AxisX, -15.0f); buttonMesh.SetLocalRotation(rot); //buttonMesh.transform.Rotate(-15.0f, 45.0f, 0.0f, Space.Self); MaterialUtil.DisableShadows(buttonMesh); standard_mat = new fMaterial(primMaterial); }