Exemplo n.º 1
0
    }                                                                       // Public property for gazeOver

    private void Awake()
    {
        // Set default references
        gazeManager     = GazeManager.Instance;
        interactiveItem = this.GetComponent <VRInteractiveItem>();
        selectionRadial = Camera.main.GetComponent <SelectionRadial>();
    }
Exemplo n.º 2
0
 private void Awake()
 {
     IsInfo            = true;
     m_InteractiveItem = GetComponent <VRInteractiveItem>();
     m_SelectionRadial = Camera.main.GetComponent <SelectionRadial>();
     origMaterial      = m_Renderer.material;
 }
Exemplo n.º 3
0
 //[SerializeField] private string pName;
 //[SerializeField] private string pInfo;
 //[SerializeField] private Texture pImg;
 private void Awake()
 {
     m_InteractiveItem = GetComponent <VRInteractiveItem>();
     //m_Renderer = GetComponent<MeshRenderer>();
     m_SelectionRadial = Camera.main.GetComponent <SelectionRadial>();
     //origMaterial = m_Renderer.material;
 }
Exemplo n.º 4
0
        private IEnumerator Start()
        {
            Camera camera = m_camInputsManager.CurrentCamera;

            m_cameraFade = camera.GetComponent <CameraFade>();
            m_camera     = camera.transform;

            m_pathWalker = camera.GetComponentInParent <PathWalker>();


            if (m_camInputsManager.CurrentInputName == "Touch")
            {
                m_selectionRadial = m_touch.GetComponent <SelectionRadial>();
                m_reticle         = m_touch.GetComponent <Reticle>();
            }
            else
            {
                m_selectionRadial = camera.GetComponent <SelectionRadial>();
                m_reticle         = camera.GetComponent <Reticle>();
            }
            SessionData.SetGameType(m_gameType);
            //loop to all phases
            while (true)
            {
                yield return(StartCoroutine(StartPhase()));

                yield return(StartCoroutine(PlayPhase()));

                yield return(StartCoroutine(EndPhase()));
            }
        }
Exemplo n.º 5
0
    private void Awake()
    {
        m_InteractiveItem = gameObject.GetComponent <VRInteractiveItem>();
        m_SelectionRadial = GameObject.FindWithTag("MainCamera2").GetComponent <SelectionRadial>();

        mpc = GameObject.Find("sphere").GetComponent <MediaPlayerCtrl>();
    }
Exemplo n.º 6
0
 public void OnPointerExit(PointerEventData eventData)
 {
     if (selectionRadial == null)
     {
         selectionRadial = FindObjectOfType <SelectionRadial>(); // TODO: Find out why it is null sometimes
     }
     PointerExit();
 }
Exemplo n.º 7
0
 private void OnEnable()
 {
     Debug.Log(m_camInputManager.CurrentCamera);
     m_selectionRadial         = m_camInputManager.CurrentCamera.GetComponent <SelectionRadial>();
     m_InteractiveItem.OnOver += HandleOver;
     m_InteractiveItem.OnOut  += HandleOut;
     m_selectionRadial.OnSelectionComplete += HandleSelectionComplete;
 }
Exemplo n.º 8
0
    private bool m_GazeOver;                                                // Whether the user is looking at the VRInteractiveItem currently.


    void Awake()
    {
        m_CameraFade      = Camera.main.gameObject.GetComponent <VRCameraFade> () as VRCameraFade;
        m_SelectionRadial = Camera.main.gameObject.GetComponent <SelectionRadial> () as SelectionRadial;
        m_InteractiveItem = GetComponent <VRInteractiveItem> () as VRInteractiveItem;
        m_ButtonImage     = GetComponent <Image> () as Image;
        m_ButtonCollider  = GetComponent <BoxCollider> () as BoxCollider;
        m_canvas          = m_ButtonImage.canvas;
    }
