예제 #1
0
    public void Init(string _IdItem, int _iNb)

    {
        idItem = _IdItem;

        if (GetComponent <Behaviour.Monster>() == null)
        {
            InteractionImplementer.Add(new Interaction(Harvest), 1, "Harvest", GameManager.Instance.SpriteUtils.spriteHarvest);
        }
        else
        {
            InteractionImplementer.Add(new Interaction(Harvest), 2, "Fish", GameManager.Instance.SpriteUtils.spriteHarvest);
        }


        itemContainer = new ItemContainer(GameManager.Instance.ItemDataBase.getItemById(_IdItem), quantity);



        if (itemContainer.Item.IngameVisual != null)

        {
            GameObject go = Instantiate(itemContainer.Item.IngameVisual, transform);

            if (go.transform.childCount > 0)

            {
                go.transform.localPosition = go.transform.GetChild(0).localPosition = Vector3.zero;
            }
            else

            {
                go.transform.localPosition = Vector3.zero;
            }



            go.transform.localRotation = Quaternion.identity;

            go.transform.localScale = Vector3.one;
        }

        else

        {
            Debug.Log("Pas de Visuel Ingame pour l'item :\"" + itemContainer.Item.ItemName + "\"");
        }
    }
예제 #2
0
 void Start()
 {
     InteractionImplementer.Add(new Interaction(Pick), 0, "Pick", GameManager.Instance.SpriteUtils.spritePick);
 }