Esempio n. 1
0
        public void Show(DPOverlayBase dpBase, Vector3 pos, string name, Texture2D icon)
        {
            //if (currentDP == dpBase) return;

            //Unsub from events:
            if (currentDP != null)
            {
                currentDP.onOverlayDragged -= dragAction;
            }


            currentDP = dpBase;

            //Sub to events
            dragAction = currentDP.onOverlayDragged += delegate(bool b) {
                if (!b)
                {
                    InitUI(currentDP);
                }
            };

            InitUI(dpBase);

            textCurrent.SetText(name);
            iconCurrent.texture = icon;


            /*transCalcHMDDir.position = SteamVRManager.I.hmdTrans.position;
             * transCalcHMDDir.LookAt(dpBase.transform);*/


            //windowSettingsDP.OrphanOverlay();

            windowSettingsTopDP.SetOverlayTransform(new Vector3(0f, 0.36f, 0f), new Vector3(0f, 0f, 15f), true, true, true);

            windowSettingsDP.KillTransitions();

            windowSettingsDP.transform.position = pos;
            windowSettingsDP.transform.LookAt(2 * windowSettingsDP.transform.position - SteamVRManager.I.hmdTrans.position);

            windowSettingsDP.SyncTransform();

            windowSettingsCurrentDP.SetOverlayTransform(new Vector3(0f, 0.36f, 0), Vector3.zero);

            //dpBase.AddChildOverlay(windowSettingsDP);


            DPUIManager.Animate(windowSettingsDP, DPAnimations.FadeIn);

            isActive = true;
        }