Example #1
0
 /// <summary>
 /// 更新状态;
 /// </summary>
 public override void OnUpdateState()
 {
     shopTime += Time.deltaTime;
     if (shopTime > 3)
     {
         //买好东西了,开始付钱;
         doPay();
         HFSMBag.SetSalt(5);
         controller.QuitState();
     }
     else if (shopTime > 2)
     {
         //开始买东西;
         doBuySalt();
     }
 }
 private bool doCook()
 {
     Debug.Log("开始烧饭");
     SetText("开始烧饭");
     return(HFSMBag.EnoughSalt());
 }