Exemple #1
0
    public void ToFile()
    {
        Debug.Log("Starting Write");
        GyroInstructionSet instructions = new GyroInstructionSet(_instructions);

        if (!AssetDatabase.IsValidFolder("Assets/GyroInstructions"))
        {
            AssetDatabase.CreateFolder("Assets", "GyroInstructions");
        }

        File.WriteAllText(Application.dataPath + "/GyroInstructions/" + _output + ".json", JsonUtility.ToJson(instructions));
        Debug.Log("Finished Write");
    }
 void Awake()
 {
     _instructions = JsonUtility.FromJson <GyroInstructionSet>(_instructionSet.text);
 }