Exemple #1
0
    public void OnClick()
    {
        if (itemData == null)
        {
            Debug.Log("OnClick Node Item null");
            return;
        }
        Debug.Log("OnClick Node");

        var itemPrefab = Resources.Load("Prefabs/Prop/" + itemData.resourceName) as GameObject;
        var item       = Instantiate(itemPrefab) as GameObject;

        var rigid = item.GetComponent <Rigidbody>();

        if (rigid)
        {
            rigid.isKinematic = true;
        }
        //var collider = item.GetComponent<Collider>();
        //if(collider)
        //{
        //    collider.enabled = false;
        //}

        itemBox.DisplayItem(item);
    }