Ejemplo n.º 1
0
    void OnCollisionEnter(Collision collision)
    {
        if (collision.transform.tag == "Chao")
        {
#if NESTLE_RV
            Instantiate(ReferenceManagerDependent.Instance.prefabParticleFallOnGround, collision.GetContact(0).point, ReferenceManagerDependent.Instance.prefabParticleFallOnGround.transform.rotation);
            referenceManagerDependent.SimulationStateController.FailInState("Tente não soltar objetos no chão.", ErrorType.droppedObject);
#endif
            if (handController.GetObjectOnHand(true) == null)
            {
                if (referenceManagerIndependent.PlatformManager.CurrentVRPlatform == VRPlataform.PC)
                {
                    handController.SetObjectOnHand(objectBeingPushed.gameObject, true);
                    objectBeingPushed.enabled = true;
                    objectBeingPushed.ActivateMover(this.gameObject, true);
                    objectBeingPushed.OnExecuted += Finished;
                }
                else
                {
                    this.transform.position = handController.GetHandPosition(true);
                    handController.SetObjectOnHand(this.gameObject, true);
                }
            }
        }
    }