public void PlayGEMAni(Action callback, Item_Type item_Type)
    {
        GameObject asset = Resources.Load("Prefabs/effect/eff_gem") as GameObject;

        System.Random rd       = new System.Random();
        Sequence      arg_50_0 = DOTween.Sequence();
        Sequence      actions  = DOTween.Sequence();

        arg_50_0.AppendCallback(delegate
        {
            GameObject prefab = UnityEngine.Object.Instantiate <GameObject>(asset);
            prefab.transform.SetParent(this.panel_maxTop.transform, false);
            prefab.transform.localPosition = new Vector3((float)rd.Next(-80, 80), (float)rd.Next(0, 80), 0f);
            prefab.transform.localScale    = new Vector3(0.8f, 0.8f, 0.8f);
            Vector3 position = this.icon_gem.transform.position;
            Tweener t        = prefab.transform.DOMove(position, 0.8f, false).SetEase(Ease.InBack).OnComplete(delegate
            {
                UnityEngine.Object.Destroy(prefab);
            });
            actions.Insert(0f, t);
        }).AppendInterval(0.01f).SetLoops(10);
        actions.OnComplete(delegate
        {
            Action expr_06 = callback;
            if (expr_06 == null)
            {
                return;
            }
            expr_06();
        });
    }
示例#2
0
 // removes an item from players inventory
 public void RemoveItem(Item_Type item)
 {
     if (player_inventory.Contains(item))
     {
         player_inventory.Remove(item);
     }
 }
示例#3
0
 public Item(string name, int value, Item_Type iType, string description = "")
 {
     this.name        = name;
     this.description = description;
     this.value       = value;
     itemType         = iType;
 }
    public void PlayitemAni(Item_Type item_Type)
    {
        AudioManager.GetInstance().PlayEffect("sound_eff_item_get");


        GameObject asset = Resources.Load("Prefabs/effect/eff_gem") as GameObject;

        System.Random rd       = new System.Random();
        Sequence      arg_50_0 = DOTween.Sequence();
        Sequence      actions  = DOTween.Sequence();

        arg_50_0.AppendCallback(delegate
        {
            GameObject prefab = UnityEngine.Object.Instantiate <GameObject>(asset);
            prefab.GetComponentInChildren <Image>().sprite = itme_sp[(int)item_Type];
            prefab.transform.SetParent(this.panel_maxTop.transform, false);
            prefab.transform.localPosition = new Vector3((float)rd.Next(-80, 80), (float)rd.Next(0, 80), 0f);
            prefab.transform.localScale    = new Vector3(0.8f, 0.8f, 0.8f);
            Vector3 position = this.icon_gem.transform.position;
            Tweener t        = prefab.transform.DOMove(position, 0.8f, false).SetEase(Ease.InBack).OnComplete(delegate
            {
                UnityEngine.Object.Destroy(prefab);
            });
            actions.Insert(0f, t);
        }).AppendInterval(0.01f).SetLoops(10);
    }
