Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using Bolt;
- using Ludiq;
- using UnityEngine.AI;
- using System;
- public class AgentWalkToUnit : Unit
- {
- // Flow
- [DoNotSerialize]
- public ControlInput input;
- [DoNotSerialize]
- public ControlOutput output;
- [DoNotSerialize]
- public ControlOutput finished;
- protected override void Definition()
- {
- input = ControlInput("in", setDestination);
- output = ControlOutput("output");
- finished = ControlOutput("finished");
- }
- protected IEnumerator Await(Flow flow)
- {
- int ticks = 0;
- yield return new WaitUntil(() => {
- ticks += 1;
- return ticks >= 60;
- });
- flow.Invoke(finished);
- }
- protected ControlOutput setDestination(Flow flow)
- {
- flow.coroutineRunner.StartCoroutine(Await(flow));
- return output;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement