public PutExtra ( string paramName, ArrayList, arrayList ) : void | ||
paramName | string | |
arrayList | ArrayList, | |
Résultat | void |
public void UpdateWindowButtons() { Parameters btnUpdate = new Parameters(); btnUpdate.PutExtra(AdvNames.ON_FIRST_NODE, advReader.OnFirstTextNode()); btnUpdate.PutExtra(AdvNames.ON_LAST_NODE, advReader.OnLastTextNode()); EventBroadcaster.sharedInstance.NotifyObserver(AdvNames.ON_WINDOW_BTN_CLICKED, btnUpdate); if (advReader.OnLastTextNode()) { StartCoroutine(PostButtonUpdate()); } }
public IEnumerator PostButtonUpdate() { while (!advWriter.isDone) { yield return null; } Parameters btnUpdate = new Parameters(); btnUpdate.PutExtra(AdvNames.ON_FIRST_NODE, advReader.OnFirstTextNode()); btnUpdate.PutExtra(AdvNames.ON_LAST_NODE, advReader.OnLastTextNode()); ArrayList choices = new ArrayList(advReader.GetChoices()); btnUpdate.PutExtra(AdvNames.WINDOW_CHOICES, choices); EventBroadcaster.sharedInstance.NotifyObserver(AdvNames.ON_POST_WINDOW_BTN_CLICKED, btnUpdate); }
public void PostDenominatorEvent(float denominator) { Parameters parameters = new Parameters(); parameters.PutExtra(YarnballUI.YARNBALL_VALUE, denominator); EventBroadcaster.Instance.PostEvent(EventNames.ON_DENOMINATOR_CHANGE, parameters); }
/// <summary> /// Registers block to the data recorder to be used when the room's stability is being determined. /// </summary> public void RegisterBlock() { Parameters data = new Parameters(); data.PutExtra("hollowBlock", this); EventBroadcaster.Instance.PostEvent(EventNames.ON_BLOCK_SPAWN, data); }
private IEnumerator EnemySighted() { while (!enemySighted.HasSighted()) { yield return(null); } enableDialogue(); //I see an enemy ahead, suggest hammer Parameters data; while (GameController_v7.Instance.GetDialogueManager().IsDialogueBoxPlaying()) { data = new Parameters(); data.PutExtra("x", enemy.gameObject.transform.position.x); data.PutExtra("y", enemy.gameObject.transform.position.y); EventBroadcaster.Instance.PostEvent(EventNames.ZOOM_CAMERA_TOWARDS, data); disablePlayerControls(); yield return(null); } data = new Parameters(); data.PutExtra("shouldZoomIn", false); EventBroadcaster.Instance.PostEvent(EventNames.SHOULD_CAMERA_ZOOM_IN, data); // ToggleMobileUI (true); // playerController.canMove (true); // playerAttack.canAttack (true); EnablePlayerControls(); StartCoroutine(Fighting()); // StartCoroutine (Searching ()); }
private void DisplayRingDropRule() { // Display message about ring sizes and order Parameters p = new Parameters(); p.PutExtra("message", "Whoops! You can only drop a ring onto a larger one!"); EventBroadcaster.PostEvent(EventNames.DisplayMessage, p); }
public void ToggleSwitchWeaponButton(bool flag) { #if UNITY_ANDROID Parameters parameters = new Parameters(); parameters.PutExtra("FLAG", flag); EventBroadcaster.Instance.PostEvent(EventNames.TOGGLE_SWITCH_WEAPON_BUTTON, parameters); #endif }
/// <summary> /// Broadcasts the max point to be used by the room's stability number line. /// </summary> public void PostSetMaxPointEvent() { Debug.LogError("POSTED PARAM with value " + this.maxPoint); Parameters parameters = new Parameters(); parameters.PutExtra(StabilityNumberLine.MAX_POINT, this.maxPoint); EventBroadcaster.Instance.PostEvent(EventNames.SET_MAX_POINT, parameters); }
public void TogglePickupButton(bool flag) { #if UNITY_ANDROID Parameters parameters = new Parameters(); parameters.PutExtra("FLAG", flag); EventBroadcaster.Instance.PostEvent(EventNames.TOGGLE_PICKUP_BUTTON, parameters); #endif }
public void ReturnCamera() { Parameters data = new Parameters(); data.PutExtra("shouldZoomIn", false); EventBroadcaster.Instance.PostEvent(EventNames.SHOULD_CAMERA_ZOOM_IN, data); EventBroadcaster.Instance.PostEvent(EventNames.ENABLE_CAMERA); }
public IEnumerator PostButtonUpdate() { while (!advWriter.isDone) { yield return(null); } Parameters btnUpdate = new Parameters(); btnUpdate.PutExtra(AdvNames.ON_FIRST_NODE, advReader.OnFirstTextNode()); btnUpdate.PutExtra(AdvNames.ON_LAST_NODE, advReader.OnLastTextNode()); ArrayList choices = new ArrayList(advReader.GetChoices()); btnUpdate.PutExtra(AdvNames.WINDOW_CHOICES, choices); EventBroadcaster.sharedInstance.NotifyObserver(AdvNames.ON_POST_WINDOW_BTN_CLICKED, btnUpdate); }
/// <summary> /// Raises the destroy event. /// </summary> void OnDestroy() { Parameters data = new Parameters(); data.PutExtra("enemyHealth", this); EventBroadcaster.Instance.PostEvent(EventNames.UNREGISTER_ENEMY, data); EventBroadcaster.Instance.RemoveActionAtObserver(EventNames.INVULNERABLE_ENEMIES, this.Invulnerable); EventBroadcaster.Instance.RemoveActionAtObserver(EventNames.VULNERABLE_ENEMIES, this.Vulnerable); }
public void OnButton3Click() { Parameters param = new Parameters(); AdvChoices button = buttons[2] as AdvChoices; param.PutExtra(AdvNames.CHOICE_BTN_ID, button.name); EventBroadcaster.sharedInstance.NotifyObserver(AdvNames.ON_CHOICE_BTN_CLICKED, param); Utils.DisableAllChildren(transform); }
/// <summary> /// Prompt to save the player's data. /// </summary> void SaveData() { Debug.Log("Save data triggered from save point"); savePointText.Hide(); Parameters parameters = new Parameters(); parameters.PutExtra("IS_HARD_SAVE", true); EventBroadcaster.Instance.PostEvent(EventNames.SAVE_DATA, parameters); }
public void Show() { EventBroadcaster.Instance.PostEvent(EventNames.HIDE_SKINS); gameObject.transform.GetChild(0).GetChild(0).gameObject.SetActive(true); Parameters parameters = new Parameters(); parameters.PutExtra("SKIN_NAME", skinName); EventBroadcaster.Instance.PostEvent(EventNames.UPDATE_SKIN_NAME, parameters); }
void ToggleMobileUI(bool flag) { #if UNITY_ANDROID // EventManager.Instance.ToggleMobileControls(flag); // TODO: // GameController_v7.Instance.GetEventManager().ToggleMobileControls(flag); Parameters parameters = new Parameters(); parameters.PutExtra("FLAG", flag); EventBroadcaster.Instance.PostEvent(EventNames.TOGGLE_MOBILE_UI, parameters); #endif }
IEnumerator NotMatch() { Parameters checkParams = new Parameters(); checkParams.PutExtra(KeyNames.KEY_IS_MATCH, false); yield return(new WaitForSeconds(0.5f)); EventBroadcaster.Instance.PostEvent(EventNames.ON_TOGGLE_ACTIVE); EventBroadcaster.Instance.PostEvent(EventNames.ON_TILES_CHECKED, checkParams); }
public override void OnTrackerUpdate(Status newStatus) { base.OnTrackerUpdate(newStatus); if (newStatus == Status.TRACKED) { Parameters textParameter = new Parameters(); textParameter.PutExtra("DISPLAY_TEXT", "Scanned! Now scan the second image target."); EventBroadcaster.Instance.PostEvent(EventNames.ARPhysics_Events.ON_ANCHOR_TARGET_SCAN, textParameter); } }
// private CameraZoom cameraZoom; // Tuple<Entry.Type, int> currentKey; // LCDEntry entry; // EnemyEntry enemyEntry; // Use this for initialization void Start() { // pauseController = GameObject.FindGameObjectWithTag ("GameController").GetComponent<PauseController> (); // pauseController.PauseGame (); GameController_v7.Instance.GetPauseController().Pause(); EventBroadcaster.Instance.PostEvent(EventNames.DISABLE_CAMERA); Parameters data = new Parameters(); data.PutExtra("x", gameObject.transform.position.x); data.PutExtra("y", gameObject.transform.position.y); EventBroadcaster.Instance.PostEvent(EventNames.ZOOM_CAMERA_TOWARDS, data); // Camera.main.GetComponent<CameraController>().enabled = false; // cameraZoom = Camera.main.GetComponentInChildren<CameraZoom> (); // cameraZoom.ZoomTowards (gameObject.transform.position); // enemyEntry = DataManager.GetEnemyEntry(enemyHealth.GetEnemyKey()); // enemyEntry.hammerValue = (int)hammer.denominator; }
void ToggleMobileUI(bool flag) { #if UNITY_ANDROID // EventManager.Instance.ToggleMobileControls(flag); // GameController_v7.Instance.GetEventManager().ToggleMobileControls(flag); // TODO check // GameController_v7.Instance.GetDialogueManager ().DisplayMessage (DialogueManager_v2.DialogueType.DIALOGUE, dialogue, // null); Parameters parameters = new Parameters(); parameters.PutExtra("FLAG", flag); EventBroadcaster.Instance.PostEvent(EventNames.TOGGLE_MOBILE_UI, parameters); #endif }
/// <summary> /// Unity Function. Called once upon creation of the object. /// </summary> void Awake() { ringleaderController = GetComponent <RingleaderController>(); ringleaderAnimatable = GetComponent <RingleaderAnimatable> (); EventBroadcaster.Instance.AddObserver(EventNames.INVULNERABLE_ENEMIES, this.Invulnerable); EventBroadcaster.Instance.AddObserver(EventNames.VULNERABLE_ENEMIES, this.Vulnerable); Parameters data = new Parameters(); data.PutExtra("enemyHealth", this); EventBroadcaster.Instance.PostEvent(EventNames.REGISTER_ENEMY, data); }
private void OnCorrect() { correctHits++; lblCorrect.text = "CORRECT: " + correctHits; // Shake screen CameraShake.Shake(0.25f, 2f); if (correctHits < LevelManager.Instance.GetGoalHitCount()) { return; } // Pass player's score var parameters = new Parameters(); parameters.PutExtra(LevelManager.PARAM_WIN_CORRECT_COUNT, correctHits); parameters.PutExtra(LevelManager.PARAM_WIN_WRONG_COUNT, wrongHits); EventBroadcaster.Instance.PostEvent(EventNames.ON_WIN, parameters); }
/// <summary> /// Raises the destroy event. /// </summary> void OnDestroy() { Parameters data = new Parameters(); data.PutExtra("hollowBlock", this); EventBroadcaster.Instance.PostEvent(EventNames.ON_BLOCK_DESTROY, data); // TODO Check if this is right //EventBroadcaster.Instance.RemoveObserver(EventNames.SPAWN_BLOCKS_PROCESS_ON); EventBroadcaster.Instance.RemoveObserver(EventNames.SPAWN_BLOCKS_PROCESS_OFF); // this.Break (); }
/// <summary> /// Sets the maximum value of the number line. /// </summary> /// <param name="maxPoint">Max Point</param> public void SetMaxPoint(int maxPoint) { // ADDED MAX if (maxPoint < 1) { maxPoint = 1; } this.maximum = maxPoint; Parameters parameters = new Parameters(); parameters.PutExtra(StabilityMaxPointLabelListener.NEW_MAX, this.maximum); EventBroadcaster.Instance.PostEvent(EventNames.STABILITY_MAX_CHANGE, parameters); }
public void OnClick() { if (active) { tileImage.enabled = true; questionText.enabled = false; active = false; Parameters parameters = new Parameters (); parameters.PutExtra (KeyNames.KEY_TILE_TYPE, this.tileType); EventBroadcaster.Instance.AddObserver (EventNames.ON_TILES_CHECKED, this.OnTilesChecked); EventBroadcaster.Instance.PostEvent (EventNames.ON_TILE_CLICKED, parameters); } }
public void OnSpawnClicked() { if (this.inputField.text != "") { int numBalls = int.Parse(this.inputField.text); Debug.Log("Num balls to spawn is: " + numBalls); Parameters parameters = new Parameters(); parameters.PutExtra(BallObjectCreator.NUM_BALLS_KEY, numBalls); EventBroadcaster.Instance.PostEvent(BallSpawnEventNames.ON_SPAWN_EVENT, parameters); } }
public void UpdateCurrency(CurrencyType currency, int amountAdded) { if (currency == CurrencyType.COIN) { var coins = PlayerData.PlayerCurrency.Coins; PlayerData.PlayerCurrency.Coins += amountAdded; PlayerData.PlayerCurrency.Coins = Mathf.Max(PlayerData.PlayerCurrency.Coins, 0); } else if (currency == CurrencyType.KAPPA_TOKEN) { var kappaTokens = PlayerData.PlayerCurrency.KappaTokens; PlayerData.PlayerCurrency.KappaTokens += amountAdded; PlayerData.PlayerCurrency.KappaTokens = Mathf.Max(PlayerData.PlayerCurrency.KappaTokens, 0); } Parameters parameters = new Parameters(); parameters.PutExtra("KappaTokens", SaveDataManager.Instance.PlayerSaveData.PlayerCurrency.KappaTokens); parameters.PutExtra("Coins", SaveDataManager.Instance.PlayerSaveData.PlayerCurrency.Coins); EventBroadcaster.Instance.PostEvent(EventNames.Currency.ON_SET_CURRENCY, parameters); }
//======================// // This is for when player detects correct hit. public void OnUpdateScore() { currentGold++; // Increase spawn rates and speed IncreaseDifficulty(); // Update current score var param = new Parameters(); param.PutExtra(PlayScreen.PARAM_CURRENT_SCORE, currentGold); EventBroadcaster.Instance.PostEvent(EventNames.ON_UPDATE_GOLD_UI, param); }
void RecordData() { // parameters.PutExtra ("TIME_NEEDLE_REMOVED", System.DateTime.Now.ToString()); // parameters.PutExtra ("OBJECT_GIVEN", ""); // parameters.PutExtra ("ACTUAL_ANSWER", ""); // parameters.PutExtra ("ATTEMPTED_ANSWERS", ""); // parameters.PutExtra ("TIME_SOLVED", System.DateTime.Now.ToString()); // parameters.PutExtra ("NEEDLE_INTERACTION_COUNT", ""); // parameters.PutExtra ("NUMBER_OF_ATTEMPTS", ""); // EventBroadcaster.Instance.PostEvent (EventNames.ON_NEEDLE_HIT, parameters); currentKey = new Tuple <Entry.Type, int>(Entry.Type.PartitionableObject, PlayerData.partitionableObjectIndex); // if (!DataManager.DoesKeyExist(currentKey)) Debug.Log("Current " + currentKey.Item1 + " " + currentKey.Item2); if (poBoxKey != null) { Debug.Log("PO Box " + poBoxKey.Item1 + " " + poBoxKey.Item2); } if (poBoxKey == null) { entry = new POEntry(); entry.name = "Box " + PlayerData.partitionableObjectIndex; entry.timeWeaponInteracted = new List <DateTime> (); entry.timeWeaponInteracted.Add(System.DateTime.Now); entry.interactionCount++; Parameters parameters = new Parameters(); parameters.PutExtra("TYPE", Entry.Type.PartitionableObject.ToString()); parameters.PutExtra("NUMBER", PlayerData.partitionableObjectIndex); DataManager.CreateEmptyEntry(parameters); poBoxKey = currentKey; PlayerData.IncrementPOIndex(); } else { entry = DataManager.GetPOEntry(poBoxKey); entry.timeWeaponInteracted.Add(System.DateTime.Now); entry.interactionCount++; } }
public override void DestroyElement() { GameObject explosion = SSObjectPool.sharedInstance.GetObject(SSObjectID.EXPLOSION_MISSILE); if (explosion != null) { explosion.transform.position = transform.position; explosion.SetActive(true); } Parameters param = new Parameters(); param.PutExtra(SSNames.ADDITIONAL_SCORE, SSGameSettings.SCORE_POINTS); EventBroadcaster.sharedInstance.NotifyObserver(SSNames.ON_SCORE_CHANGED, param); base.DestroyElement(); }
public void DeactivateEvents() { GameController_v7.Instance.GetPauseController().Continue(); #if UNITY_ANDROID //// GameController_v7.Instance.GetEventManager().DisableInteractButton(); // EventManager.ToggleSwitchButton (true); // GameController_v7.Instance.GetEventManager().ToggleLeftRightButtons(true); // EventBroadcaster.Instance.PostEvent (EventNames.DISABLE_INTERACT); Parameters parameters = new Parameters(); parameters.PutExtra("FLAG", true); EventBroadcaster.Instance.PostEvent(EventNames.TOGGLE_SWITCH_WEAPON_BUTTON, parameters); EventBroadcaster.Instance.PostEvent(EventNames.TOGGLE_LEFT_RIGHT_BUTTONS, parameters); #endif }
/// <summary> /// If the player is in vicinity of the door, another room is loaded and the current room is unloaded, bringing the player avatar to a new room. /// </summary> public void Enter() { if (this.isRandomDestination) { if (PedagogicalComponent_v2.Instance.CurrentTopic() == SceneTopic.NONE) { this.goingTo = SceneNames.BETA_TESTING_PRE_BOSS; } else { this.goingTo = SceneNames.RandomSceneName(); if (GameController_v7.Instance.RoomCountCheck()) { this.goingTo = SceneNames.BETA_TESTING_RANDOM_END; } } } Debug.Log("Player Went In " + goingTo + " " + doorNumber); // spawnPointManager.UpdatePreviousScene (SceneManager.GetActiveScene ().name, this.doorNumber); GameController_v7.Instance.UpdatePreviousScene(SceneManager.GetActiveScene().name, this.doorNumber); GameController_v7.Instance.GetObjectStateManager().RecordPlayerStats(); // objectStateManager.RecordPlayerStats (); Parameters parameters = new Parameters(); parameters.PutExtra("IS_HARD_SAVE", false); EventBroadcaster.Instance.PostEvent(EventNames.SAVE_DATA, parameters); // EventManager.RemoveHintOnTrigger (); EventBroadcaster.Instance.PostEvent(EventNames.REMOVE_HINT); EventManager.ResetTriggerSceneTitle(); #if UNITY_ANDROID // EventManager.EnableBothButtons (); #endif //Load Scene Connected to this entrance. LoadingScreen loadingScreen = FindObjectOfType <LoadingScreen>(); if (loadingScreen != null) { loadingScreen.LoadScene(goingTo, false); } else { Instantiate(loadingScreenPrefab); } // SceneManager.LoadScene (goingTo); }
// Shows left, right, and jump only // public void ToggleBaseControls(bool flag) { // #if UNITY_ANDROID // this.ToggleMobileControls(true); // Show mobile parent // // Then show proper buttons // Parameters parameters = new Parameters (); // parameters.PutExtra ("FLAG", flag); // EventBroadcaster.Instance.PostEvent (EventNames.TOGGLE_LEFT_RIGHT_BUTTONS, parameters); // EventBroadcaster.Instance.PostEvent (EventNames.TOGGLE_JUMP, parameters); // EventBroadcaster.Instance.PostEvent (EventNames.TOGGLE_INTERACT, parameters); // // parameters = new Parameters (); // parameters.PutExtra ("FLAG", !flag); // EventBroadcaster.Instance.PostEvent (EventNames.TOGGLE_SWITCH_WEAPON_BUTTON, parameters); // EventBroadcaster.Instance.PostEvent (EventNames.TOGGLE_PICKUP_BUTTON, parameters); // // #endif // } public void ToggleBaseWithPickupControls(bool flag) { #if UNITY_ANDROID this.ToggleMobileControls(true); // Show mobile parent // Then show proper buttons Parameters parameters = new Parameters(); parameters.PutExtra("FLAG", flag); EventBroadcaster.Instance.PostEvent(EventNames.TOGGLE_LEFT_RIGHT_BUTTONS, parameters); EventBroadcaster.Instance.PostEvent(EventNames.TOGGLE_JUMP, parameters); EventBroadcaster.Instance.PostEvent(EventNames.TOGGLE_INTERACT, parameters); EventBroadcaster.Instance.PostEvent(EventNames.TOGGLE_PICKUP_BUTTON, parameters); // parameters = new Parameters (); // parameters.PutExtra ("FLAG", !flag); EventBroadcaster.Instance.PostEvent(EventNames.TOGGLE_SWITCH_WEAPON_BUTTON, parameters); #endif }
public void OnGameOver() { Parameters param = new Parameters(); param.PutExtra(SSNames.FINAL_SCORE, score); EventBroadcaster.sharedInstance.NotifyObserver(SSNames.ON_FINAL_SCORE_CHANGED, param); }