Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using AC;
- public class Slots: MonoBehaviour {
- public string slot1;
- public string slot2;
- public string slot3;
- void Start()
- {
- slot1 = LoadProfileVariable(0, 82);
- slot2 = LoadProfileVariable(1, 83);
- slot3 = LoadProfileVariable(2, 84);
- Debug.Log(slot1);
- Debug.Log(slot2);
- Debug.Log(slot3);
- }
- void Update ()
- {
- GlobalVariables.SetStringValue(82, slot1, true);
- GlobalVariables.SetStringValue(83, slot2, true);
- GlobalVariables.SetStringValue(84, slot3, true);
- }
- public string LoadProfileVariable(int profileID, int varID)
- {
- OptionsData profileData = Options.LoadPrefsFromID(profileID);
- string variableData = profileData.linkedVariables;
- string[] varsArray = variableData.Split(SaveSystem.pipe[0]);
- foreach (string chunk in varsArray)
- {
- string[] chunkData = chunk.Split(SaveSystem.colon[0]);
- int _id = 0;
- int.TryParse(chunkData[0], out _id);
- if (_id == varID)
- {
- return chunkData[1];
- }
- }
- return string.Empty;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement