예제 #1
0
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.R))
        {
            turtle.reset();
        }
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            greenFlagBlock.transform.position = startPos;
            greenFlagBlock.transform.rotation = startOri;

            turtle.reset();

            blocks = GameObject.FindGameObjectsWithTag("Block");


            //Debug.Log(blocks);

            foreach (GameObject obj in blocks)
            {
                if (obj.name == greenFlagBlock.name)
                {
                    //Debug.Log("wwwww");
                }
                else
                {
                    Destroy(obj);
                }
            }
        }
    }
    public void OnTriggerEnter(Collider other)
    {
        SetCollidingObject(other);

        Debug.Log(other.gameObject.tag);

        //Start Script on Controller enter
        if (other.gameObject.tag == "ViveController")
        {
            Debug.Log("Controller Enter");
            //turtle.startClassicRoutine();
            turtle.reset();

            //Add Highlight
            highlight         = true;
            highlightDuration = 0f;
        }
        //Debug.Log("GREEN BARREL: Controller entered");
    }