Example #1
0
    void OnTriggerEnter2D(Collider2D col)
    {
        ItemActivate item = itemGO.GetComponent <ItemActivate> ();

        if (col.tag == "Player")
        {
            foreach (bool value in item.getHaveItemArray())
            {
                if (value)
                {
                    item.setItemActive(false);
                    col.gameObject.transform.position = warp.position;
                    Camera.main.transform.position    = warp.position;
                    item.setItemActive(true);
                    return;
                }
                else
                {
                    col.gameObject.transform.position = warp.position;
                    Camera.main.transform.position    = warp.position;
                    return;
                }
            }
        }
    }
Example #2
0
 public Item(string name, int id, string desc, ItemType type, ItemActivate obj)
 {
     itemName   = name;
     itemID     = id;
     itemDesc   = desc;
     itemIcon   = Resources.Load <Texture2D>("Item Icons/" + name);
     itemType   = type;
     itemObject = obj;
 }
Example #3
0
    public virtual bool Activate(string activeCase)
    {
        if (ItemActivate != null)
        {
            ItemActivate.Invoke(Id);
        }

        //Remove(true);

        return(true);
    }
Example #4
0
 protected virtual void OnItemActivate(EventArgs e)
 {
     ItemActivate?.Invoke(this, e);
 }