public GetFloatExtra ( string paramName, float defaultValue ) : float | ||
paramName | string | |
defaultValue | float | |
return | float |
/// <summary> /// Function call to make the camera zoom towards a certain point in the scene. /// </summary> /// <param name="data">Target</param> private void ZoomTowards(Parameters data) { float x = data.GetFloatExtra("x", 0.0f); float y = data.GetFloatExtra("y", 0.0f); Vector2 target = new Vector2(x, y); Debug.Log("TARGET: " + target); cameraZoom.ZoomTowards(target); }
/// <summary> /// Called when the target marker was updated. Checks and sets if the label should be visible or not. /// </summary> /// <param name="parameters">Parameter object containing data passed to this function.</param> public void TargetChange(Parameters parameters) { float numerator = parameters.GetFloatExtra(TargetMarker.NEW_NUMERATOR, 0f); float denominator = parameters.GetFloatExtra(TargetMarker.NEW_DENOMINATOR, 1f); gameObject.SetActive(true); if (numerator / denominator == maxValue) { gameObject.SetActive(false); } }
/// <summary> /// Update the stability. /// </summary> /// <param name="parameters">Parameter containing the ghost block which will affect the stability.</param> public void HollowUpdate(Parameters parameters) { float numerator = parameters.GetFloatExtra(NUMERATOR, 0f); float denominator = parameters.GetFloatExtra(DENOMINATOR, 1f); Color color = (Color)parameters.GetObjectExtra(COLOR); bool isAdd = parameters.GetBoolExtra(IS_ADD, true); HollowBlock block = (HollowBlock)parameters.GetObjectExtra(HOLLOW_BLOCK); this.ManipulateStability(numerator, denominator, color, isAdd, block); // StabilityCheck (); }
/// <summary> /// Update the stability. /// </summary> /// <param name="parameters">Parameter containing the ghost block which will affect the stability.</param> public void HollowUpdateInstant(Parameters parameters) { Debug.LogError("Entered instant"); float numerator = parameters.GetFloatExtra(NUMERATOR, 0f); float denominator = parameters.GetFloatExtra(DENOMINATOR, 1f); Color color = (Color)parameters.GetObjectExtra(COLOR); bool isAdd = parameters.GetBoolExtra(IS_ADD, true); HollowBlock block = (HollowBlock)parameters.GetObjectExtra(HOLLOW_BLOCK); StartCoroutine(this.ManipulateStability(numerator, denominator, color, isAdd, block, true)); // StabilityCheck (); }
/// <summary> /// Called when the stability pointer moves. Checks and sets if the label should be visible or not. /// </summary> /// <param name="parameters">Parameter object containing data passed to this function.</param> public void StabilityChange(Parameters parameters) { float numerator = parameters.GetFloatExtra(StabilityPointer.NEW_NUMERATOR, 0f); float denominator = parameters.GetFloatExtra(StabilityPointer.NEW_DENOMINATOR, 1f); int value = (int)(numerator / denominator); Debug.Log("<color=red>ENTERED STABILITY CHANGE</color>" + numerator + " " + denominator); gameObject.SetActive(true); if (value == (int)maxValue) { gameObject.SetActive(false); } }
public void UpdateLabel(Parameters parameters) { float currentHP = parameters.GetFloatExtra("currentHP", 0f); Debug.Log("CURR HP IS " + currentHP); GetTextMesh().text = "" + currentHP; // float maxHP = parameters.GetFloatExtra ("maxHP", 0f); }
public void UpdateYarnballValue(Parameters parameters) { float denominator = parameters.GetFloatExtra(YARNBALL_VALUE, 0f); this.value = denominator; this.GetYarnballValue().SetText("" + denominator); this.CheckValue(); }
void UpdateFrenzy(Parameters parameters) { var percentage = parameters.GetFloatExtra(PARAM_FRENZY_PERCENTAGE, 0); FrenzyGauge.value = FrenzyGauge.maxValue * percentage; }