Exemplo n.º 9
0
        private bool m_GazeOver;                                            // Whether the user is looking at the VRInteractiveItem currently.



        private void OnEnable()
        {
            managerObj                = GameObject.Find("GameManager");
            manager                   = managerObj.GetComponent <GameManager>();
            mainCamera                = GameObject.Find("MainCamera");
            m_SelectionRadial         = mainCamera.GetComponent <SelectionRadial>();
            m_InteractiveItem.OnOver += HandleOver;
            m_InteractiveItem.OnOut  += HandleOut;
            m_SelectionRadial.OnSelectionComplete += HandleSelectionComplete;
        }
Exemplo n.º 10
0
        private bool m_GazeOver;                                            // Whether the user is looking at the VRInteractiveItem currently.

        private void Awake()
        {
            if (m_SelectionRadial == null)
            {
                m_SelectionRadial = FindObjectOfType <SelectionRadial>();
            }
            if (m_InteractiveItem == null)
            {
                m_InteractiveItem = GetComponent <VRInteractiveItem>();
            }
        }
Exemplo n.º 11
0
        private bool m_GazeOver;                                            // Whether the user is looking at the VRInteractiveItem currently.


        private void OnEnable()
        {
            mainCamera                = GameObject.Find("MainCamera");
            m_SelectionRadial         = mainCamera.GetComponent <SelectionRadial>();
            InfoText                  = GameObject.Find("InfoText");
            infoTextBox               = InfoText.GetComponent <Text>();
            UIPicture                 = GameObject.Find("PictureBox");
            pictureBox                = UIPicture.GetComponent <Image>();
            m_InteractiveItem.OnOver += HandleOver;
            m_InteractiveItem.OnOut  += HandleOut;
            m_SelectionRadial.OnSelectionComplete += HandleSelectionComplete;
        }
Exemplo n.º 12
0
    private bool m_GazeOver;                                                        // Whether the user is looking at the VRInteractiveItem currently.


    private void OnEnable()
    {
        attachedButton = GetComponent <Button> ();

        if (this.GetComponent <VRInteractiveItem>() != null)
        {
            m_InteractiveItem = this.GetComponent <VRInteractiveItem> ();
        }

        else
        {
            this.gameObject.AddComponent(typeof(VRInteractiveItem));
            Debug.Log("Attaching VR Interactive Script to this GameObject, it's required");
            m_InteractiveItem = this.GetComponent <VRInteractiveItem> ();
        }

        if (this.GetComponent <BoxCollider>() == null)
        {
            this.gameObject.AddComponent(typeof(BoxCollider));
            GetComponent <BoxCollider> ().size = new Vector3(this.GetComponent <RectTransform> ().rect.width, this.GetComponent <RectTransform> ().rect.height, 1);
            Debug.Log("Attaching Box collider to this GameObject, it's required");
        }

        if (VRInteractiveCamera.GetComponent <VRCameraFade> () != null)
        {
            m_CameraFade = VRInteractiveCamera.GetComponent <VRCameraFade> ();
        }
        else
        {
            Debug.Log("No VRCameraFade Script attached to the VR Interactive Camera, it's required");
        }

        if (VRInteractiveCamera.GetComponent <SelectionRadial>() != null)
        {
            m_SelectionRadial = VRInteractiveCamera.GetComponent <SelectionRadial> ();
        }
        else
        {
            Debug.Log("No SelectionRadial Script attached to the VR Interactive Camera, it's required");
        }

        if (gazeTimeForSelection == 0)
        {
            gazeTimeForSelection = 1;
        }

        m_InteractiveItem.OnOver += HandleOver;
        m_InteractiveItem.OnOut  += HandleOut;
        m_SelectionRadial.OnSelectionComplete += HandleSelectionComplete;
    }
    private void OnEnable()
    {
        slider          = GetComponent <Slider>();
        selectionRadial = Camera.main.GetComponent <SelectionRadial>();

        OnOver  += HandleOver;
        OnOut   += HandleOut;
        OnClick += HandleOnClick;

        float newWidth = GetComponent <RectTransform>().rect.width;

        if (originalWidth == -1 || originalWidth > newWidth)
        {
            originalWidth = newWidth;
        }


        GetComponent <BoxCollider>().size = new Vector3(originalWidth, 20, 0.001f);

        leftSideOfTheSeekBarCollider = transform.Find("LeftSideOfTheSeekBar").GetComponent <BoxCollider>();
        sliderCollider = slider.GetComponent <BoxCollider>();
    }
