Beispiel #1
0
    private void BuildItemInteractables()
    {
        StartConversationScreen scs = (StartConversationScreen)GetScreen(ScreenID.StartConversation);

        foreach (Item item in items)
        {
            GameObject clone = Instantiate(itemPrefab, item.position, Quaternion.identity);

            ItemClone itemClone = clone.GetComponent <ItemClone>();
            itemClone.Init(item);

            itemPooler.SetPoolable(clone);
            clone.SetActive(true);

            playerController.RegisterItemEvents(item);
            scs.RegisterItem(item);
        }
    }
Beispiel #2
0
    private void BuildNPCInteractables()
    {
        StartConversationScreen scs         = (StartConversationScreen)GetScreen(ScreenID.StartConversation);
        ConversationScreen      convoScreen = (ConversationScreen)GetScreen(ScreenID.Conversation);

        foreach (Conversation npc in npcs)
        {
            GameObject clone = Instantiate(npcPrefab, npc.position, Quaternion.identity);

            NPC cloneNPC = clone.GetComponent <NPC>();
            cloneNPC.Init(npc);

            npcPooler.SetPoolable(clone);
            clone.SetActive(true);
            clone.transform.position = npc.position;

            scs.RegiserterNPC(cloneNPC);
            convoScreen.RegiserterNPC(cloneNPC);
        }
    }