示例#5
0
        public ActionResult DeleteConfirmed(int id)
        {
            Item_Type item_Type = db.Item_Type.Find(id);

            db.Item_Type.Remove(item_Type);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#6
0
 public Item(string name, int id, string desc, int sp1, Item_Type type)
 {
     item_Name = name;
     item_ID   = id;
     item_Desc = desc;
     item_Icon = Resources.Load <Texture2D>("Item Icons/" + name);
     item_Sp1  = sp1;
     item_Type = type;
 }
示例#7
0
        public Item(String fname, Item_Type ftype, int fcost, Character.Stats.Traits fmod, OtherEffect fce)
        {
            effect = fce;

            cost = fcost;
            mod = fmod;
            name = fname;
            type = ftype;
        }
示例#8
0
        public Item(String fname, Item_Type ftype, int fcost, Character.Stats.Traits fmod)
        {
            effect = new OtherEffect();
            effect.hp = 0;
            effect.mp = 0;

            cost = fcost;
            mod = fmod;
            name = fname;
            type = ftype;
        }
示例#9
0
 private static void ChangePlayerItem(Item_Type item)
 {
     if (holdByPlayer > 0 && holdByPlayer < Item_Type.Size)   // Desativa o item antigo
     {
         itemsImages[(int)holdByPlayer].SetActive(false);
     }
     if (item > 0 && item < Item_Type.Size)   // Ativa o item novo
     {
         itemsImages[(int)item].SetActive(true);
     }
 }
示例#10
0
 public Item(string name, int id, string desc, Item_Type type, GameObject prefab, int stack, bool l0ck)
 {
     item_Name   = name;
     item_ID     = id;
     item_Desc   = desc;
     item_Icon   = Resources.Load <Texture2D>("Item Icons/" + name);
     item_Type   = type;
     item_Prefab = prefab;
     item_Stack  = stack;
     item_Lock   = l0ck;
 }
示例#11
0
 public ActionResult Edit([Bind(Include = "Id,Id_Item,Id_ItemType")] Item_Type item_Type)
 {
     if (ModelState.IsValid)
     {
         db.Entry(item_Type).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Id_Item     = new SelectList(db.Item, "Id", "barcode", item_Type.Id_Item);
     ViewBag.Id_ItemType = new SelectList(db.ItemType, "Id", "Name", item_Type.Id_ItemType);
     return(View(item_Type));
 }
示例#12
0
        protected void insertdata()
        {
            Item_Type newobject = new Item_Type();

            newobject.Item_Type_Name  = TextBoxContacttype.Text;
            newobject.RecTime         = DateTime.Now;
            newobject.Item_Type_Notes = "";
            newobject.UserId          = Convert.ToInt32(Session["userid"]);
            newobject.IsDisable       = false;

            DB.Item_Types.InsertOnSubmit(newobject);
            DB.SubmitChanges();
        }
示例#13
0
        // GET: Item_Type/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Item_Type item_Type = db.Item_Type.Find(id);

            if (item_Type == null)
            {
                return(HttpNotFound());
            }
            return(View(item_Type));
        }
示例#14
0
        // GET: Item_Type/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Item_Type item_Type = db.Item_Type.Find(id);

            if (item_Type == null)
            {
                return(HttpNotFound());
            }
            ViewBag.Id_Item     = new SelectList(db.Item, "Id", "info", item_Type.Id_Item);
            ViewBag.Id_ItemType = new SelectList(db.ItemType, "Id", "Name", item_Type.Id_ItemType);
            return(View(item_Type));
        }
    public void set_gift(int type, int val)
    {
        this.reward_Type = Reward_popop_type.Gift;

        this.item_Type = (Item_Type)type;

        this.type = type;

        img_main.sprite = item_sp[(int)item_Type];
        img_ads.sprite  = item_sp[(int)item_Type];

        this.val = val;

        txt_val.text     = "x" + val;
        txt_ads_val.text = "x" + val * 2;
    }
	void OnGUI(){
		LoadDataBase();
		EditorGUILayout.BeginVertical();
			Item = (Item_Type)EditorGUILayout.EnumPopup("Type:" , Item);
			Name = EditorGUILayout.TextField("Name",Name);
			price = (int)EditorGUILayout.IntSlider("Price",price ,1, 30000);
			rank = (int)EditorGUILayout.IntSlider("Rank",rank ,1, 10);
			sprite = (Sprite)EditorGUILayout.ObjectField (sprite, typeof(Sprite), false);
		if(GUILayout.Button("Done")){
			if(click_count == 0){
				NewItemSelect();
				click_count = 1;
			}
			this.Close();
			this.EndWindows();
		}
		EditorGUILayout.EndVertical();
		
	}
    public void set_Achive(int type)
    {
        this.reward_Type = Reward_popop_type.Achive;

        this.item_Type = Item_Type.coin;

        this.type = type;

        LocalData localData = AchiveData.GetInstance().Get(type);

        TAchive tAchive = Configs.TAchives[localData.key.ToString()];

        img_main.sprite = item_sp[(int)item_Type];
        img_ads.sprite  = item_sp[(int)item_Type];

        this.val = tAchive.Item;

        txt_val.text     = "x" + val;
        txt_ads_val.text = "x" + val * 2;
    }
 void OnGUI()
 {
     LoadDataBase();
     EditorGUILayout.BeginVertical();
     Item   = (Item_Type)EditorGUILayout.EnumPopup("Type:", Item);
     Name   = EditorGUILayout.TextField("Name", Name);
     price  = (int)EditorGUILayout.IntSlider("Price", price, 1, 30000);
     rank   = (int)EditorGUILayout.IntSlider("Rank", rank, 1, 10);
     sprite = (Sprite)EditorGUILayout.ObjectField(sprite, typeof(Sprite), false);
     if (GUILayout.Button("Done"))
     {
         if (click_count == 0)
         {
             NewItemSelect();
             click_count = 1;
         }
         this.Close();
         this.EndWindows();
     }
     EditorGUILayout.EndVertical();
 }
    public void set_Task(int id)
    {
        item_sp = FindObjectOfType <MainScene>().itme_sp;

        this.reward_Type = Reward_popop_type.Task;

        this.item_Type = Item_Type.coin;

        this.type = id;

        LocalData data = TaskData.GetInstance().Get(this.type);

        TTask tTask = Configs.TTasks[data.key.ToString()];

        img_main.sprite = item_sp[(int)item_Type];
        img_ads.sprite  = item_sp[(int)item_Type];

        this.val = tTask.Item;

        txt_val.text     = "x" + val;
        txt_ads_val.text = "x" + val * 2;
    }
