private void Awake() { _inputField.contentType = InputField.ContentType.IntegerNumber; _inputField.onEndEdit.AddListener(OnEndEdit); _onValueChanged = new IntEvent(); }
private void Start() { DefenderSpawner defenderSpawner = FindObjectOfType <DefenderSpawner>(); onStarGeneration = defenderSpawner.getStarGenerationEvent(); }
// Use this for initialization private void Start() { // Initialise variables GameOptions.LoadOptions(); challengeGenerator = GetComponent <ChallengeGenerator>(); challengeGenerator.GenerateChallenges(); audioManager = GetComponent <AudioManager>(); menu = FindObjectOfType <Menu>(); dictData = new DictData(dict); dictData.Setup(); letterList = new DictData(challengesFile); letterList.CleanLetterCombos(); letters = new char[3]; scores = new Scores(); answers = new List <string>(); word = new Word(); input.onEndEdit.AddListener(CheckInput); gameState = GameState.Pregame; IncreasePoints = new IntEvent(); IncreaseTime = new IntEvent(); bannedWords = bannedWordsAsset.ToString().Split('\n').ToList(); for (int i = 0; i < bannedWords.Count(); ++i) { bannedWords[i] = bannedWords[i].TrimEnd('\r'); } // Check if this is the first time the game has been played bool playedBefore = false; for (int mode = 1; mode < 3; ++mode) { // For each game mode for (int diff = 1; diff < 4; ++diff) { // For each difficulty if (scores.GetBestScore((GameMode)mode, (Difficulty)diff) > 0) { // If high score > 0 then played before playedBefore = true; break; } } if (playedBefore) { break; } } // Finished initialising variables // If not played before then start with the tutorial if (!playedBefore) { FindObjectOfType <LogoOpening>().SetNotPlayedBefore(); GameInfo.SetGameMode(GameMode.Welcome); } #if UNITY_IOS || UNITY_ANDROID // Initialise ads on mobile Ads.AdFinished.AddListener(AdCompleted); Ads.AdSkipped.AddListener(AdCompleted); Ads.AdFailed.AddListener(GoToMenu); #endif }
/// <summary> /// UEvent数据写入无返回值字典 /// </summary> /// <param name="int">UEvent</param> /// <param name="key">键</param> public void PutUEventInVoidDic(IntEvent @int, string key) { @int.PutInDic(key); }
public void CreateIntEvent() { intEvent = ScriptableObject.CreateInstance <IntEvent> (); }
public void RaiseInt(int value) { IntEvent?.Invoke(this, new IntEventArgs(value)); }
/// <summary> /// UEvent数据写入无返回值字典 /// </summary> /// <param name="int">UEvent</param> public void PutUEventInVoidDic(IntEvent @int) { @int.PutInDic(); }
static internal void PutInDic(this IntEvent @int) { PutInDic(@int, string.Format("{0}{1}", defaultKey, nameof(IntEvent))); }
static internal void PutInDic(this IntEvent @int, out string key) { key = string.Format("{0}{1}{2}", defaultKey, nameof(IntEvent), KeyForXY(UnityEngine.Random.Range(1, 20), UnityEngine.Random.Range(1, 99))); PutInDic(@int, key); }
public void OnIntEvent(int e) { IntEvent?.Invoke(this, e); }
public static void AddCleanIntListener(this IntEvent @event, UnityAction <int> action) { @event.RemoveListener(action); @event.AddListener(action); }
void Start() { instance = this; gameObject.SetActive(false); ButtonCallback = new IntEvent(); }
public void CallGenericInt() { IntEvent?.Invoke(this, new GenericEventArgs <int>(42)); }
private void Awake() { InventorySlotUpdated = new IntEvent(); InventorySelectedChanged = new IntEvent(); }
public static void AddOnce(this IntEvent thisEvent, UnityAction <int> reciever) { thisEvent.RemoveListener(reciever); thisEvent.AddListener(reciever); }
static internal void PutInDic(this IntEvent @int, string key) { PutInDic <int>(@int, key); }
public void CreateAppEventListenerAndAppEvent() { intEvent = ScriptableObject.CreateInstance <IntEvent> (); listener = new GameObject().AddComponent <IntEventListener> (); }
private void Awake() { OnPopupFermer = new IntEvent(); }