예제 #1
0
    void Start()
    {
        if (!ENABLED)
        {
            return;
        }

        GameObject gameObject = GameObject.Find("Game");

        _game = gameObject.GetComponent <DonkeyKongGame>();

        _capsule = this.transform.Find("Capsule").gameObject;
        CollisionHelper col = _capsule.GetComponent <CollisionHelper>();

        col.OnEnter += OnCollisionHelperEnter;
        col.OnExit  += OnCollisionHelperExit;

        _collisionHelper = GroundCollider.GetComponent <CollisionHelper>();
        _collisionHelper.IgnoreObjects.Add(this.gameObject);
        _collisionHelper.IgnoreObjects.Add(this.transform.Find("Capsule").gameObject);
        _collisionHelper.OnEnter += OnGroundCollisionEnter;
        _collisionHelper.OnExit  += OnGroundCollisionExit;

        _clickHelper              = this.transform.gameObject.GetComponent <ClickHelper>();
        _clickHelper.OnMouseDown += OnMouseDown;
        _clickHelper.ClickObjectNames.Add("Hammer");
        _clickHelper.ClickObjectNames.Add("HammerHead");

        _hands = this.transform.gameObject.GetComponent <VRHands>();
        _hands.OnLeftHandGrabbed  += OnLeftHandGrabbed;
        _hands.OnRightHandGrabbed += OnRightHandGrabbed;

        _climber = this.transform.gameObject.GetComponent <PlayerClimber>();
    }
예제 #2
0
    // Start is called before the first frame update
    void Start()
    {
        GameObject gameObject = GameObject.Find("Game");

        _game = gameObject.GetComponent <DonkeyKongGame>();

        _capsule = this.transform.Find("Capsule").gameObject;

        _hands = this.transform.gameObject.GetComponent <VRHands>();
        _hands.OnLeftHandGrabbed  += OnHandGrabbed;
        _hands.OnRightHandGrabbed += OnHandGrabbed;
    }
예제 #3
0
    void Start()
    {
        _playerController    = this.gameObject.GetComponent <OVRPlayerController>();
        _characterController = this.gameObject.GetComponent <CharacterController>();

        _hands = this.transform.gameObject.GetComponent <VRHands>();
        _hands.OnLeftHandGrabbed   += OnLeftHandGrabbed;
        _hands.OnLeftHandReleased  += OnLeftHandReleased;
        _hands.OnRightHandGrabbed  += OnRightHandGrabbed;
        _hands.OnRightHandReleased += OnRightHandReleased;

        _clickHelper                  = this.transform.gameObject.GetComponent <ClickHelper>();
        _clickHelper.OnMouseDown     += OnMouseDown;
        _clickHelper.OnMouseDownMove += OnMouseDownMove;
        _clickHelper.OnMouseUp       += OnMouseUp;
        _clickHelper.ClickObjectNames.Add("Rung");
    }