Update() private méthode

private Update ( ) : void
Résultat void
    private void UpdateGame()
    {
        //Deal with gesture starting and stopping and hand grabbing
        if (grabAction.GetAxis(SteamVR_Input_Sources.LeftHand) >= 0.1f)
        {
            if (!leftHand.GetGrabbing())
            {
                leftHand.ToggleGrabbing();
                gestureManager.BeginGesture(this, true, true);
            }
        }
        else
        {
            if (leftHand.GetGrabbing())
            {
                leftHand.ToggleGrabbing();
                spellHandler.CastSpell(gestureManager.EndGesture(), gestureManager.CurrentHand());
            }
        }

        if (grabAction.GetAxis(SteamVR_Input_Sources.RightHand) >= 0.1f)
        {
            if (!rightHand.GetGrabbing())
            {
                rightHand.ToggleGrabbing();
                gestureManager.BeginGesture(this, false, true);
            }
        }
        else
        {
            if (rightHand.GetGrabbing())
            {
                rightHand.ToggleGrabbing();
                spellHandler.CastSpell(gestureManager.EndGesture(), gestureManager.CurrentHand());
            }
        }

        gestureManager.Update(this, Time.deltaTime, true);

        //Deal with player movement
        CalcMovement();

        //Remove the shield material if the shield is gone
        if (healthComp.ShieldBroke())
        {
            leftHand.GetComponentInChildren <SkinnedMeshRenderer>().material  = baseMaterial;
            rightHand.GetComponentInChildren <SkinnedMeshRenderer>().material = baseMaterial;
        }

        leftHand.SetGems(healthComp.GetHealth() / (float)startingHP);
        rightHand.SetGems(healthComp.GetHealth() / (float)startingHP);
    }
Exemple #2
0
    void Update()
    {
        if (Input.GetMouseButtonDown(0))
        {
            manager.Begin(new Vector2(Input.mousePosition.x, Input.mousePosition.y));
            _captureTick       = 0f;
            _lastMousePosition = Input.mousePosition;
            SetPenPosition();
            NewPen();
        }
        else if (Input.GetMouseButton(0))
        {
            if (_lastMousePosition != Input.mousePosition)
            {
                _captureTick += Time.deltaTime;

                if (_captureTick >= captureInterval)
                {
                    _captureTick = 0f;
                    manager.Update(new Vector2(Input.mousePosition.x, Input.mousePosition.y));
                    SetPenPosition();
                }
            }
        }
        if (Input.GetMouseButtonUp(0))
        {
            manager.End(new Vector2(Input.mousePosition.x, Input.mousePosition.y));
        }
    }
Exemple #3
0
        //Update the Core logic to handle the touches
        void Update()
        {
            //if (m_disclaimer.IsVisible)
            //return;

            //Update the gesture manager
            m_gestureManager.Update();
        }
Exemple #4
0
 private void Update()
 {
     _instance.Update();
 }