void FixedUpdate() { m_time += Time.deltaTime; m_time_2 += Time.deltaTime; if (m_time > 0.1) { m_time = 0; if (m_test_dmg == true) { TextManager.CreateDamageText(Random.Range(-10, 10).ToString(), this.transform, 0.5f); } else { TextManager.CreateHealText(Random.Range(-10, 10).ToString(), this.transform, 0.5f); } } if (m_time_2 >= 1) { m_time_2 = 0; iteration++; if (iteration == 3) { conversation = TextManager.CreateConversationText("TESTING", this.transform); } if (iteration == 6) { conversation.SetText("This"); m_test_dmg = false; } if (iteration == 9) { conversation.SetColor(TextManager.DAMAGE_COLOR); conversation.SetText("asdasdasdasd asd asdasdasdasdas asddasdasdasdasdasdasd sdas asd"); } if (iteration == 14) { m_test_dmg = true; conversation.DestroyText(); TextManager.CreateYellText("ARGH", this.transform); } if (iteration == 18) { iteration = 0; } } }
private static APopupText CreatePopupText(string text, Transform transform, APopupText popuptext, Color32 color, bool attach_to_object = false, float pad_x = 0, float pad_y = 0) { APopupText instance = Instantiate(popuptext); Vector2 screen; screen = Camera.main.WorldToScreenPoint(new Vector2(transform.position.x + pad_x, transform.position.y + pad_y)); if (!m_screen_canvas) { GameObject screen_canvas = PrefabRepository.instance.TextManagerScreenCanvas; m_screen_canvas = Instantiate(screen_canvas); } instance.transform.SetParent(m_screen_canvas.transform, false); instance.transform.position = screen; instance.SetText(text); instance.SetColor(color); return(instance); }