コード例 #1
0
 public void MoveImage(string path)
 {
     Debug.LogError(Path.Combine(path, ControlString.CutTextAfter(ImageURL1, '\\')));
     if (ImageURL1 != "" && ImageURL1 != null && !File.Exists(Path.Combine(path, ControlString.CutTextAfter(ImageURL1, '\\'))))
     {
         File.Copy(ImageURL1, Path.Combine(path, ControlString.CutTextAfter(ImageURL1, '\\')));
     }
     if (ImageURL2 != "" && ImageURL2 != null && !File.Exists(Path.Combine(path, ControlString.CutTextAfter(ImageURL2, '\\'))))
     {
         File.Copy(ImageURL2, Path.Combine(path, ControlString.CutTextAfter(ImageURL2, '\\')));
     }
 }
コード例 #2
0
    public void make_list()
    {
#if UNITY_EDITOR
        string[] names = get_folder_name(@"C:\Users\holme\Desktop\もいっこ用\TableGameData");
#else
        Debug.LogError("adafsfwef");
        string[] names = get_folder_name(Path.Combine(AppDomain.CurrentDomain.BaseDirectory.TrimEnd('\\'), "TableGameData"));
#endif
        //Debug.LogError(Path.Combine(AppDomain.CurrentDomain.BaseDirectory.TrimEnd('\\'), "TableGameData"));
        foreach (string name in names)
        {
            GameObject Obj = (GameObject)Instantiate(DataNode, this.transform.position, Quaternion.identity);
            Obj.transform.parent = Content.transform;
            Obj.transform.Find("FolderName").GetComponent <Text>().text = ControlString.CutTextAfter(name, '\\');
            Obj.GetComponent <Content>().LoadManager = this.gameObject;
        }
    }
コード例 #3
0
    public void DoneButton()
    {
        GameObject obj = Instantiate(ContentPanel_prefab) as GameObject;

        obj.transform.parent = ScrollViewContent.transform;
        Data data = obj.AddComponent <Data>();

        data.type      = Type_dropdown.captionText.text;
        data.num       = (int)counter.getValue();
        data.imageURL1 = ControlString.CutTextAfter(ImageURL1, '\\');
        obj.GetComponent <ImageName>().ImageURL1 = ImageURL1;
        if (data.type == "piece")
        {
            data.imageURL2 = ControlString.CutTextAfter(ImageURL2, '\\');
            obj.GetComponent <ImageName>().ImageURL2 = ImageURL2;
        }
        if (data.type == "board")
        {
            data.size = (int)boardSizeCounter.getValue();
        }
        obj.GetComponent <GameobjectPanel>().SetManager(this);
        obj.GetComponent <GameobjectPanel>().SetName(data);
    }
コード例 #4
0
    public IEnumerator GetTexture(String url)
    {
        if (ControlString.CutTextAfter(url, '\\') != null)
        {
            Debug.Log(url);
            UnityWebRequest www = UnityWebRequestTexture.GetTexture(url);


            yield return(www.SendWebRequest());

            if (www.isNetworkError || www.isHttpError)
            {
                Debug.Log("ここは->" + AppDomain.CurrentDomain.BaseDirectory.TrimEnd('\\'));
                Debug.LogError("UnityWebRequesT ERROR =>" + url);
                Debug.Log(www.error);
            }
            else
            {
                Texture myTexture = ((DownloadHandlerTexture)www.downloadHandler).texture;
                this.gameObject.GetComponent <Renderer>().material.SetTexture("_MainTex", myTexture);
                Debug.Log("Collect Attach image");
            }
        }
    }