public UserData()
 {
     id        = 0;
     name      = "";
     highscore = new List <int>();
     inventory = new Inventory();
     equiped   = new Equiped();
 }
Пример #2
0
        public void Unequip(ItemType itemType)
        {
            if (Equiped.ContainsKey(itemType))
            {
                Drawables.Remove(Equiped[itemType].Drawables);
            }

            Equiped.Remove(itemType);
        }
Пример #3
0
 void Start()
 {
     base.Start();
     _amFishing       = false;
     _fishingAttempts = 1;
     _animationRouter = gameObject.GetComponent <AnimationRouter>();
     _equiped         = gameObject.GetComponent <Equiped>();
     _inventory       = gameObject.GetComponent <Inventory>();
 }
Пример #4
0
 public bool IsEquiped(Item item)
 {
     if (Equiped.ContainsKey(item.ItemType))
     {
         return(Equiped[item.ItemType] == item);
     }
     else
     {
         return(false);
     }
 }
Пример #5
0
    void Start()
    {
        _inventory       = gameObject.GetComponent <Inventory>();
        _equiped         = gameObject.GetComponent <Equiped>();
        _mouseController = gameObject.GetComponent <MouseController>();

        for (int i = 0; i < ContainerTransform.childCount; i++)
        {
            _uiContainers.Add(ContainerTransform.GetChild(i));
        }

        foreach (var container in _uiContainers)
        {
            container.gameObject.SetActive(false);
        }
    }
Пример #6
0
    /*public static void AddItemCategory(RPGItemCategory itemCategoryID, List<RPGItemCategory> categories)
     * {
     *      string[] names = new string[categories.Count];
     *      int[] ID = new int[categories.Count];
     *      int index = 0;
     *      foreach(RPGItemCategory item in categories)
     *      {
     *              names[index] = item.Name;
     *              ID[index] = item.ID;
     *              index++;
     *      }
     *
     *      EditorGUILayout.Separator();
     *      EditorGUILayout.BeginHorizontal();
     *
     *      EditorGUILayout.PrefixLabel("Item category");
     *      itemCategoryID.ID = EditorGUILayout.IntPopup(itemCategoryID.ID, names, ID ,GUILayout.Width(300));
     * }*/

    public static void AddEquiped(Equiped equiped, MainWindowEditor Data)
    {
        EditorUtils.Separator();

        equiped.FBXName = EditorUtils.TextField(equiped.FBXName, "FBX location");

        EditorUtils.Label("Equiped slot");

        //EffectUtils.EffectsEditor(equiped.WornEffects, Data, EffectTypeUsage.Equiped);

        //ConditionsUtils.Conditions(equiped.Conditions, Data);

        //equiped.Durability = EditorUtils.IntField(equiped.Durability, "Durability", 300, FieldTypeEnum.WholeLine);

        EditorGUILayout.Separator();
        EditorGUILayout.BeginHorizontal();

        equiped.EquipmentSlotIndex = (EquipmentSlots)EditorGUILayout.EnumPopup(equiped.EquipmentSlotIndex, GUILayout.Width(300));


        /*if (GUILayout.Button("Add slot", GUILayout.Width(150)))
         * {
         *      equiped.EquipmentSlots.Add(new RPGEquipmentSlot());
         * }
         * EditorGUILayout.EndHorizontal();*/

        /*foreach(RPGEquipmentSlot slot in equiped.EquipmentSlots)
         * {
         *      AddEquipmentSlot(slot, Data.equipmentSlotEditor.Slots);
         *
         *      if (GUILayout.Button("Delete", GUILayout.Width(150)))
         *      {
         *              equiped.EquipmentSlots.Remove(slot);
         *              break;
         *      }
         *      EditorGUILayout.EndHorizontal();
         * }*/
    }
