当前位置: 首页>>代码示例>>C#>>正文


C# TextAsset.ToString方法代码示例

本文整理汇总了C#中UnityEngine.TextAsset.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# TextAsset.ToString方法的具体用法?C# TextAsset.ToString怎么用?C# TextAsset.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UnityEngine.TextAsset的用法示例。


在下文中一共展示了TextAsset.ToString方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LevelData

    public LevelData(string pathToJson)
    {
        jsonFile = Resources.Load(pathToJson) as TextAsset;

        platforms = new List<PlatformData> ();
        IDictionary dictionary = (IDictionary) Json.Deserialize (jsonFile.ToString());
        RXDebug.Log ("this is the json file: "+jsonFile.ToString());
        IList platform_list = (IList) dictionary ["Platforms"];
        setPlatformData (platform_list);
    }
开发者ID:riktothepast,项目名称:Futile_TileMap_AABB,代码行数:10,代码来源:LevelData.cs

示例2: splitTheStrings

    public void splitTheStrings(TextAsset theJourney)
    {
        string[] splitStrings = theJourney.ToString().Split(new string[]{"\r\n"}, StringSplitOptions.RemoveEmptyEntries);

        //INITIALIZE ALL THE LISTS
        int temp = splitStrings.Length;
        Debug.Log(temp);
        notes = new string[temp];
        index = new int[temp];
        killQuests = new string[temp];
        killOptionals = new string[temp];
        fetchQuests = new string[temp];
        lootQuests = new string[temp];
        payQuests = new string[temp];
        readQiests = new string[temp];

        for(int i=1; i< splitStrings.Length; i++) // Skip the title row
        {
            string[] columns = splitStrings[i].Split(new string[]{","}, StringSplitOptions.None);

            //EACH COLUMN GETS PULLED INTO A DIFFERENT LIST
            notes[i] = columns[0];
            index[i] = int.Parse(columns[1]);
            killQuests[i] = columns[2];
            killOptionals[i] = columns[3];
            fetchQuests[i] = columns[4];
            lootQuests[i] = columns[5];
            payQuests[i] = columns[6];
            readQiests[i] = columns[7];
        }
    }
开发者ID:snotwadd20,项目名称:UnityLevelGen,代码行数:31,代码来源:Journey.cs

示例3: SpriteSheet

	Vector2[] animation_scale;		// dim.x/dim.y
	
	// Constructor
	public SpriteSheet(Material mat, TextAsset data) {
		material = mat;
				// Create an instance of StreamReader to read from a file.
		string lines = data.ToString();
		string[] line = lines.Split("\n"[0]);
		int curLine = 0;
		
		// Read and display lines from the file until the end of the file is reached.
		animation_names = line[curLine].Split(","[0]);
		
		curLine++;
		animation_frames = ssTools.stringToVector2(line[curLine].Split("-"[0]));
		
		curLine++;
		animation_fps = ssTools.stringToFloat(line[curLine].Split(","[0]));
		
		// Wrap mode
		curLine++;
		animation_wrap_mode = ssTools.stringToInt(line[curLine].Split(","[0]));
		
		curLine++;
		animation_play_on_wake = ssTools.stringToBool(line[curLine].Split(","[0]));

		curLine++;
		animation_offset = ssTools.stringToVector2(line[curLine].Split("-"[0]));			
		
		// Get xScale and yScale values
		curLine++;
		animation_scale = ssTools.stringToVector2(line[curLine].Split("-"[0]));
		
		// Get image pixel dimensions.  Used for scaling mesh at runtime.
		curLine++;
		animation_dimensions = ssTools.stringToVector2(line[curLine].Split("-"[0]));

	}
开发者ID:logikstate,项目名称:simplesprite,代码行数:38,代码来源:SpriteSheet.cs

示例4: sendText

 public void sendText(TextAsset incoming) {
     GetComponent<Text>().text = "";
     textAsset = incoming;
     chars = textAsset.ToString().ToCharArray();
     max = chars.Length;
     counter = 0;
     lastLetter = false;
 }
开发者ID:ashleycrouch,项目名称:space,代码行数:8,代码来源:TextDialogue.cs

示例5: Awake

    void Awake()
    {
        databattle = Resources.Load("data_battle") as TextAsset;
        Debug.Log(databattle);

        lstCharater = new Dictionary<int, GameObject>();

        JObject data= JObject.Parse(databattle.ToString());

        startdata = JsonConvert.DeserializeObject<ThuocTinh[]>(data["data"]["startData"].ToString());
        stepdata = JsonConvert.DeserializeObject<StepData[]>(data["data"]["stepData"].ToString());
    }
