public override void LoadData(string stringData) { HotspotData data = Serializer.LoadScriptData <HotspotData> (stringData); if (data == null) { return; } if (data.isOn) { gameObject.layer = LayerMask.NameToLayer(KickStarter.settingsManager.hotspotLayer); } else { gameObject.layer = LayerMask.NameToLayer(KickStarter.settingsManager.deactivatedLayer); } if (GetComponent <Hotspot>()) { Hotspot _hotspot = GetComponent <Hotspot>(); StringToButtonStates(_hotspot, data.buttonStates); if (data.hotspotName != "") { _hotspot.SetName(data.hotspotName, data.displayLineID); } } }
override public float Run() { if (hotspot && newName != "") { hotspot.SetName(newName, lineID); } return(0f); }
override public float Run() { if (runtimeHotspot && !string.IsNullOrEmpty(newName)) { runtimeHotspot.SetName(newName, lineID); } return(0f); }
/** * <summary>Deserialises a string of data, and restores the GameObject to its previous state.</summary> * <param name = "stringData">The data, serialised as a string</param> */ public override void LoadData(string stringData) { HotspotData data = Serializer.LoadScriptData <HotspotData> (stringData); if (data == null) { loadedData = false; return; } SavePrevented = data.savePrevented; if (savePrevented) { return; } if (data.isOn) { gameObject.layer = LayerMask.NameToLayer(KickStarter.settingsManager.hotspotLayer); } else { gameObject.layer = LayerMask.NameToLayer(KickStarter.settingsManager.deactivatedLayer); } if (GetComponent <Hotspot>()) { Hotspot _hotspot = GetComponent <Hotspot>(); if (data.isOn) { _hotspot.TurnOn(); } else { _hotspot.TurnOff(); } StringToButtonStates(_hotspot, data.buttonStates); if (data.hotspotName != "") { _hotspot.SetName(data.hotspotName, data.displayLineID); } _hotspot.ResetMainIcon(); } loadedData = true; }