Ejemplo n.º 1
0
        private void Restore()
        {
            foreach (GameObject g in gos)
            {
                GameObject.Destroy(g);
            }

            if (dBubble != null)
            {
                dBubble.Destroy();
            }
            if (textGO != null)
            {
                textGO.Destroy();
            }
            dchar1.Destroy();
            dchar2.Destroy();
            mainCam.enabled    = true;
            crtScreen.settings = orgSettings;
            if (aus != null)
            {
                aus.Stop();
                aus.clip = orgClip;
                aus.Play();
            }
        }
Ejemplo n.º 2
0
        private void CreateDialogueBubble(SerializedCharacter ch, string text)
        {
            if (dBubble != null)
            {
                dBubble.Destroy();
            }



            dBubble = new DisplayChar(new Vector3(0, -30, 0), new Vector3(0, -3, 0), new Vector3(18, 3, 0), GameSettings.BubbleMaterial, currentChar);
            //            dBubble.transform.position = new Vector3(0, -3, 0);
            //          dBubble.transform.localScale = new Vector3(18, 3, 0);
            //            tgo.transform.position = Vector3
            //tgo.transform.position = Vector3.zero;
            //SpriteRenderer s = tgo.AddComponent<SpriteRenderer>();
            //s.sprite =

            //            bubbleMaterial = new Material(GameSettings.BubbleMaterial.shader);
            //          dBubble.GetComponent<Renderer>().material = bubbleMaterial;
            //        bubbleMaterial.SetColor("_bgcolor", getColor(ch.bcolor));



            if (textGO != null)
            {
                textGO.Destroy();
            }


            textGO = new DisplayChar(new Vector3(-80, -2f, -0.1f), new Vector3(-7, -2f, -0.1f), Vector3.one);
            //((new GameObject("Text");
            //textGO.go.transform.position = new Vector3(-8, -1.7f, -0.1f);

            textMesh               = textGO.go.AddComponent <TextMesh>();
            textMesh.font          = (Font)Resources.Load("Fonts/" + ch.font);
            textMesh.text          = text;
            textMesh.color         = getColor(ch.fcolor);
            textMesh.fontSize      = 40;
            textMesh.characterSize = 0.2f;

            MeshRenderer rend = textGO.go.GetComponentInChildren <MeshRenderer>();

            rend.material = textMesh.font.material;
        }