예제 #1
0
    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");
        }
    }
예제 #2
0
    public void SetAxis(int _index)
    {
        index       = _index;
        currentAxis = AxisDataManager.Instance().GetAxis(index);

        ChangePropertiesInfo();
    }
예제 #3
0
    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);
    }
예제 #4
0
    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);
    }
예제 #6
0
    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;
    }
예제 #7
0
    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);
    }
예제 #9
0
    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);
    }
예제 #10
0
    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();
    }
예제 #12
0
    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();
    }
예제 #13
0
    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);
    }
예제 #15
0
 public Axis GetAxis(int _index)
 {
     return(AxisDataManager.Instance().GetAxis(_index));
 }
예제 #16
0
 public void SetAxis(Axis _axis)
 {
     AxisDataManager.Instance().ChangeAxisAt(axisIndex, _axis);
 }