// Use this for initialization void Start() { dest = new NavMeshPath(); interaction = GetComponent <ObjectInteraction>(); anim = GetComponent <IiroAnimBehavior>(); objManager = GameObject.FindGameObjectWithTag("ObjectManager").GetComponent <ObjectManager>(); agent = GetComponent <NavMeshAgent>(); tooltip = GameObject.Find("Inventory").GetComponent <Tooltip>(); defaultPosition = transform.position; }
public void Init(GameObject npc, int id) { targetNPC = npc; this.id = id; initialized = true; agent = GetComponent <NavMeshAgent>(); interaction = GetComponent <ObjectInteraction>(); anim = GetComponent <IiroAnimBehavior>(); interaction.setTarget(targetNPC); if (id == 0) { trolley = transform.FindChild("Trolley"); } }