示例#20
0
文件: Item.cs 项目: Mimy09/HuntsMan
    public Weapon(Item item, float damage, float critDamage, float critChance, float range, Item_Type type, Func <Unit, Unit, Weapon, bool> callback)
    {
        this.name         = item.name;
        this.description  = item.description;
        this.ID           = item.ID;
        this.actionPoints = item.actionPoints;
        if (mesh != null)
        {
            this.mesh = item.mesh;
        }
        if (icon != null)
        {
            this.icon = item.icon;
        }

        this.damage     = damage;
        this.critChance = critChance;
        this.critDamage = critDamage;
        this.itemType   = type;
        this.range      = range;

        this.callback = callback;
    }
示例#21
0
 // adds item to players inventory
 public void AddItem(Item_Type item)
 {
     player_inventory.Add(item);
 }
示例#22
0
 public Pokeball(string name, int value, Item_Type type = Item_Type.Pokeball, string description = "") : base(name, value, Item_Type.Pokeball, description)
 {
     this.name        = name;
     this.description = description;
     this.value       = value;
 }
示例#23
0
 public Medicine(string name, int value, Item_Type type = Item_Type.Medicine, string description = "") : base(name, value, Item_Type.Medicine, description)
 {
     this.name        = name;
     this.description = description;
     this.value       = value;
 }
示例#24
0
 public BattleItem(string name, int value, Item_Type type = Item_Type.Battle_Item, string description = "") : base(name, value, Item_Type.Battle_Item, description)
 {
     this.name        = name;
     this.description = description;
     this.value       = value;
 }
示例#25
0
 public Item(String n)
 {
     name = n;
     Item_Notes = "";
     item_type = Item_Type.Default;
 }
示例#26
0
 public Item(String n, String new_notes)
 {
     name = n;
     Item_Notes = new_notes;
     item_type = Item_Type.Default;
 }
示例#27
0
 public static Sprite Get_Item_Sp(Item_Type num)
 {
     return(Resources.Load <Sprite>("Item/item_" + (int)num));
 }
示例#28
0
 public void AddDiscardItem(Item_Type item)
 {
     player_discards.Add(item);
 }