/** Functions that handle various events that are fired throughout the code. **/ public void onGateOpened(string message) { SoomlaUtils.LogDebug(TAG, "SOOMLA/UNITY onGateOpened with message: " + message); Gate gate = SoomlaLevelUp.GetGate(message); LevelUpEvents.OnGateOpened(gate); }
/** Unity-Editor Functions **/ /// <summary> /// Sets the given <c>Gate</c> as open if <c>open</c> is <c>true.</c> /// Otherwise sets as closed. /// </summary> /// <param name="gate">The <c>Gate</c> to open/close.</param> /// <param name="open">If set to <c>true</c> set the <c>Gate</c> to open; /// <param name="notify">If set to <c>true</c> trigger event.</param> protected virtual void _setOpen(Gate gate, bool open, bool notify) { string key = keyGateOpen(gate.ID); if (open) { KeyValueStorage.SetValue(key, "yes"); if (notify) { LevelUpEvents.OnGateOpened(gate); } } else { KeyValueStorage.DeleteKeyValue(key); } }
/** Unity-Editor Functions **/ /// <summary> /// Sets the given <c>Gate</c> as open if <c>open</c> is <c>true.</c> /// Otherwise sets as closed. /// </summary> /// <param name="gate">The <c>Gate</c> to open/close.</param> /// <param name="open">If set to <c>true</c> set the <c>Gate</c> to open;</param> /// <param name="notify">If set to <c>true</c> trigger event.</param> protected virtual void _setOpen(Gate gate, bool open, bool notify) { #if UNITY_EDITOR string key = keyGateOpen(gate.ID); if (open) { PlayerPrefs.SetString(key, "yes"); if (notify) { LevelUpEvents.OnGateOpened(gate); } } else { PlayerPrefs.DeleteKey(key); } #endif }