void Awake() { instance = this; cam = Camera.main.gameObject; int i = 0; foreach (var item in selectionObjects) { if (i == 0) { selectedObject = item; } GameObject gb = Instantiate(prefabSelection, objectSelectionContent); gb.GetComponent <Object_Selection_Prefab>().gb = item; gb.GetComponent <Object_Selection_Prefab>().OnInstant(item.showIcon != null ? item.showIcon : item.gb.GetComponent <SpriteRenderer>().sprite); i++; } }
public void SetSelectedObject(ObjClick gb) { selectedObject = gb; }