Exemplo n.º 1
0
    public void Update()
    {
        if (indicator.indicatorType != IndicatorType.none && !EventSystem.current.IsPointerOverGameObject())
        {
            Vector3 hitpoint = GameObject.FindWithTag("MainCamera").GetComponent <MouseInteraction>().hitpoint3;
            if (Input.GetMouseButtonDown(0))
            {
                indicator.fixControlPoint(hitpoint);
            }
            else
            {
                indicator.setControlPoint(hitpoint);
            }
        }

        clearButtonColor();

        switch (indicator.indicatorType)
        {
        case IndicatorType.none:
            break;

        case IndicatorType.line:
            transform.GetChild(0).GetComponent <Image>().color = new Color(83f / 255f, 207f / 255f, 100f / 255f);
            break;

        case IndicatorType.arc:
            transform.GetChild(1).GetComponent <Image>().color = new Color(83f / 255f, 207f / 255f, 100f / 255f);
            break;

        case IndicatorType.bezeir:
            transform.GetChild(2).GetComponent <Image>().color = new Color(83f / 255f, 207f / 255f, 100f / 255f);
            break;

        case IndicatorType.delete:
            transform.GetChild(3).GetComponent <Image>().color = new Color(83f / 255f, 207f / 255f, 100f / 255f);
            break;
        }
    }