Beispiel #1
0
 public void OnInput(ref Context context)
 {
     context.Active(this);
     context.SetValue(this, new RotateNodeData()
     {
         Value = UnityEngine.Random.Range(0.1f, 0.2f)
     });
 }
Beispiel #2
0
 public BehaviorStatus BehaviorInput(ref Context context)
 {
     context.Active(this);
     context.SetValue(this, new RotateNodeData()
     {
         Value     = 0,//UnityEngine.Random.Range(0.1f, 0.2f),
         StartTime = Time.time
     });
     return(BehaviorStatus.Running);
 }
Beispiel #3
0
    public BehaviorStatus BehaviorInput(ref Context context)
    {
        if (_random.state == 0 || _random.state == 0x6E624EB7u)
        {
            _random = new Random(2251);
        }
        context.Active(this);
        var duration = _random.NextFloat(DurationRangeS, DurationRangeE);

        var t = (float)context.EntityManager.World.Time.ElapsedTime;

        Debug.Log($"X:{context.CurrentEntity.Index} == {t}=={duration}");
        context.SetValue(this, new MoveNodeStatus
        {
            Start    = t,
            Duration = duration
        });
        return(BehaviorStatus.Running);
    }