public override IScriptableEntry Execute(ICarActionable reciever) { //TODO: get acceleration value from linked sensor Debug.Log($"Set acceleration to {this.acceleraton}"); reciever.SetForwardAcceleration(this.acceleraton); return(this.child); }
public override IScriptableEntry Execute(ICarActionable reciever) { if (this.switchInput.Sense(reciever)) { return(this.nestedChild); } return(this.child); }
public void ExecuteBehavior(ICarActionable target) { var acceleration = maxAcceleration; var farFrontSensor = target.GetCarSensor <bool>(CarSensorTypes.FrontFar); var frontSensor = target.GetCarSensor <bool>(CarSensorTypes.Front); if (farFrontSensor.Sense()) { acceleration = -maxAcceleration / 2; } if (frontSensor.Sense()) { acceleration = -maxAcceleration; } target.SetForwardAcceleration(acceleration); //this.GetCarAction<ICarFloatAction>(actions, CarActionTypes.SetAcceleration)?.Execute(acceleration); }
public void ExecuteBehavior(ICarActionable target) { if (this.currentPointers == null || this.currentPointers.Count <= 0) { return; } Debug.Log($"Executing {currentPointers.Count} pointers"); var nextPointers = new HashSet <IScriptableEntry>(); foreach (var pointer in this.currentPointers) { if (pointer != null) { var mono = pointer as MonoBehaviour; Debug.Log($"Executing {mono?.name} pointer"); nextPointers.Add(pointer.Execute(target)); } } this.currentPointers = nextPointers; }
public override IScriptableEntry Execute(ICarActionable reciever) { if (this.firstBoolInput != null) { if (this.firstBoolInput.Sense(reciever)) { reciever.SetForwardVelocity(0); } else { reciever.SetForwardVelocity(1); } } else { //TODO: grab velocity from linked sensor object reciever.SetForwardVelocity(1); } return(this.child); }
public override IScriptableEntry Execute(ICarActionable reciever) { return(this.child); }
public override IScriptableEntry Execute(ICarActionable reciever) { return(null); }
public override IScriptableEntry Execute(ICarActionable reciever) { return(this.pairedNestedParent); }
public abstract IScriptableEntry Execute(ICarActionable reciever);