static public void CreateSphereVolume() { GameObject newObject = new GameObject("Cone Volume"); if (SceneView.currentDrawingSceneView) { SceneView.currentDrawingSceneView.MoveToView(newObject.transform); } ConeVolume coneVolume = (ConeVolume)newObject.AddComponent <ConeVolume>(); coneVolume.enabled = false; coneVolume.enabled = true; }
static public void CreateVolume() { GameObject newObject = new GameObject("Cone Volume"); if (UnityEditor.SceneView.currentDrawingSceneView) { UnityEditor.SceneView.currentDrawingSceneView.MoveToView(newObject.transform); } ConeVolume coneVolume = (ConeVolume)newObject.AddComponent <ConeVolume>(); coneVolume.volumeShader = "Advanced SS/Volumetric/Cone Volume"; coneVolume.enabled = false; coneVolume.enabled = true; }
protected void Result_Сone_Btn_Click(object sender, EventArgs e) { ConeVolume cone = new ConeVolume(Convert.ToInt32(R.Text), Convert.ToInt32(h.Text)); result.Text = Convert.ToString(cone.CalcCapacity()); }