示例#1
0
        public void PrepareBattle(ArenaManager subject)
        {
            OnBlockEvent?.Invoke(actionBlocks);

            switch (GetComponent <GroupFinder>().Group.ThisGroupName)
            {
            case GroupManager.Group.GroupAzure:
                StartCoroutine(ScriptedMovement(subject.Group0StartPosition.position, subject));
                break;

            case GroupManager.Group.GroupPink:
                StartCoroutine(ScriptedMovement(subject.Group1StartPosition.position, subject));
                break;

            case GroupManager.Group.GroupGreen:
                StartCoroutine(ScriptedMovement(subject.Group2StartPosition.position, subject));
                break;

            case GroupManager.Group.GroupYellow:
                StartCoroutine(ScriptedMovement(subject.Group3StartPosition.position, subject));
                break;

            case GroupManager.Group.All:
                break;

            case GroupManager.Group.None:
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
        private IEnumerator ScriptedMovement(Vector3 targetPosition, ArenaManager arenaManager)
        {
            _agent.enabled = true;
            _agent.SetDestination(targetPosition);
            _animator.ForceMove(true);

            while (Vector3.Distance(transform.position, targetPosition) >= 1.5f)
            {
                yield return(null);
            }

            _animator.ForceMove(false);
            arenaManager.NotifyBattlePrepared(this);
            _agent.enabled = false;
        }
 public void ExitBattle(ArenaManager subject)
 {
 }
 public void EnterBattle(ArenaManager subject)
 {
     OnUnblockEvent?.Invoke(actionBlocks);
 }
        public void PrepareBattle(ArenaManager subject)
        {
            OnBlockEvent?.Invoke(actionBlocks);

            StartCoroutine(ScriptedMovement(subject.PlayerStartPosition.position, subject));
        }
 private void Awake()
 {
     _arenaManager = transform.root.GetComponent <ArenaManager>();
 }