示例#1
0
        private void Inspection()
        {
            if (Input.GetKeyDown(KeyCode.I))
            {
                iWantToWatch = !iWantToWatch;

                if (iWantToWatch)
                {
                    iWantToWatch = true;

                    _manager.Watch(itemName, itemExtraInfo);

                    FindObjectOfType <Player>().GetComponent <CharacterController>().enabled = false;

                    var objectTransform = transform;
                    objectTransform.localPosition = _inspectPosition;
                    objectTransform.localRotation = _inspectRotation;
                }
                else
                {
                    iWantToWatch = false;

                    FindObjectOfType <Player>().GetComponent <CharacterController>().enabled = true;

                    _manager.DontWatch();


                    var objectTransform = transform;
                    objectTransform.localPosition = _initialPosition;
                    objectTransform.localRotation = _initialRotation;
                }
            }
        }