public GameObject GetDraggingObject(string tag) { Box tBox = BoxViewModel.instance.baseBox.SearchTemplateBox(tag); GameObject obj = BoxPaletteMaterial.Instantiate(materialPrefab.gameObject, DorpPanel, tBox).gameObject; currentDraggObj = obj; return(obj); }
public static BoxPaletteMaterial Instantiate(GameObject prefab, GameObject parent, Box box) { BoxPaletteMaterial obj = Instantiate(prefab, parent.transform).GetComponent <BoxPaletteMaterial>(); obj.icon.sprite = ImageIO.GetIcon(box.iconName); obj.title.text = box.title; obj.tagName = box.tag; Image bg = obj.GetComponent <Image>(); if (box.color.IsPresent()) { bg.color = box.color.ToColor(); } else { bg.color = obj.defaultColor; } return(obj); }
/*public void OnDragMaterial(BoxPaletteMaterial material){ * * } * * public void OnDropDummy(){ * * }*/ public void PutBox(BoxPaletteMaterial material) { BoxViewModel.instance.AddBoxForTag(material.tagName); }
public void AddMaterial(Box box) { BoxPaletteMaterial.Instantiate(materialPrefab.gameObject, noCategorylist, box); }
public void AddMaterial(GameObject prefab, Box box) { BoxPaletteMaterial.Instantiate(prefab, materialList, box); }