private ItemInstances EquipMeshItem(ItemObject itemObject)
        {
            if (itemObject == null)
            {
                return(null);
            }

            Transform[] itemTransforms = combiner.AddMesh(itemObject.modelPrefab);
            if (itemTransforms.Length > 0)
            {
                ItemInstances instances = new ItemInstances();
                instances.items.AddRange(itemTransforms.ToList <Transform>());

                return(instances);
            }

            return(null);
        }
Beispiel #2
0
        private ItemInstances EquipMeshItem(ItemObject itemObject)
        {
            if (itemObject == null)
            {
                return(null);
            }

            Transform[] itemTransforms = combiner.AddMesh(itemObject.modelPrefab);
            if (itemTransforms.Length > 0)
            {
                ItemInstances instances = new GameObject().AddComponent <ItemInstances>();
                foreach (Transform t in itemTransforms)
                {
                    instances.items.Add(t);
                }

                instances.transform.parent = transform;

                return(instances);
            }

            return(null);
        }
        private ItemInstances EquipMeshItem(ItemObject itemObject)
        {
            if (itemObject == null)
            {
                return(null);
            }

            Transform[] itemTransforms = combiner.AddMesh(itemObject.modelPrefab);
            if (itemTransforms.Length > 0)
            {
                ItemInstances instances = new ItemInstances();
                instances.items.AddRange(itemTransforms.ToList <Transform>());
                //foreach (Transform t in itemTransforms)
                //{
                //    instances.items.Add(t);
                //}

                //instances.transform.parent = transform;

                return(instances);
            }

            return(null);
        }