コード例 #1
0
    void Start(){
		info = GameObject.Find("NPCUI").GetComponent<NPC_LootInfo>();

        inventory = GameConstants.getPlayerInventory();
        npcInventory = GameConstants.findPlayerInProject().GetComponent<ToonCharakter_NPCRayCast>();
		iventoryPanel = GameObject.Find (GameConstants.inventoryUI).transform.FindChild ("Inventory_Panel").gameObject;
    }
コード例 #2
0
    new void Start(){
		inventoryPanel = GameObject.Find(panel_name);
        slotPanel = GameObject.Find("NPC_Slot_Panel");
        openText = GameObject.Find("NPC_Text").GetComponent<Text>();
        openText.transform.gameObject.SetActive(false);

        playerInventory = GameConstants.findPlayerInProject().GetComponent<ToonCharacter_Inventory>();

        inventoryPanel.SetActive(false);

        if (slots == null) {
            slots = new List<GameObject>();
        }

        for (int i = 0; i < npcInventoryAmount; i++) {
            slots.Add(Instantiate(inventorySlot));
            slots[i].transform.SetParent(slotPanel.transform);
        }

        lootIDs = GameObject.Find("RolePlayItems").GetComponent<ListWeapons>().getWeapons().Count;
        for (int i = 0; i < npcInventoryAmount; i++) {
            AddWeaponWithID(randomizer.Next(lootIDs), i);
        }

        NPC_Quest = new KillQuest(KillType.Skeleton,
                                          3,
                                          "Hallo, ein paar Skelette haben mich vermöbelt und ich brauche dringend eure Hilfe um mich an Ihnen zu rächen. Bitte Töte ein paar Skelette für mich \n\n Töte " + 3 + " Skelette",
                                          1000,
                                          1000,
                                          null);
    }
コード例 #3
0
 void Start(){
     //Debug.Log("StartInfo");
     info = GameObject.Find("Loot_Info_Panel");
     info.SetActive(false);
     Transform t;
     for (int i = 0; i < info.transform.childCount; i++){
         t = info.transform.GetChild(i);
         if (t.tag.Equals("Inventory_Item_Name")){
             itemName = t.gameObject;
         }else if (t.tag.Equals("Inventory_Item_Image_Container")){
             itemImage = t.GetChild(0).gameObject;
         }else if (t.tag.Equals("Inventory_Item_Description")){
             itemDescription = t.gameObject;
         }else if (t.tag.Equals("Inventory_Item_Value")){
             itemValue = t.gameObject;
         }
     }
     //InitReference To PlayerCharakter and Inventory
     player = GameConstants.findPlayerInProject();
     inventory = player.GetComponent<ToonCharacter_Inventory>();
 }