void Awake() { modalPanel = ModelPanel.Instance(); displayManager = DisplayManager.Instance(); myYesAction = new UnityAction(TestYesFunction); myNoAction = new UnityAction(TestNoFunction); myCancelAction = new UnityAction(TestCancelFunction); }
private void modelPanel_RenderVisBoneBoxChanged(ModelPanel panel, bool value) { if (ModelPanel == panel && !_updating) { _updating = true; chkBBVisBones.Checked = value; _updating = false; } }
private void ModelPanel_UseBindStateBoxesChanged(ModelPanel panel, bool value) { if (ModelPanel == panel && !_updating) { _updating = true; UseBindStateBoxes = value; _updating = false; } }
private void ModelPanel_RenderVerticesChanged(ModelPanel panel, bool value) { if (ModelPanel == panel && !_updating) { _updating = true; chkVertices.Checked = toggleVertices.Checked = value; _updating = false; } }
private void ModelPanel_RenderWireframeChanged(ModelPanel panel, bool value) { if (ModelPanel == panel && !_updating) { _updating = true; wireframeToolStripMenuItem.Checked = value; _updating = false; } }
private void ModelPanel_RenderPolygonsChanged(ModelPanel panel, bool value) { if (ModelPanel == panel && !_updating) { _updating = true; chkPolygons.Checked = togglePolygons.Checked = value; _updating = false; } }
private void modelPanel_RenderBonesChanged(ModelPanel panel, bool value) { if (ModelPanel == panel && !_updating) { _updating = true; toggleBones.Checked = chkBones.Checked = value; _updating = false; } }
private void modelPanel_FirstPersonCameraChanged(ModelPanel panel, bool value) { if (ModelPanel == panel && !_updating) { _updating = true; firstPersonCameraToolStripMenuItem.Checked = value; _updating = false; } }
private void modelPanel_RenderOffscreenChanged(ModelPanel panel, bool value) { if (ModelPanel == panel && !_updating) { _updating = true; DontRenderOffscreen = value; _updating = false; } }
private void ModelPanel_RenderMetalsChanged(ModelPanel panel, bool value) { if (ModelPanel == panel && !_updating) { _updating = true; toggleMetals.Checked = value; _updating = false; } }
private void ModelPanel_ScaleBonesChanged(ModelPanel panel, bool value) { if (ModelPanel == panel && !_updating) { _updating = true; //scaleBonesToolStripMenuItem.Checked = value; _updating = false; } }
private void modelPanel_RenderFloorChanged(ModelPanel panel, bool value) { if (ModelPanel == panel && !_updating) { _updating = true; chkFloor.Checked = toggleFloor.Checked = value; _updating = false; } }
private void ModelPanel_ApplyBillboardBonesChanged(ModelPanel panel, bool value) { if (ModelPanel == panel && !_updating) { _updating = true; chkBillboardBones.Checked = value; _updating = false; } }
private void ModelPanel_RenderShadersChanged(ModelPanel panel, bool value) { //Only update if the focused panel triggered the event if (ModelPanel == panel && !_updating) { _updating = true; shadersToolStripMenuItem.Checked = value; _updating = false; } }
private bool HotkeyResetCamera() { if (Ctrl) { ModelPanel.ResetCamera(); return(true); } return(false); }
public override void AppendTarget(IModel model) { if (!_targetModels.Contains(model)) { _targetModels.Add(model); } ModelPanel.AddTarget(model, false); model.ResetToBindState(); }
private bool HotkeyRefreshReferences() { if (ModelPanel.Focused) { ModelPanel.RefreshReferences(); return(true); } return(false); }
private bool HotkeyCaptureScreenshot() { if (ModelPanel.Focused) { SaveBitmap(ModelPanel.GetScreenshot(ModelPanel.ClientRectangle, false), ScreenCaptureFolder, "." + ScreenCaptureType); return(true); } return(false); }
private bool HotkeyRenderDepthPressed() { if (ModelPanel.Focused && !_renderDepth) { _renderDepth = true; ModelPanel.Invalidate(); return(true); } return(false); }
void Awake() { _GameState = GameObject.Find("GameFlow").GetComponent <GameState> (); modelPanel = ModelPanel.Instance(); // myYesAction = new UnityAction (ZombieYesFunction); // myNoAction = new UnityAction (ZombieNoFunction); // myCancelAction = new UnityAction (ZombieCancelFunction); }
private bool HotkeyRenderDepthReleased() { if (ModelPanel.Focused && _renderDepth) { _renderDepth = false; ModelPanel.Invalidate(); return(true); } return(false); }
public void Render(TKContext ctx, ModelPanel mainWindow) { GL.Disable(EnableCap.Lighting); GL.PolygonMode(MaterialFace.FrontAndBack, PolygonMode.Fill); GL.Enable(EnableCap.CullFace); GL.CullFace(CullFaceMode.Front); foreach (CollisionObject obj in _objects) { obj.Render(ctx); } }
IEnumerator LoadObject(string path, string viewer) { AssetBundleCreateRequest bundle = AssetBundle.LoadFromFileAsync(path); yield return(bundle); AssetBundle myLoadedAssetBundle = bundle.assetBundle; if (myLoadedAssetBundle == null) { Debug.Log("Failed to load AssetBundle!"); yield break; } var names = myLoadedAssetBundle.GetAllAssetNames(); // AssetBundleRequest request = myLoadedAssetBundle.LoadAsset(); //yield return request; AssetBundleRequest objreq = myLoadedAssetBundle.LoadAssetAsync(names[0]); yield return(objreq); //obj.transform.position = new Vector3(0.08f, -2.345f, 297.54f); // obj.transform.Rotate(350.41f, 400f, 20f); // obj.transform.localScale = new Vector3(1.0518f, 0.998f, 1.1793f); if (viewer.Equals("model")) { LoadedModel = Instantiate((GameObject)objreq.asset, Model.transform); LoadedModel.transform.parent = Model.transform; LoadingPanal.SetActive(false); ProjectsPanal.SetActive(false); ModelPanel.SetActive(true); ModelView.SetActive(true); } else { if (PlaceOnPlane.AssatObj != null) { PlaceOnPlane.AssatObj = null; } PlaceOnPlane.AssatObj = (GameObject)objreq.asset; Projects[projectIndex].LoadedObj = (GameObject)objreq.asset; Projects[projectIndex].isloaded = true; LoadingPanal.SetActive(false); // ARCanvas.SetActive(true); ArSession.SetActive(true); ArModePanel.SetActive(true); ProjectsPanal.SetActive(false); ArExitpanel.SetActive(true); } myLoadedAssetBundle.Unload(false); }
public static ModelPanel Instance() { if (!modalPanel) { modalPanel = FindObjectOfType(typeof(ModelPanel)) as ModelPanel; if (!modalPanel) { Debug.LogError("There needs to be one active ModalPanel script on a GameObject in your scene."); } } return(modalPanel); }
public ElementPanel(ModelPanel modelPanel, PivotPosition position) { _modelPanel = modelPanel; Position = position; BackColor = Color.White; DragEnter += new DragEventHandler(onDragEnter); DragOver += new DragEventHandler(onDragOver); DragDrop += new DragEventHandler(onDragDrop); Paint += new PaintEventHandler(ElementPanel_Paint); AutoScroll = true; AllowDrop = true; }
private bool HotkeyOverlays() { if (ModelPanel.Focused) { chkAllOverlays.Checked = !chkAllOverlays.Checked; chkItems.Checked = chkAllOverlays.Checked; chkSpawns.Checked = chkAllOverlays.Checked; chkBoundaries.Checked = chkAllOverlays.Checked; ModelPanel.Invalidate(); return(true); } return(false); }
protected virtual void modelPanel1_MouseUp(object sender, MouseEventArgs e) { if (_createdNewBone && SelectedBone != null) { SelectedBone.BindState = SelectedBone.FrameState; SelectedBone.RecalcBindState(false, false, false); } _createdNewBone = false; bool temp = TargetModel is MDL0Node; if (temp) { MDL0Node m = TargetModel as MDL0Node; m._dontUpdateMesh = false; } if (e.Button == MouseButtons.Left) { ModelPanel panel = sender as ModelPanel; panel.CurrentViewport.AllowSelection = true; if (_vertexSelection.IsMoving() && VertexLoc.HasValue) { VertexChange(_selectedVertices); } if (_boneSelection.IsMoving() && SelectedBone != null) { if (temp && CHR0Editor.chkUpdateBindPose.Checked && TargetAnimType == NW4RAnimType.CHR && CurrentFrame == 0 && SelectedBone != null) { SelectedBone.RecalcBindState(true, !CHR0Editor.chkMoveBoneOnly.Checked); UpdateModel(TargetModel, CurrentFrame); } BoneChange(SelectedBone); } _boneSelection.ResetAll(); _vertexSelection.ResetAll(); } }
public void SelectedPolygonChanged() { //We can't return here if the selected polygon is set to null. //If the target model is changed or the selected object is cleared, //things relying on the selected object must be updated to reflect that. //if (leftPanel.SelectedPolygon == null) return; //This sets the selected object index internally in the model. //This determines the target object for focus editing vertices, normals, etc in the viewer //If the selected object is set to null, the poly index will be set to -1 by IndexOf. //This means vertices, normals etc will be drawn for all objects, if enabled. _targetModel.SelectedObjectIndex = _targetModel.Objects.IndexOf(leftPanel.SelectedObject); //If this setting is enabled, we need to show the user what textures only this object uses. //If the polygon is set to null, all of the model's texture references will be shown. if (SyncTexturesToObjectList) { leftPanel.UpdateTextures(); } //Update the VIS editor to show the entries for the selected object if (TargetAnimType == NW4RAnimType.VIS && leftPanel.SelectedObject != null && vis0Editor.listBox1.Items.Count != 0 && leftPanel.SelectedObject is MDL0ObjectNode) { MDL0ObjectNode o = (MDL0ObjectNode)leftPanel.SelectedObject; int x = 0; foreach (object i in vis0Editor.listBox1.Items) { if (o._drawCalls.Count > 0 && i.ToString() == o._drawCalls[0].VisibilityBone) { vis0Editor.listBox1.SelectedIndex = x; break; } x++; } if (x == vis0Editor.listBox1.Items.Count) { vis0Editor.listBox1.SelectedIndex = -1; } } ModelPanel.Invalidate(); }
private void MouseMoveTargetBone( ModelPanel panel, MouseEventArgs e, float depth, ModelPanelViewport v) { if (SelectedBone != null) { MouseMoveTarget( panel, e, depth, v, GetBoneWorldMtx(), GetBoneInvWorldMtx(), _boneSelection); } GetBone(panel, e, depth, v); }
//Rewrites local json file to include new downloaded cloud model public void updateLocalJSON(ModelData modelData, ModelPanel modelPanel) { localModels.Models.Add(modelData); string jsonString = JsonUtility.ToJson(localModels); //Serialize json objects to json string File.WriteAllText(localJsonFilePath, jsonString); //Save json file modelPanel.icon.texture = localIcon; //Show that model has been downloaded for (int i = 0; i < localScrollArea.childCount; i++) //Destroy old model panels { GameObject panel = localScrollArea.GetChild(i).gameObject; panel.SetActive(false); //Disabling it first is necessary, otherwise the layout group doesn't allow object to be deleted Destroy(panel); } rightTabClicked(); //Switch to local browser modelPanelsLoaded = false; readLocalJSON(); //Update local model browser }
private void MouseMoveTargetVertex( ModelPanel panel, MouseEventArgs e, float depth, ModelPanelViewport v) { if (VertexLoc.HasValue /* && v._renderAttrib._renderVertices*/) { Vector3 center = VertexLoc.Value; MouseMoveTarget( panel, e, depth, v, Matrix.TranslationMatrix(center), Matrix.TranslationMatrix(-center), _vertexSelection); } GetVertex(panel, e, depth, v); }
public void Init(ModelPanel modelPanel) { ModelPanel = modelPanel; ModelToRestrictionText(); }