Exemplo n.º 1
0
    public void OpenDetail()
    {
        UIManager.UIData data = UIManager.Instance.Open(UIID.PlaceDetail);
        GameObject       obj  = data.UIObject;

        if (obj != null)
        {
            PlaceDetailUI pdui = obj.GetComponent <PlaceDetailUI> ();
            pdui.SetPlace(info);
        }
    }
Exemplo n.º 2
0
    public void PressHello()
    {
        UIManager.Instance.Close(gameObject);
        UIManager.UIData data = UIManager.Instance.Open(UIID.Talk);
        GameObject       obj  = data.UIObject;

        if (obj != null)
        {
            TalkUI pdui = obj.GetComponent <TalkUI> ();
            pdui.SetName(_info.Name);
        }
    }
Exemplo n.º 3
0
    public void SetState(GuideState state)
    {
        _State = state;
        Debug.Log(_State);
        if (_State == GuideState.StartGuide)
        {
            UIManager.UIData uiData = UIManager.Instance.Open(UIID.Main);
            MainUI = uiData.UIObject;
        }
        else if (_State == GuideState.PutBox)
        {
            UIManager.Instance.ShowMessage("点击屏幕摆放猫盆");
        }
        else if (_State == GuideState.GotoStore)
        {
            UIManager.Instance.ShowMessage("前往商店购买猫粮");
            MainUI ui = MainUI.GetComponent <MainUI> ();
            ui.ShowStoreBtn();
        }
        else if (_State == GuideState.PutGoodies)
        {
            UIManager.Instance.ShowMessage("点击猫盆放置猫粮");
        }
        else if (_State == GuideState.GotoStorage)
        {
            UIManager.Instance.ShowMessage("前往仓库使用猫窝");
        }
        else if (_State == GuideState.PutCatHouse)
        {
            UIManager.Instance.ShowMessage("点击屏幕摆放猫窝");
        }
        else if (_State == GuideState.OK)
        {
            MainUI ui = MainUI.GetComponent <MainUI>();
            ui.ShowHandbookBtn();

            /*
             * SceneCat cat = MapSceneManager.Instance.CreateSceneCat (104, Vector3.zero, Quaternion.identity);
             * cat.thisT.localRotation = Quaternion.Euler (90, 0, 0);
             * cat.thisT.position = Vector3.zero;
             #if !UNITY_EDITOR
             * TangoManager.Instance.SceneUnit2ARUnit (cat);
             #endif*/
        }
    }
Exemplo n.º 4
0
    public override void OnInit()
    {
        base.OnInit();

        Mic             = gameObject.AddComponent <SpectrumMicrophone> ();
        Mic.CaptureTime = 1;
        Mic.SampleRate  = 1024;

        if (UsePlotter)
        {
            UIManager.UIData data = UIManager.Instance.Open(UIID.Plotter);
            if (data != null)
            {
                GameObject plane  = data.UIObject;
                Transform  plane1 = plane.transform.FindChild("planeLeft");
                RendererSpectrumLeft = plane1.GetComponent <Image> ();
                Transform plane2 = plane.transform.FindChild("planeRight");
                RendererSpectrumRight = plane2.GetComponent <Image> ();
                Transform plane3 = plane.transform.FindChild("planeWave");
                RendererWave = plane3.GetComponent <Image> ();
            }
//			planes = new GameObject ();
//			planes.name = "planes";
//			GameObject planeLeft = GameObject.CreatePrimitive (PrimitiveType.Plane);
//			planeLeft.GetComponent<Collider> ().enabled = false;
//			planeLeft.transform.position = new Vector3 (5.1f, 0, 10);
//			planeLeft.transform.parent = planes.transform;
//			planeLeft.layer = LayerMask.NameToLayer ("UI");
//			RendererSpectrumLeft = planeLeft.GetComponent<MeshRenderer> ();
//
//			GameObject planeRight = GameObject.CreatePrimitive (PrimitiveType.Plane);
//			planeRight.GetComponent<Collider> ().enabled = false;
//			planeRight.transform.position = new Vector3 (-5.1f, 0, 10);
//			planeRight.transform.parent = planes.transform;
//			planeRight.layer = LayerMask.NameToLayer ("UI");
//			RendererSpectrumRight = planeRight.GetComponent<MeshRenderer> ();
//
//			GameObject planeWave = GameObject.CreatePrimitive (PrimitiveType.Plane);
//			planeWave.GetComponent<Collider> ().enabled = false;
//			planeWave.transform.position = new Vector3 (0, 0, -1);
//			planeWave.transform.localScale = new Vector3 (2, 1, 1);
//			planeWave.transform.parent = planes.transform;
//			planeWave.layer = LayerMask.NameToLayer ("UI");
//			RendererWave = planeWave.GetComponent<MeshRenderer> ();
//
//			//planes.AddComponent<Billboard> ();
//			planes.transform.localPosition
//			= new Vector3 (1f
//				, 3.3f
//				, 1f);
//			planes.transform.localRotation = Quaternion.Euler (100.30659f, 186.228242f, 185.8563f);
//			planes.transform.localScale = new Vector3(0.05f,0.05f,0.05f);
//			planes.transform.parent = Camera.main.transform;
//			planes.layer = LayerMask.NameToLayer ("UI");
        }

        if (MaterialSpectrumLeft &&
            RendererSpectrumLeft)
        {
            RendererSpectrumLeft.material = (Material)UnityEngine.Object.Instantiate(MaterialSpectrumLeft);
        }

        if (MaterialSpectrumRight &&
            RendererSpectrumRight)
        {
            RendererSpectrumRight.material = (Material)UnityEngine.Object.Instantiate(MaterialSpectrumRight);
        }

        if (MaterialWave &&
            RendererWave)
        {
            RendererWave.material = (Material)UnityEngine.Object.Instantiate(MaterialWave);
        }

        if (null == m_textureSpectrumLeft &&
            RendererSpectrumLeft)
        {
            m_textureSpectrumLeft                     = new Texture2D(TextureSize, TextureSize, TextureFormat.ARGB32, false);
            m_textureSpectrumLeft.wrapMode            = TextureWrapMode.Clamp;
            m_textureSpectrumLeft.filterMode          = FilterMode.Point;
            m_textureSpectrumLeft.anisoLevel          = 0;
            RendererSpectrumLeft.material.mainTexture = m_textureSpectrumLeft;
            m_colorsSpectrumLeft = m_textureSpectrumLeft.GetPixels32();
        }

        if (null == m_textureSpectrumRight &&
            RendererSpectrumRight)
        {
            m_textureSpectrumRight                     = new Texture2D(TextureSize, TextureSize, TextureFormat.ARGB32, false);
            m_textureSpectrumRight.wrapMode            = TextureWrapMode.Clamp;
            m_textureSpectrumRight.filterMode          = FilterMode.Point;
            m_textureSpectrumRight.anisoLevel          = 0;
            RendererSpectrumRight.material.mainTexture = m_textureSpectrumRight;
            m_colorsSpectrumRight = m_textureSpectrumRight.GetPixels32();
        }

        if (null == m_textureWave &&
            RendererWave)
        {
            m_textureWave                     = new Texture2D(TextureSize, TextureSize, TextureFormat.ARGB32, false);
            m_textureWave.wrapMode            = TextureWrapMode.Repeat;
            m_textureWave.filterMode          = FilterMode.Point;
            m_textureWave.anisoLevel          = 0;
            RendererWave.material.mainTexture = m_textureWave;
            m_colorsWave = m_textureWave.GetPixels32();
        }

        m_plotter.TextureSize = TextureSize;
    }