예제 #1
0
 void Start()
 {
     _status  = HingeStatus.unpicked;
     interact = gameObject.GetComponentInParent <HingeController>().Interact.GetComponent <InteractController>();
     interact.HideArea();
     this.gameObject.AddComponent <BoxCollider>();
 }
예제 #2
0
    private void Update()
    {
        Ray        ray = Camera.main.ScreenPointToRay(Input.mousePosition);
        RaycastHit hit;

        if (Physics.Raycast(ray, out hit) && hit.collider.gameObject == this.gameObject)
        {
            if (_status == HingeStatus.unpicked)
            {
                _status = HingeStatus.mouseOn;
                interact.ShowArea();
            }
        }
        else
        {
            _status = HingeStatus.unpicked;
            interact.HideArea();
        }
    }