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; }
private void CreateObjects() { mainCam.enabled = false; // mainCam.SetActive(false); dCam = new GameObject("DialogueCam"); dCam.transform.position = new Vector3(0, 0, -8); // dCam.transform.rotation = Quaternion.Euler(0, 0, 180); Camera cam = dCam.AddComponent <Camera>(); cam.clearFlags = CameraClearFlags.Color; cam.backgroundColor = Color.black; gos.Add(dCam); float dx = -4; float y = 1f; float w = 0; float z = 1; float k = 1.3f; gos.Add(DisplayChar.CreateBox(new Vector3(0, 0, 10.5f), new Vector3(40, 30, w), GameSettings.BillboardMaterial, "Textures/Background/" + scene.background, Color.white)); dchar1 = new DisplayChar(new Vector3(dx * 100, y, z), new Vector3(dx, y, z), new Vector3(7 * k, 5 * k, w), GameSettings.BillboardMaterial, char1); dchar2 = new DisplayChar(new Vector3(-dx * 100, y, z), new Vector3(-dx, y, z), new Vector3(7 * k, 5 * k, w), GameSettings.BillboardMaterial, char2); }