| | |
| | | |
| | | public Tween leaderSequence; |
| | | private int leaderPosIndex = -1; //监工已达移动点 |
| | | private int state = 0; //0 站岗(不显示) 1 前进 2 空手返程 3 货物返程(不中断) |
| | | |
| | | int tendID; |
| | | GoldRushPosEvent[] leaderPathPointArr; //监工移动点 |
| | | |
| | | Action<bool> OnComplete; |
| | | public Action<bool> OnComplete; |
| | | public bool forcrCallBack; |
| | | |
| | | public void Init(GoldRushPosEvent[] _leaderPathPointArr, float waitTime, int _tendID, int index, bool isBack, Action<bool> _OnComplete) |
| | | public void Init(GoldRushPosEvent[] _leaderPathPointArr, float waitTime, int _tendID, int index, bool isBack, |
| | | Action<bool> _OnComplete) |
| | | { |
| | | tendID = _tendID; |
| | | leaderPathPointArr = _leaderPathPointArr; |
| | | leaderPosIndex = !isBack ? -1: leaderPathPointArr.Length - 1; |
| | | state = 0; |
| | | leaderPosIndex = !isBack ? -1 : leaderPathPointArr.Length - 1; |
| | | leaderWord.Stop(); |
| | | leaderWord.SetEndState(); |
| | | // goods.SetActive(isBack); |
| | |
| | | Vector3 nextPos = leaderPathPointArr[moveIndex].transform.localPosition; |
| | | if (isBack) |
| | | { |
| | | if (GoldRushManager.Instance.HasWorking(tendID)) |
| | | if (forcrCallBack) |
| | | { |
| | | leader.PlayAnimation("run", true, false); |
| | | } |
| | | else |
| | | { |
| | | { |
| | | leader.PlayAnimation("run_xiangzi", true, false); |
| | | } |
| | | } |