public Dialogue(string scene_id, CRTScreen sc, Camera mc) { scene = SerializedScenes.szScenes.getScene(scene_id); if (scene == null) { Debug.Log("ERROR: COULD NOT FIND SCENE " + scene_id); return; } char1 = SerializedScenes.szScenes.getCharacter(scene.char1_id); char2 = SerializedScenes.szScenes.getCharacter(scene.char2_id); crt = SerializedScenes.szScenes.getCRTSettings(scene.CRTSettings_id); if (crt == null) { Debug.Log("CANNOT FIND CRT SETTINGS " + scene.CRTSettings_id); } crtScreen = sc; GameSettings.state = GameSettings.GameState.Dialogue; mainCam = mc; orgSettings = sc.settings; sc.settings = crt; CreateObjects(); CreateAudio(scene.music); }
public void Initialize() { character = SerializedScenes.szScenes.getCharacter(character_id); if (character == null) { Debug.Log("Error: cannot find serialiedcharacterinstance '" + character_id + "' in serializedcharacters!"); } }
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; }
public DisplayChar(Vector3 ip, Vector3 tp, Vector3 size, Material mat, SerializedCharacter ch) { targetPosition = tp; go = CreateBox(ip, size, mat, "Textures/Characters/" + ch.texture, Dialogue.getColor(ch.bcolor)); character = ch; }