Example #1
0
    public NPCDataPoints GenCredentials(string name, NPCReport parent)
    {
        m_parent = parent;

        if (name == null)
        {
            int randint;
            randint = UnityEngine.Random.Range(0, 5);
            Family  = new Associate[randint];

            for (int i = 0; i < Family.Length - 1; i++)
            {
                Family[i].name = m_parent.Name;
                string[] fname = Family[i].name.Split(new string[] { " " }, StringSplitOptions.None);
                fname[0]       = m_parent.NameGenerator <String[]>(true)[0];
                Family[i].name = string.Join(" ", fname);
            }
        }
        if (name != null)
        {
            return(Resources.Load <NPCDataPoints>("Predefined NPC's/" + name));
        }

        return(this);
    }
Example #2
0
    public virtual void Initialize()
    {
        List_NPC        = new List <GameObject>();
        GS_StateMachine = new StateMachine <BaseNPC>(this);
        type            = NPCType.wanderer;


        GS_StateMachine.ChangeState(Idle.Instance);

        Debug.Log("Potato 1 LoadOrder: BaseNPC name:" + this.name + " || Initialize() || Current State: " + GS_StateMachine.CurrentState.GetType().ToString());
        if (this.GetComponent <NavMeshAgent>() != null)
        {
            Nav_Agent = this.GetComponent <NavMeshAgent>();
        }
        else
        {
            Nav_Agent = this.gameObject.AddComponent(typeof(NavMeshAgent)) as NavMeshAgent;
        }

        npc_details = new NPCReport();
    }