public virtual PivotSO Create(SOMaterial shapeMaterial, SOMaterial frameMaterial = null, int nShapeLayer = -1) { // [TODO] replace frame geometry with line renderer ? // [TODO] still cast shadows (semitransparent objects don't cast shadows, apparently) // [TODO] maybe render solid when not obscured by objects? use raycast in PreRender? AssignSOMaterial(shapeMaterial); // need to do this to setup BaseSO material stack pivotGO = GameObjectFactory.CreateParentGO(UniqueNames.GetNext("Pivot")); shapeGO = create_pivot_shape(); AppendNewGO(shapeGO, pivotGO, false); pivotGO.AddChild(shapeGO); if (frameMaterial != null) { this.frameMaterial = frameMaterial; frameGO = UnityUtil.CreateMeshGO("pivotFrame", "icon_meshes/axis_frame", 1.0f, UnityUtil.MeshAlignOption.NoAlignment, MaterialUtil.ToUnityMaterial(frameMaterial), false); MaterialUtil.SetIgnoreMaterialChanges(frameGO); MaterialUtil.DisableShadows(frameGO); AppendNewGO(frameGO, pivotGO, false); } if (nShapeLayer >= 0) { shapeGO.SetLayer(nShapeLayer); } increment_timestamp(); return(this); }
public override void Setup() { measureGO = GameObjectFactory.CreateParentGO("dimension"); measureGO.SetLayer(FPlatform.WidgetOverlayLayer); textGO = GameObjectFactory.CreateTextMeshGO("text", "1.0", Colorf.Black, TextHeight.SceneValuef); UnityUtil.AddChild(measureGO, textGO, false); textGO.SetLayer(FPlatform.WidgetOverlayLayer); }
public void Start() { fadeObject = new fGameObject(GameObject.CreatePrimitive(PrimitiveType.Sphere), FGOFlags.NoFlags); //fadeObject.transform.localScale = new Vector3(0.5f, 0.5f, 0.5f); fadeObject.SetMaterial(MaterialUtil.CreateFlatMaterial(Color.black, 0.0f), true); fadeObject.SetName("fade_sphere"); UnityUtil.ReverseMeshOrientation(fadeObject.GetMesh()); fadeObject.SetParent(UseCamera.GameObject(), false); fadeObject.SetLayer(FPlatform.HUDLayer); }
public virtual void AppendNewGO(fGameObject go, fGameObject parent, bool bKeepPosition) { vObjects.Add(go); go.SetParent(parent, bKeepPosition); go.SetLayer(parent.GetLayer()); foreach (GameObject child_go in go.Children()) { vObjects.Add(child_go); child_go.SetLayer(parent.GetLayer()); } }
public override void Setup() { sphereGO = GameObjectFactory.CreateMeshGO("brush_roi_sphere"); sphereGO.SetMesh(UnityUtil.GetSphereMesh()); sphereGO.SetLayer(FPlatform.WidgetOverlayLayer); }
public virtual void SetLayer(int nLayer) { rootGO.SetLayer(nLayer, true); }
override public void SetLayer(int nLayer) { parentGO.SetLayer(nLayer); base.SetLayer(nLayer); }