GameMachine.NpcGroup.GetNpcList C# (CSharp) Method

GetNpcList() public method

public GetNpcList ( ) : List
return List
        public List<Npc> GetNpcList()
        {
            return npcs;
        }

Usage Example

示例#1
0
        private void CalculateTarget()
        {
            if (action == Action.Attack)
            {
                controller.updateAgentDestination = true;
                return;
            }


            controller.SetPlayerSpeed(0f);

            if (group != null)
            {
                if (group.IsLeader(this))
                {
                    if (group.route != null)
                    {
                        route = group.route;
                        SetTargetFromWaypoint();
                    }
                }
                else if (group.leader != null)
                {
                    if (group.formation == NpcGroup.Formation.SingleFile)
                    {
                        target = group.GetNpcList()[order - 1].transform;
                    }
                    else
                    {
                        if (group.GetFollowTargets().ElementAtOrDefault(order) != null)
                        {
                            target = group.GetFollowTargets()[order];
                        }
                        else
                        {
                            target = group.leader.transform;
                        }
                    }
                }
            }
            else
            {
                if (route != null)
                {
                    SetTargetFromWaypoint();
                }
            }
            controller.updateAgentDestination = true;
        }