コード例 #1
0
    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++;
        }
    }
コード例 #2
0
 public void SetSelectedObject(ObjClick gb)
 {
     selectedObject = gb;
 }