예제 #1
0
        internal static HapticSequence LoadSequenceFromJson(string jsonPath)
        {
            HapticDefinitionFile hdf = LoadHDFFromJson(jsonPath);

            if (hdf.root_effect.type == "sequence")
            {
                var seq = CodeHapticFactory.CreateSequenceFromHDF(hdf.root_effect.name, hdf);
                return(seq);
            }
            else
            {
                Debug.LogError("Error in LoadSequenceFromJson - likely an invalid path was provided\n\t" + hdf.root_effect.name + " is of type " + hdf.root_effect.type + "\n");
                return(HapticSequence.CreateNew());
                //throw new InvalidOperationException("Unable to load " + hdf.root_effect.name + " as a HapticSequence because it is a " + hdf.root_effect.type);
            }
        }