Ejemplo n.º 1
0
 public override void OnControllerButtonEvent(BEControllerButtons current, BEControllerButtons down, BEControllerButtons up)
 {
     if (down == BEControllerButtons.ButtonPrimary)
     {
         m_Animator.SetInteger("State", 1);
     }
 }
Ejemplo n.º 2
0
    /**
     * Primary Button interacts, placing and moving items on the ground, or picking up and throwing the ball.
     */
    public void OnButtonEvent(BEControllerButtons current, BEControllerButtons down, BEControllerButtons up)
    {
        if (down == BEControllerButtons.ButtonPrimary && placementRing.activeSelf && placeObjects.Count() > 0)
        {
            GameObject objectToPlace = placeObjects.First();
            placeObjects.RemoveAt(0);
            Vector3 pos = placementRing.transform.position;
            pos.y += FallHeight;             // Fall from above the ground.
            objectToPlace.transform.position = pos;
            objectToPlace.SetActive(true);

            // Reset the object's physics.
            var objectRigidBody = objectToPlace.GetComponent <Rigidbody>();
            if (objectRigidBody)
            {
                objectRigidBody.velocity        = Vector3.zero;
                objectRigidBody.angularVelocity = Vector3.zero;
            }

            // Clean-up if last object is placed in scene.
            if (placeObjects.Count() == 0)
            {
                OnPlaceHilight(false);
                foreach (var trigger in worldEventTriggers)
                {
                    Destroy(trigger);
                }
            }
        }
    }
Ejemplo n.º 3
0
 public override void OnControllerButtonEvent(BEControllerButtons current, BEControllerButtons down, BEControllerButtons up)
 {
     if (current == BEControllerButtons.ButtonPrimary)
     {
         m_Animator.SetTrigger("NextSubState");
     }
 }
Ejemplo n.º 4
0
        public override void OnButtonEvent(BEControllerButtons current, BEControllerButtons down, BEControllerButtons up)
        {
            // Implementing the primary button acceleration
            if (down == BEControllerButtons.ButtonPrimary)
            {
                primaryButtonTimeHeld = 0;
                StartCoroutine(acclerateUntilUnpress());
            }
            else if (down == BEControllerButtons.ButtonSecondary)
            {
                secondaryButtonTimeHeld = 0;
                StartCoroutine(reverseUntilUnpress());
            }

            if (up == BEControllerButtons.ButtonPrimary)
            {
                primaryButtonTimeHeld = -1;
                Debug.Log("In C OnButtonEvent primary button lifted, setting torque to 0");
                m_CarMotionData.motorTorque = 0;
            }
            else if (up == BEControllerButtons.ButtonSecondary)
            {
                Debug.Log("In C OnButtonEvent secondary button lifted setting torque to 0");
                secondaryButtonTimeHeld     = -1;
                m_CarMotionData.motorTorque = 0;
            }
        }
Ejemplo n.º 5
0
 private static void ControllerButtonEventCallback(BEControllerButtons current, BEControllerButtons down, BEControllerButtons up)
 {
     if (BridgeEngineUnity.main != null && BridgeEngineUnity.main.onControllerButtonEvent != null)
     {
         BridgeEngineUnity.main.onControllerButtonEvent.Invoke(current, down, up);
     }
 }
Ejemplo n.º 6
0
 /**
  * Primary Button should advance which render material is shown, and loop back to None.
  */
 public void OnButtonEvent(BEControllerButtons current, BEControllerButtons down, BEControllerButtons up)
 {
     if (down == BEControllerButtons.ButtonPrimary)
     {
         var material = SwitchMaterial();
         Debug.Log("Button Pressed, Advancing Material: <b>" + material.name + "</b>");
     }
 }
Ejemplo n.º 7
0
    /**
     * Pickup/grab this object
     */
    public void OnButtonEvent(BEControllerButtons current, BEControllerButtons down, BEControllerButtons up)
    {
        if ((down & BEControllerButtons.ButtonPrimary) > 0)
        {
            if (hightlightObject.activeSelf)
            {
                grabbing = true;
            }
        }

        if (grabbing && (current & BEControllerButtons.ButtonPrimary) == 0)
        {
            grabbing = false;
        }
    }
Ejemplo n.º 8
0
    void OnButtonEvent(BEControllerButtons buttons, BEControllerButtons buttonsDown, BEControllerButtons buttonsUp)
    {
        appButton.GetComponent <MeshRenderer>().material  = (buttons & BEControllerButtons.ButtonSecondary) > 0 ? activatedMaterial : appButtonMaterial;
        homeButton.GetComponent <MeshRenderer>().material = (buttons & BEControllerButtons.ButtonHomePower) > 0 ? activatedMaterial : homeButtonMaterial;
        trigger.GetComponent <MeshRenderer>().material    = (buttons & BEControllerButtons.ButtonPrimary) > 0 ? activatedMaterial : triggerButtonMaterial;

        if ((buttons & BEControllerButtons.ButtonTouchContact) > 0)
        {
            touch.gameObject.SetActive(true);
            touch.GetComponent <MeshRenderer>().material = (buttons & BEControllerButtons.ButtonTouchpad) > 0 ? activatedMaterial : touchButtonMaterial;
        }
        else
        {
            touch.gameObject.SetActive(false);
        }
    }
Ejemplo n.º 9
0
        /**
         * Primary Button interacts, placing and moving items on the ground, or picking up and throwing the ball.
         */
        public override void OnButtonEvent(BEControllerButtons current, BEControllerButtons down, BEControllerButtons up)

        {
            if (up == BEControllerButtons.ButtonPrimary)
            {
                m_CarMotionData.motorTorque = 0;
            }

            if (down == BEControllerButtons.ButtonSecondary)
            {
                Debug.Log("CarControllerInput_A - OnControllerButton: Reset button sequence being pressed!");
                resetConfirmTime = 0;
                StartCoroutine(CheckButtonHold());
            }

            // New design, pressing the secondary button will reset the car
            if (up == BEControllerButtons.ButtonSecondary)
            {
                resetConfirmTime = -1;
            }

            return;
        }
Ejemplo n.º 10
0
        /**
         * Primary Button interacts, placing and moving items on the ground, or picking up and throwing the ball.
         */
        public virtual void OnButtonEvent(BEControllerButtons current, BEControllerButtons down, BEControllerButtons up)

        {
            //Debug.Log("In Parent OnButtonEvent");
        }
Ejemplo n.º 11
0
 public virtual void OnControllerButtonEvent(BEControllerButtons current, BEControllerButtons down, BEControllerButtons up)
 {
 }