public override void Execute() { if (_leader) { _leader.Idle(); if (_leader.currentHP <= _leader.currentHP / 4) { _leaderFlags.lowHP = true; } else { _leaderFlags.lowHP = false; Vector3 enemyTeamCenter = _leader.EnemyTeamCenter(); if ((enemyTeamCenter - _leader.transform.position).magnitude > _leader.leadStopDistance) { _leaderFlags.inMiddle = false; } } _leader.rb.isKinematic = false; } if (_follower) { _follower.Idle(); if (_follower.currentHP <= _follower.currentHP / 4) { _followerFlags.lowHP = true; } else { _followerFlags.lowHP = false; if (_follower.DistanceToLeader() <= _follower.stopDist) { _followerFlags.isCloseToLeader = true; } else { _followerFlags.isCloseToLeader = false; } } _follower.rb.isKinematic = false; } _treeStart.Execute(); }
public override void Execute() { _follower.mesh.material = _follower.defaultMaterial; if (_follower.DistanceToLeader() <= _stopDistance) { _flags.isCloseToLeader = true; } else { _flags.isCloseToLeader = false; } if (_flags.isCloseToLeader == false) { _follower.Move(); } else { _treeStart.Execute(); } }