protected override Status OnDo() { First.Do(); Status status = First.Status; if (status == Status.Succ) { return(Status.Fail); } else if (status == Status.Fail) { return(Status.Succ); } else { throw new System.Exception("不允许Running"); } }
protected override Status OnDo() { float v = UnityEngine.Random.value; bool ret = (v < _prob.Value); if (_prob.Value >= 1.0f) { ret = true; } if (_prob.Value <= 0.0f) { ret = false; } if (ret) { First.Do(); } return(Status.Bool(ret)); }