Exemplo n.º 14
0
    public bool isSelected;  //选中

    private void Awake()
    {
        isSelected        = false;
        m_InteractiveItem = gameObject.GetComponent <VRInteractiveItem>();
        m_SelectionRadial = GameObject.FindWithTag("MainCamera2").GetComponent <SelectionRadial>();
    }
Exemplo n.º 15
0
    // Use this for initialization
    void Start()
    {
        if (gazeTimeForSelection == 0)
        {
            gazeTimeForSelection = 1;
        }

        if (this.GetComponent <VRInteractiveItem> () != null)
        {
            m_InteractiveItem = this.GetComponent <VRInteractiveItem> ();
        }

        else
        {
            Debug.Log("Attaching VR Interactive Script to this GameObject, it's required");
            this.gameObject.AddComponent(typeof(VRInteractiveItem));
            m_InteractiveItem = this.GetComponent <VRInteractiveItem> ();
        }

        if (this.GetComponent <BoxCollider>() == null)
        {
            this.gameObject.AddComponent(typeof(BoxCollider));
            GetComponent <BoxCollider> ().size = new Vector3(this.GetComponent <RectTransform> ().rect.width, this.GetComponent <RectTransform> ().rect.height, 1);
            Debug.Log("Attaching Box collider to this GameObject, it's required");
        }

        if (this.GetComponent <Scrollbar> () != null)
        {
            vScale = this.GetComponent <Scrollbar> ();
        }
        else
        {
            Debug.Log("No Scrollbar component attached to this GameObject, it's required");
        }

        if (this.GetComponent <Scrollbar>().handleRect.gameObject != null)
        {
            sliderHandle = this.GetComponent <Scrollbar>().handleRect.gameObject;
        }
        else
        {
            Debug.Log("No child Handle (GameObject) attached to this GameObject, it's required");
        }

        if (VRInteractiveCamera.GetComponent <SelectionRadial>() != null)
        {
            m_SelectionRadial = VRInteractiveCamera.GetComponent <SelectionRadial> ();
        }
        else
        {
            Debug.Log("No SelectionRadial Script attached to the VR Interactive Camera, it's required");
        }

        if (VRInteractiveCamera.GetComponent <Reticle>() != null)
        {
            reticlePosition = VRInteractiveCamera.GetComponent <Reticle>().ReticleTransform;
        }
        else
        {
            Debug.Log("No Reticle Script attached to the VR Interactive Camera, it's required with it's references");
        }

        sliderHandle.SetActive(false);
    }
Exemplo n.º 16
0
 protected void Awake()
 {
     selectionRadial = FindObjectOfType <SelectionRadial>();
     player          = GameObject.FindGameObjectWithTag("Player");
 }
Exemplo n.º 17
0
    private bool m_GazeOver;                           // Whether the user is looking at the VRInteractiveItem currently.

    void Update()
    {
        m_SelectionRadial = GameObject.Find("MainCamera").GetComponent <SelectionRadial>();
    }
Exemplo n.º 18
0
 // Use this for initialization
 void Awake()
 {
     m_SelectionRadial = GameObject.FindWithTag("MainCamera2").GetComponent <SelectionRadial>();
 }
Exemplo n.º 19
0
        //    private const string k_SliderMaterialPropertyName = "_SliderValue";

        void Start()
        {
            m_VRInput         = GameObject.Find("MainCamera").GetComponent <VRInput>();
            m_SelectionRadial = GameObject.Find("MainCamera").GetComponent <SelectionRadial>();
        }