Esempio n. 1
0
    //Loads all Controller Layouts
    public static void LoadAllControllerLayouts()
    {
        allAvailableConfigs = new List <ControlLayout>();

        //Get string from Player Prefs
        string toLoad = PlayerPrefs.GetString("ControllerLayouts", "");

        if (toLoad != "")
        {
            //Split the string into each Controller Layout
            string[] inputs = toLoad.Split(';');

            foreach (string inputData in inputs)
            {
                //Parse the controller layout from the string. If an exception is thrown ignore that string
                // try
                //{
                ControlLayout cl = ControlLayout.Parse(inputData);
                allAvailableConfigs.Add(cl);

                /*}
                 * catch (Exception err)
                 * {
                 *  Debug.LogError(err.Message);
                 * }*/
            }
        }

        SetAllControllerLayouts(allAvailableConfigs);
    }
            public override void DoLoad(int _version, BinaryReader _stream)
            {
                allAvailableConfigs = new List <ControlLayout>();

                //Get string from Player Prefs
                string toLoad = _stream.ReadString();

                if (toLoad != "")
                {
                    //Split the string into each Controller Layout
                    string[] inputs = toLoad.Split(';');

                    foreach (string inputData in inputs)
                    {
                        //Parse the controller layout from the string. If an exception is thrown ignore that string
                        // try
                        //{
                        ControlLayout cl = ControlLayout.Parse(inputData);
                        allAvailableConfigs.Add(cl);

                        /*}
                         * catch (Exception err)
                         * {
                         *  Debug.LogError(err.Message);
                         * }*/
                    }
                }

                SetAllControllerLayouts(allAvailableConfigs);
            }