Esempio n. 1
0
    void DrawCoolDownTask(CSTimer.CdTask coolDownTask)
    {
        GUILayout.BeginVertical("GroupBox");
        {
            GUILayout.Label("name:" + coolDownTask.taskName);
            if (coolDownTask.isValid)
            {
                GUILayout.Label(string.Format("剩余时间:{0}/{1}", coolDownTask.remainTime, coolDownTask.totalTime));
                GUILayout.Label("更新频率:" + coolDownTask.updateFrequence);
                GUILayout.Label("timeScale:" + coolDownTask.timeScale);
                GUILayout.BeginHorizontal();
                if (GUILayout.Button("Finish"))
                {
                    coolDownTask.remainTime = 0f;
                }

                if (GUILayout.Button("Cancel"))
                {
                    mCSTimer.CancelCd(coolDownTask.taskName);
                }

                if (GUILayout.Button(coolDownTask.isPause ? "Resume" : "Pause"))
                {
                    coolDownTask.isPause = !coolDownTask.isPause;
                }
                GUILayout.EndHorizontal();
            }
            else
            {
                GUILayout.Label("已失效");
            }
        }
        GUILayout.EndVertical();
    }