public void DeleteAxis() { if (axisIndex > 0) { AxisDataManager.Instance().RemoveAxisAt(axisIndex); for (int i = 0; i < propertyControllers[axisIndex].Count; i++) { Destroy(propertyControllers[axisIndex][i]); } propertyControllers.RemoveAt(axisIndex); int value = dropdown.value; GameObject temp = axisList[value]; for (int i = value; i <= AxisDataManager.Instance().GetAxisCount(); i++) { axisList[i].GetComponent <AxisRepositioner>().index -= 1; } axisList.RemoveAt(value); GameObject.Destroy(temp); dropdown.options.RemoveAt(axisIndex); dropdown.value = 0; dropdown.RefreshShownValue(); OnChangeAxisIndex(); } else { Debug.Log("Can't Delete Axis"); } }
public void SetAxis(int _index) { index = _index; currentAxis = AxisDataManager.Instance().GetAxis(index); ChangePropertiesInfo(); }
public void changeColor(Color _color) { axisList[axisIndex].GetComponent <MeshRenderer>().material.color = _color; Axis temp = AxisDataManager.Instance().GetAxis(axisIndex); temp.color = _color; AxisDataManager.Instance().ChangeAxisAt(axisIndex, temp); }
public void changeAxis(int index) { var myAxis = AxisDataManager.Instance(); currentIndex = index; axisSetting.SetAxis(index); InputText.text = myAxis.GetAxis(index).name; }
public void OnClickMinusButton() { var myAxis = AxisDataManager.Instance(); var temp = myAxis.GetAxis(AxisSetting.index); temp.weights.RemoveAt(SettingIndex); myAxis.ChangeAxisAt(AxisSetting.index, temp); AxisSetting.DeleteProperty(SettingIndex); }
public void OnNameChange() { InputText.text = InputText.text; Axis temp = AxisDataManager.Instance().GetAxis(axisIndex); temp.name = InputText.text; SetAxis(temp); axisList[axisIndex].GetComponent <AxisRepositioner>().ChangeName(temp.name); dropdown.options[dropdown.value].text = InputText.text; }
public void OnNameChange() { var myAxis = AxisDataManager.Instance(); InputText.text = InputText.text; Axis temp = myAxis.GetAxis(currentIndex); temp.name = InputText.text; myAxis.ChangeAxisAt(currentIndex, temp); dropdown.options[dropdown.value].text = InputText.text; }
public void changeValue() { text.text = slider.value.ToString(); var myAxis = AxisDataManager.Instance(); var temp = myAxis.GetAxis(AxisSetting.index); var weight = temp.weights[SettingIndex]; weight.propertyIndex = dropdown.value; weight.weight = slider.value; temp.weights[SettingIndex] = weight; myAxis.ChangeAxisAt(AxisSetting.index, temp); }
public void OnClickAddPropertySelector() { Weight w = new Weight(); w.propertyIndex = 0; w.weight = 0; var myAxis = AxisDataManager.Instance(); var temp = myAxis.GetAxis(index); temp.weights.Add(w); myAxis.ChangeAxisAt(index, temp); ActiveProperty(w); }
private void addValue() { var myAxis = AxisDataManager.Instance(); var newAxis = new Axis(); newAxis.weights = new List <Weight>(); newAxis.name = "new Axis"; var temp = Instantiate(axisModel, axisSpace.transform); temp.GetComponent <AxisRepositioner>().index = myAxis.GetAxisCount(); temp.SetActive(true); axisList.Add(temp); myAxis.AddAxis(newAxis); dropdown.options.Add(new Dropdown.OptionData(newAxis.name)); }
// Update is called once per frame void Update() { if (index == AxisViewManager.Instance().GetAxisIndex()) { RaycastHit hit; RaycastHit[] hits; ray = view.ScreenPointToRay(Input.mousePosition); int layerMask_sphere = 1 << 9; int layerMask_axis = 1 << 10; if (isClicked) { if (Vector3.Dot(view.transform.forward, transform.position) >= 0) { Physics.Raycast(ray.origin + ray.direction * 100f, -ray.direction, out hit, Mathf.Infinity, layerMask_sphere); } else { Physics.Raycast(ray, out hit, Mathf.Infinity, layerMask_sphere); } if (hit.point != Vector3.zero) { transform.position = hit.point; myRenderer.SetPosition(1, transform.position); AxisDataManager.Instance().changeVectorAt(index, transform.position); } } else { if (Input.GetMouseButtonDown(0)) { hits = Physics.RaycastAll(ray, Mathf.Infinity, layerMask_axis); for (int i = 0; i < hits.Length; i++) { isClicked = true; } } } if (Input.GetMouseButtonUp(0)) { isClicked = false; } } DrawName(); }
private void deleteValue() { var myAxis = AxisDataManager.Instance(); var value = dropdown.value; myAxis.RemoveAxisAt(value); var temp = axisList[value]; for (int i = value; i <= myAxis.GetAxisCount(); i++) { axisList[i].GetComponent <AxisRepositioner>().index -= 1; } axisList.RemoveAt(value); Destroy(temp); dropdown.options.RemoveAt(value); dropdown.value = 0; dropdown.RefreshShownValue(); }
public void AddNewAxis() { Axis newAxis = new Axis(); newAxis.vector = new Vector3(10, 0, 0); newAxis.color = Color.white; newAxis.weights = new List <Weight>(); newAxis.name = "new Axis"; AxisDataManager.Instance().AddAxis(newAxis); GameObject temp = Instantiate(axisModel, axisSpace.transform); GameObject label = Instantiate(NameLabel); label.SetActive(true); label.transform.parent = NameLabel.transform.parent; temp.GetComponent <AxisRepositioner>().nameLabel = label.GetComponent <Text>(); temp.GetComponent <AxisRepositioner>().index = AxisDataManager.Instance().GetAxisCount() - 1; temp.SetActive(true); axisList.Add(temp); dropdown.options.Add(new Dropdown.OptionData("new Axis")); propertyControllers.Add(new List <WeightSettingModel>()); }
void updateBuffer() { var manager = AxisDataManager.Instance(); var floats = FileReader.floatList; //데이터 접근 var axisData = manager.GetAxisDatas(); var weightData = manager.GetWeights(); //데이터 받아오기 maxAxis = axisData.Length + 1; computeShader.SetInt("axisCount", maxAxis); //데이터 갯수 설정 axisBuffer = new ComputeBuffer(maxAxis, axisSize); axisBuffer.SetData(axisData); //axisBuffer 설정 maxWeight = weightData.Length; weightBuffer = new ComputeBuffer(maxWeight, weightSize); weightBuffer.SetData(weightData); //weight 버퍼 설정 computeShader.SetBuffer(mComputeShaderKernelID, "weightBuffer", weightBuffer); computeShader.SetBuffer(mComputeShaderKernelID, "axisBuffer", axisBuffer); //연산 쉐이더에 정보 주입 computeShader.Dispatch(mComputeShaderKernelID, 32, 32, 1); if (mesh != null) { args[0] = (uint)mesh.GetIndexCount(0); args[1] = (uint)maxParticle; args[2] = (uint)mesh.GetIndexStart(0); args[3] = (uint)mesh.GetBaseVertex(0); } else { args[0] = args[1] = args[2] = args[3] = 0; } argsBuffer.SetData(args); }
public Axis GetAxis(int _index) { return(AxisDataManager.Instance().GetAxis(_index)); }
public void SetAxis(Axis _axis) { AxisDataManager.Instance().ChangeAxisAt(axisIndex, _axis); }