Пример #7
0
    /*public static void AddItemCategory(RPGItemCategory itemCategoryID, List<RPGItemCategory> categories)
    {
        string[] names = new string[categories.Count];
        int[] ID = new int[categories.Count];
        int index = 0;
        foreach(RPGItemCategory item in categories)
        {
            names[index] = item.Name;
            ID[index] = item.ID;
            index++;
        }

        EditorGUILayout.Separator();
        EditorGUILayout.BeginHorizontal();

        EditorGUILayout.PrefixLabel("Item category");
        itemCategoryID.ID = EditorGUILayout.IntPopup(itemCategoryID.ID, names, ID ,GUILayout.Width(300));
    }*/
    public static void AddEquiped(Equiped equiped, MainWindowEditor Data)
    {
        EditorUtils.Separator();

        equiped.FBXName = EditorUtils.TextField(equiped.FBXName, "FBX location");

        EditorUtils.Label("Equiped slot");

        //EffectUtils.EffectsEditor(equiped.WornEffects, Data, EffectTypeUsage.Equiped);

        //ConditionsUtils.Conditions(equiped.Conditions, Data);

        //equiped.Durability = EditorUtils.IntField(equiped.Durability, "Durability", 300, FieldTypeEnum.WholeLine);

        EditorGUILayout.Separator();
        EditorGUILayout.BeginHorizontal();

        equiped.EquipmentSlotIndex = (EquipmentSlots)EditorGUILayout.EnumPopup(equiped.EquipmentSlotIndex ,GUILayout.Width(300));

        /*if (GUILayout.Button("Add slot", GUILayout.Width(150)))
        {
            equiped.EquipmentSlots.Add(new RPGEquipmentSlot());
        }
        EditorGUILayout.EndHorizontal();*/

        /*foreach(RPGEquipmentSlot slot in equiped.EquipmentSlots)
        {
            AddEquipmentSlot(slot, Data.equipmentSlotEditor.Slots);

            if (GUILayout.Button("Delete", GUILayout.Width(150)))
            {
                equiped.EquipmentSlots.Remove(slot);
                break;
            }
            EditorGUILayout.EndHorizontal();
        }*/
    }
Пример #8
0
	/*public static void AddItemCategory(RPGItemCategory itemCategoryID, List<RPGItemCategory> categories)
	{
		string[] names = new string[categories.Count];
		int[] ID = new int[categories.Count];
		int index = 0;
		foreach(RPGItemCategory item in categories)
		{
			names[index] = item.Name;
			ID[index] = item.ID;
			index++;
		}
		
		EditorGUILayout.Separator();
		EditorGUILayout.BeginHorizontal();
		
		EditorGUILayout.PrefixLabel("Item category");
		itemCategoryID.ID = EditorGUILayout.IntPopup(itemCategoryID.ID, names, ID ,GUILayout.Width(300));
	}*/
	
	public static void AddEquiped(Equiped equiped, MainWindowEditor Data)
	{
		EditorUtils.Separator();

		for (int i = 0; i < equiped.FBXName.Count; i++) {

			EditorGUILayout.BeginHorizontal();
			EditorGUILayout.PrefixLabel(" FBX location ");
			equiped.FBXName[i] = EditorUtils.TextField(equiped.FBXName[i], "fbxname");
			//DisplayShopItem(item);
			if (GUILayout.Button("Delete", GUILayout.Width(200)))
			{
				equiped.FBXName.Remove(equiped.FBXName[i]);
			}
			EditorGUILayout.EndHorizontal();

		}
		
		if (GUILayout.Button("Add fbx location", GUILayout.Width(200)))
		{
			equiped.FBXName.Add("Armor/");
		}

		EditorUtils.Separator();
		//EffectUtils.EffectsEditor(equiped.WornEffects, Data, EffectTypeUsage.Equiped);
		
		//ConditionsUtils.Conditions(equiped.Conditions, Data);
		
		//equiped.Durability = EditorUtils.IntField(equiped.Durability, "Durability", 300, FieldTypeEnum.WholeLine);
		
		//EditorGUILayout.Separator();
		//EditorGUILayout.BeginHorizontal();
		        
		/*if (GUILayout.Button("Add slot", GUILayout.Width(150)))
		{
			equiped.EquipmentSlots.Add(new RPGEquipmentSlot());
		}
		EditorGUILayout.EndHorizontal();*/
		
		/*foreach(RPGEquipmentSlot slot in equiped.EquipmentSlots)
		{
			AddEquipmentSlot(slot, Data.equipmentSlotEditor.Slots);
			
			if (GUILayout.Button("Delete", GUILayout.Width(150)))
			{
				equiped.EquipmentSlots.Remove(slot);
				break;
			}
			EditorGUILayout.EndHorizontal();
		}*/
	}