Ejemplo n.º 1
0
    public override void HaSidoMirado()
    {
        InventarioScript inventario = player.GetComponent <InventarioScript>();

        if (inventario.objetoEnInventario != null)
        {
            if (inventario.objetoEnInventario.tag == this.gameObject.tag)
            {
                audioHole.PlayOneShot(audioHole.clip);
                isActivated = true;
                GameObject objetoADuplicar = inventario.objetoEnInventario;
                GameObject copiaObjeto     = Instantiate(objetoADuplicar);
                copiaObjeto.SetActive(true);
                copiaObjeto.transform.position = new Vector3(this.gameObject.transform.position.x, this.gameObject.transform.position.y + 2, this.gameObject.transform.position.z);
                ColliderLowPolyBox colliderBox = copiaObjeto.GetComponent <ColliderLowPolyBox>();
                copiaObjeto.GetComponent <Renderer>().material.color = Color.white;
                Destroy(colliderBox);
                GvrPointerGraphicRaycaster gaze = copiaObjeto.GetComponent <GvrPointerGraphicRaycaster>();
                Destroy(gaze);
                GvrPointerPhysicsRaycaster physicsRaycaster = copiaObjeto.GetComponent <GvrPointerPhysicsRaycaster>();
                Destroy(physicsRaycaster);
                CheckForRoomSolved();
                inventario.objetoEnInventario = null;
            }
        }
    }
Ejemplo n.º 2
0
        public IEnumerator Start()
        {
            StartCoroutine(Camera.main.fadeIn(3));

            animator = GetComponent <EditorAnimator>();

            // Hook GVR controller ray caster
            controllerRaycaster = FindObjectOfType <GvrPointerPhysicsRaycaster>();
            // Initialize GVR controller swipe monitor
            GvrSwipeMonitor swipeMonitor = FindObjectOfType <GvrSwipeMonitor>();

            swipeMonitor.onSwipeRight += onSwipeRight;
            swipeMonitor.onSwipeLeft  += onSwipeLeft;

            // Init Salesforce client & log in
            sfController = new SalesforceController(this, GetComponent <SalesforceClient>());
            Coroutine <bool> loginRoutine = this.StartCoroutine <bool>(sfController.login());

            yield return(loginRoutine.coroutine);

            loginRoutine.getValue();

            // Load data from Salesforce
            yield return(loadDataFromSalesforce());

            // Load brief movie based on configuration
            FindObjectOfType <BriefVideoMonitor>().loadBrief(ApplicationState.configuration);
        }
Ejemplo n.º 3
0
 void Awake()
 {
     //Rey取得
     gvrRay     = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <GvrPointerPhysicsRaycaster> ();
     lightTrans = lightTrans_obj.GetComponent <LightTransform> ();
     mana_bar   = mana_bar_obj.GetComponent <circleProcess> ();
 }
Ejemplo n.º 4
0
    // Update is called once per frame
    void UpdateStatus()
    {
        GvrPointerPhysicsRaycaster caster = gameObject.GetComponent <GvrPointerPhysicsRaycaster>();
        List <RaycastResult>       hits   = new List <RaycastResult>();

        caster.Raycast(null, hits);

        if (hits.Count >= 1)
        {
            float minDistance = float.MaxValue;
            foreach (RaycastResult r in hits)
            {
                if (r.distance < minDistance)
                {
                    minDistance = r.distance;
                    closestHit  = r.gameObject;
                    hitPoint    = r.worldPosition;
                }
            }
        }
        else
        {
            closestHit = null;
        }

        //debugText.GetComponent<TextMesh>().text = GvrControllerInput.TouchPos.x + " ; " + GvrControllerInput.TouchPos.y;
    }
Ejemplo n.º 5
0
    // Use this for initialization
    void Start()
    {
        //link the reference to the reticle raycaster
        reticle = this.gameObject.GetComponent <GvrPointerPhysicsRaycaster>();

        //by default turn sunIsClickable to false
        sunIsClickable = false;
    }
Ejemplo n.º 6
0
    void Start()
    {
        gvr        = FindObjectOfType <GvrEditorEmulator>();
        gvrPointer = FindObjectOfType <GvrPointerPhysicsRaycaster>();
        //gvr.gameObject.SetActive(false);
        //gvrPointer.enabled = false;

        transform.LookAt(lookAtObjects[0]);
    }
Ejemplo n.º 7
0
    void Start()
    {
        // Getting the reference to the main camera whose gvrpointerphysicsraycaster's
        // layermask we will change.
        if (Camera.main)
        {
            gvrPointerPhysicsRaycaster =
                Camera.main.gameObject.GetComponent <GvrPointerPhysicsRaycaster>();
            if (!gvrPointerPhysicsRaycaster)
            {
                Debug.Log("GVRPointerRaycaster is missing from the scene.");
            }
            else
            {
                string[] layerParams = { "AuthenticatedObjects", "Piece", "InGameGroundMultiplayer", "AIPiece" };   // Other layers like InGameTopMultiplayer, InGameAI shall also be removed and other pieces as well.
                ChangeGVRPointerPhysicsRaycasterEventMask(layerParams, false);
                notAuthenticatedlayerMaskBitConfig = presentlayerMaskBitConfig;
            }
        }
        else
        {
            Debug.Log("Main Camera is missing from the scene.");
        }
        // Subscribing to all the game state events.
        // The first event, for now, which tells when the authentication state changes.
        authManager = AuthenticationManager.Instance;
        authManager.AuthenticationStateChangeEvent.AddListener(AuthenticationStateChangeResponder);

        MultiplayerTableGround.Instance.OnMultiplayerTableGroundClicked
        .AddListener(MultiplayerTableGroundClickedListener);
        EnvironmentUIManagerGO.GetComponent <EnvironmentUIManager>()
        .InGameGroundMultiplayerExitButtonClickedEvent
        .AddListener(ExitGameMultiplayerListener);

        MultiplayerManager.Instance.ChallengeStartedEvent
        .AddListener(ChallengeTurnResponder);
        MultiplayerManager.Instance.ChallengeTurnTakenEvent
        .AddListener(ChallengeTurnResponder);

        ChessAIGameManager.instance.OnGameStarted
        .AddListener(AIGameStartedListener);
    }
Ejemplo n.º 8
0
    private void Raycast()
    {
        GvrPointerPhysicsRaycaster GvrPPR = Camera.main.GetComponent <GvrPointerPhysicsRaycaster>();
        Ray ray = GvrPPR.GetLastRay();

        float dist   = GvrPPR.eventCamera.farClipPlane - GvrPPR.eventCamera.nearClipPlane;
        float radius = GvrPPR.PointerRadius;

        RaycastHit[] hits;

        if (radius > 0.0f)
        {
            hits = Physics.SphereCastAll(ray, radius, dist, GvrPPR.finalEventMask);
        }
        else
        {
            hits = Physics.RaycastAll(ray, dist, GvrPPR.finalEventMask);
        }

        IsAiming = !(hits.Length == 0);
    }
Ejemplo n.º 9
0
 //get current componenets on molecule
 private void getMoleculeComponents()
 {
     sc = molecule.GetComponent <SphereCollider>();
     et = molecule.GetComponent <EventTrigger>();
     gvrPhysicsRaycaster = molecule.GetComponent <GvrPointerPhysicsRaycaster>();
 }