示例#1
0
	// Use this for initialization
	void Start () {
		myPhotonView = GetComponent<PhotonView>();
		construction = Storage.LoadById<RPGConstruction>(ID, new RPGConstruction());
		constructedNPC = Storage.LoadById<RPGNPC>(NPCID, new RPGNPC());
		if(construction != null)
		{
			GameObject.FindGameObjectWithTag("WorldManager").GetComponent<WorldManager>().AddConstruction(construction);
		}
		for (int i = 0; i < construction.requiredItems.Count; i++) {
			if(construction.requiredItems[i].PreffixTarget == PreffixType.ITEM)
			{
				InventoryItem newInventoryItem = new InventoryItem();
				newInventoryItem.GenerateNewInventoryItem(Storage.LoadById<RPGItem>(construction.requiredItems[i].TaskTarget, new RPGItem()), construction.requiredItems[i].Tasklevel, construction.requiredItems[i].AmountToReach);
				requiredItems.Add(newInventoryItem);
				requiredItemsQuantity.Add(construction.requiredItems[i].AmountToReach);
            }
        }
		if(trigger)
		{
			triggerCollider = trigger.GetComponent<Collider>();
			trigger.transform.localScale = startScale;
		}
		dragDropCollider.enabled = false;
		if(!PhotonNetwork.isMasterClient)
			RequestConstructionUpdate();
	}
	protected override void StartNewIItem()
	{
		currentItem = new RPGConstruction();
	}
	public void DisplayConstruction(RPGConstruction newConstruction)
	{
		state = NPCGUIState.construction;
	}
示例#4
0
	public void AddConstruction(RPGConstruction construction)
	{
		allConstructions.Add(construction);
	}