开发者ID:quocvu0312,项目名称:Card-Battle,代码行数:12,代码来源:BattleControls.cs

示例6: Parse

    public static List<pointOfSail> Parse(TextAsset csvString)
    {
        //get the array of lines
        List<pointOfSail> arrayPointOfSail = new List<pointOfSail>();
        string[] arrayOfLines = csvString.ToString().Split ("\n" [0]);

        //take each line, split by comma, and then populate list at that index
        for (int i=0; i<arrayOfLines.Length; i++) {
            string[] arrayOfStrings = arrayOfLines[i].Split(","[0]);
            pointOfSail tempPOS =  new pointOfSail(arrayOfStrings[0],float.Parse(arrayOfStrings[1]));
            arrayPointOfSail.Add(tempPOS);
        }
        return arrayPointOfSail;
    }
开发者ID:paleonluna,项目名称:ASAGoSailingApp,代码行数:14,代码来源:TextParser.cs

示例7: Parse

    public List<List<string>> Parse(TextAsset csvString)
    {
        //get the array of lines
        string[] arrayOfLines = csvString.ToString().Split ("\n" [0]);

        //take each line, split by comma, and then populate list at that index
        for (int i=0; i<arrayOfLines.Length; i++) {
            string[] arrayOfStrings = arrayOfLines[i].Split(","[0]);
            listOfStrings.Add (new List<string>());
            for (int j=0; j<arrayOfStrings.Length; j++){
                string temp = arrayOfStrings[j].Replace('|',',');

                listOfStrings[i].Add (temp);
            }
        }
        return listOfStrings;
    }
开发者ID:paleonluna,项目名称:DevryApp,代码行数:17,代码来源:CSVParser.cs

示例8: Start

    // Use this for initialization
    void Start()
    {
        file = Resources.Load ("Puzzle") as TextAsset;
        //This is the file to be used.
        //if you want to use your own file. Right now you have to open it in unity
        //and put the file in the resources folder and change its name to Puzzle
        //MUST BE A .TXT FILE

                stringArray = file.ToString ().Split ("\n" [0]);

                //sr = new StreamReader (Resources.Load ("Puzzle"));

                setup ();
                zones.Add (zone1);
                zones.Add (zone2);
                zones.Add (zone3);
                zones.Add (zone4);
                zones.Add (zone5);
                zones.Add (zone6);
                zones.Add (zone7);
                zones.Add (zone8);
                zones.Add (zone9);
    }
开发者ID:jtuxbury,项目名称:Sudoku,代码行数:24,代码来源:Spawner.cs

示例9: changeState

	void changeState() {	
		//update textAsset object and set text object
		curText = Resources.Load(myState.ToString()) as TextAsset;
		text.text = curText.ToString();
	}
开发者ID:JimHawking11,项目名称:Udemy-Lessons,代码行数:5,代码来源:TextController.cs

示例10: ParseJSON

 private static void ParseJSON(TextAsset json)
 {
     ParseJSONString(json.ToString());
 }
开发者ID:igrir,项目名称:MateAnimator,代码行数:4,代码来源:AnimatorTimeline.cs

示例11: LoadLanguageFile

        private static void LoadLanguageFile(string languageId, TextAsset asset = null)
        {
            // load json file from Resources folder
			if (asset == null)
				asset = Resources.Load(dataDirectory + "text_" + languageId) as TextAsset;

            // parse language data
            if (asset != null)
            {
                Dictionary<string, string> languageData = _data[languageId];

                JSONObject data = JSONObject.Parse(asset.ToString());
                foreach (var item in data)
                {
                    languageData[item.Key] = item.Value.Str;
                }
            }
        }
开发者ID:paveltimofeev,项目名称:GameJamFramework,代码行数:18,代码来源:TextManager.cs

示例12: LoadConfigFile

		private static void LoadConfigFile(TextAsset asset = null)
        {
            // load config from Resources folder
			if (asset == null)
            asset = Resources.Load(dataDirectory + "languages") as TextAsset;

            // parse config file
            if (asset != null)
            {
                JSONObject data = JSONObject.Parse(asset.ToString());
                foreach (var item in data)
                {
                    if (item.Key == "languages")
                    {
                        var languageList = item.Value.Array;
                        foreach (var languageName in languageList)
                        {
                            AddLanguage(languageName.Str);
                        }
                    }
                    else if (item.Key == "standard")
                    {
                        _standardLanguage = item.Value.Str;
                    }
                }
            }
        }
开发者ID:paveltimofeev,项目名称:GameJamFramework,代码行数:27,代码来源:TextManager.cs


注:本文中的UnityEngine.TextAsset.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。