PutExtra() публичный Метод

public PutExtra ( string paramName, ArrayList, arrayList ) : void
paramName string
arrayList ArrayList,
Результат void
Пример #1
0
    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());
        }
    }
Пример #2
0
    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);
    }
Пример #3
0
    public void PostDenominatorEvent(float denominator)
    {
        Parameters parameters = new Parameters();

        parameters.PutExtra(YarnballUI.YARNBALL_VALUE, denominator);
        EventBroadcaster.Instance.PostEvent(EventNames.ON_DENOMINATOR_CHANGE, parameters);
    }
Пример #4
0
    /// <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 ());
    }
Пример #6
0
    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);
    }
Пример #7
0
 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);
    }
Пример #9
0
 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
 }
Пример #10
0
    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);
    }
Пример #11
0
    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);
    }
Пример #12
0
    /// <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);
    }
Пример #13
0
    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);
    }
Пример #14
0
    /// <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);
    }
Пример #15
0
    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
    }
Пример #17
0
    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);
    }
Пример #18
0
    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);
        }
    }
Пример #19
0
//	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;
    }
Пример #20
0
    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
    }
Пример #21
0
    /// <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);
    }
Пример #22
0
    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);
    }
Пример #23
0
    /// <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 ();
    }
Пример #24
0
    /// <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);
    }
Пример #25
0
	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);
        }
    }
Пример #27
0
    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);
    }
Пример #28
0
    //======================//


    // 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);
    }
Пример #29
0
 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++;
     }
 }
Пример #30
0
    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();
    }
Пример #31
0
    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
    }
Пример #32
0
    /// <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);
    }
Пример #33
0
    // 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
    }
Пример #34
0
 public void OnGameOver()
 {
     Parameters param = new Parameters();
     param.PutExtra(SSNames.FINAL_SCORE, score);
     EventBroadcaster.sharedInstance.NotifyObserver(SSNames.ON_FINAL_SCORE_CHANGED, param);
 }