void M8.UIModal.Interface.IPush.Push(M8.GenericParams parms) { if (image) { Sprite spr; if (parms.TryGetValue(parmImage, out spr) && spr) { image.gameObject.SetActive(true); image.sprite = spr; if (isImageResize) { image.SetNativeSize(); } } else { image.gameObject.SetActive(false); } } mTitleTextRef = parms.GetValue <string>(parmTitleTextRef); mDescTextRef = parms.GetValue <string>(parmDescTextRef); if (titleLabel) { if (!string.IsNullOrEmpty(mTitleTextRef)) { titleLabel.gameObject.SetActive(true); titleLabel.text = M8.Localize.Get(mTitleTextRef); } else { titleLabel.gameObject.SetActive(false); } } if (descLabel) { if (!string.IsNullOrEmpty(mDescTextRef)) { descLabel.gameObject.SetActive(true); descLabel.text = M8.Localize.Get(mDescTextRef); } else { descLabel.gameObject.SetActive(false); } } if (mTitleLabelSpeakText) { mTitleLabelSpeakText.key = mTitleTextRef; } if (mDescLabelSpeakText) { mDescLabelSpeakText.key = mDescTextRef; } }
void M8.UIModal.Interface.IPush.Push(M8.GenericParams parms) { Pause(true); if (mCurPage != null) { mCurPage.Hide(); mCurPage = null; } //grab page string levelName; if (parms.TryGetValue(parmLevelName, out levelName)) { if (!mPages.TryGetValue(levelName, out mCurPage)) { Debug.LogWarning("Unknown Page: " + levelName); return; } } mCurPage.Show(); int hintButtonCount = mCurPage.pages.Length; //determine hint unlock mHintCounter = GameData.instance.GetHintCounter(levelName); for (int i = 0; i < mHintCounter; i++) { hintButtons[i].Show(); hintButtons[i].available = true; hintButtons[i].highlight = false; } for (int i = mHintCounter; i < hintButtonCount; i++) { hintButtons[i].Show(); hintButtons[i].available = false; hintButtons[i].highlight = false; } for (int i = hintButtonCount; i < hintButtons.Length; i++) { hintButtons[i].Hide(); } //set default page if (mHintCounter > 0 && hintButtons[0].available) { OpenPage(0); } else { OpenPage(-1); } }
void M8.IPoolSpawn.OnSpawned(M8.GenericParams parms) { if (parms != null) { object obj; if (parms.TryGetValue <object>(parmText, out obj)) { label.text = obj.ToString(); } else { label.text = ""; } } }
protected override void OnSpawned(M8.GenericParams parms) { //populate data/state for ai, player control, etc. //start ai, player control, etc if (!parms.TryGetValue(paramName, out mBlockName)) { mBlockName = name; Debug.LogWarning("No block name give for: " + name); } state = (int)EntityState.Normal; Mode toMode; if (parms.TryGetValue(paramMode, out toMode)) { mode = toMode; } else { mode = Mode.Solid; } }
protected override void OnSpawned(M8.GenericParams parms) { //populate data/state for ai, player control, etc. if (parms != null) { parms.TryGetValue(Params.dir, out mSpawnImpulseDir); } //start ai, player control, etc if (mSpawnImpulseDir != Vector2.zero) { body.AddForce(mSpawnImpulseDir * stats.spawnImpulse); } mSpawnPos = transform.position; state = (int)EntityState.Normal; }