Ejemplo n.º 1
0
 public void ShoweHudTip(string tip)
 {
     if (hudTextTip == null)
     {
         string _path = "prefabs/uis/p_hud_name";
         hudTextTip = UIMgr.instance.CreateHud(_path, Camera.main, hudAnchor, TIP_OFFSET) as HudLabel;
         UIMgr.instance.SetHudVisible(true, false);
         hudGos.Add(hudTextTip.gameObject);
     }
     hudTextTip.offset = TIP_OFFSET;
     hudTextTip.SetText(tip);
     hudTextTip.SetTextVisible(true);
     Scheduler.RemoveSchedule(tipFloatAction);
     tipFloatAction = Scheduler.Create(this, (sche, t, s) => {
         if (hudTextTip == null)
         {
             return;
         }
         if (t >= s)
         {
             hudTextTip.SetTextVisible(false);
         }
         else
         {
             hudTextTip.offset = TIP_OFFSET + t / s * TIP_FLY_HEIGHT;
         }
     }, 0f, TIP_TIME, 0f).actionId;
 }
Ejemplo n.º 2
0
 public void CreateHudScore(int score)
 {
     if (hutTextScore == null)
     {
         string _path = "prefabs/uis/p_hud_score";
         hutTextScore = UIMgr.instance.CreateHud(_path, Camera.main, hudAnchor, SCORE_OFFSET) as HudLabel;
         UIMgr.instance.SetHudVisible(true, false);
         hudGos.Add(hutTextScore.gameObject);
     }
     hutTextScore.SetText(score.ToString());
 }
Ejemplo n.º 3
0
 public void CreateHudName(string name)
 {
     if (hudTextName == null)
     {
         string _path = "prefabs/uis/p_hud_name";
         hudTextName = UIMgr.instance.CreateHud(_path, Camera.main, hudAnchor, NAME_OFFSET) as HudLabel;
         UIMgr.instance.SetHudVisible(true, false);
         hudGos.Add(hudTextName.gameObject);
     }
     hudTextName.SetText(name);
 }