示例#1
0
 private void CreateVisualTexts(int count, GameObject owner)
 {
     for (int i = 0; i < count; i++)
     {
         GameObject       tmp  = GameObject.Instantiate(pooledObjects[0], owner.transform.position, Quaternion.identity);
         InGameVisualText text = tmp.GetComponent <InGameVisualText>();
         text.Hide();
     }
 }
示例#2
0
    public void ShowDamage(float damage)
    {
        InGameVisualText tmp = visualTexts.Find(x => x.startShowing == false);

        if (tmp == null)
        {
            if (curVisibleVisualTexts.Count > 0)
            {
                curVisibleVisualTexts[0].Hide();
                tmp = curVisibleVisualTexts[0];
                curVisibleVisualTexts.RemoveAt(0);
            }
        }

        tmp.Hide();
        tmp.ShowUp(damage, TextColour.RED, 0.5f);
        curVisibleVisualTexts.Add(tmp);
    }