コード例 #1
0
        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);
                }
            }
        }
コード例 #2
0
ファイル: ActionRename.cs プロジェクト: IJkeB/Ekster1
        override public float Run()
        {
            if (hotspot && newName != "")
            {
                hotspot.SetName(newName, lineID);
            }

            return(0f);
        }
コード例 #3
0
        override public float Run()
        {
            if (runtimeHotspot && !string.IsNullOrEmpty(newName))
            {
                runtimeHotspot.SetName(newName, lineID);
            }

            return(0f);
        }
コード例 #4
0
        /**
         * <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;
        }