public void Trigger(IEventArgs args, GameTriggers triggers, int trigger) { for (int i = 0; i < units.Count; i++) { if (units[i].unit != null) { args.TempUse(units[i].key, units[i].unit); } } for (int i = 0; i < paras.Count; i++) { args.TempUsePara(paras[i]); } triggers.Trigger(trigger, args); for (int i = 0; i < units.Count; i++) { if (units[i].unit != null) { args.Resume(units[i].key); } } for (int i = 0; i < paras.Count; i++) { args.ResumePara(paras[i].GetName()); } Reset(); }
private void DisplaySelectScreen() { GameTriggers.OnCharSelect(); Cursor.visible = true; Cursor.lockState = CursorLockMode.None; selectscreen.SetActive(true); DisablePlayerScripts(); Time.timeScale = 0; }
public void DestroyEnemy() { enemiesRemaining--; UpdateEnemyText(); if (enemiesRemaining <= 0) { GameTriggers.OnWaveEnd(); print("New Wave"); } }
public BaseEventArgs() { this.map = new MyDictionary <string, IParable>(); this.directMap = new MyDictionary <string, IParable>(); this.units = new GameUnitSet(); this.temp = new MyDictionary <string, Stack <IParable> >(); this._functions = new CommonActions(); this._triggers = new GameTriggers(); this._componentMap = new GameComponentMap(); this._components = new GameComponents(); this._bufs = new FreeBufManager(); this._freeContext = new FreeContext(_gameContext); }
public void TakeDamage(float dmg) { if (!invincible) { audio.clip = clips[Random.Range(0, 1)]; audio.Play(); invincible = true; print("Base takes damage"); CurrentHealth -= dmg; Invoke("ResetInvulnerability", resetTime); imgBaseHealth.fillAmount = CurrentHealth / MaxHealth; if (CurrentHealth <= 0) { GameTriggers.OnGameEnd(); } } }
public void TakeDamage(float dmg) { if (!invincible) { invincible = true; print("Player takes damage"); CurrentHealth--; Invoke("ResetInvulnerability", resetTime); if (CurrentHealth <= 0) { GameTriggers.OnWaveEnd(); //todo kill player gameobject saftley //this.gameObject.SetActive(false); } StartCoroutine(Flash()); } }
public void SelectPlayer(Transform character) { var scripts = character.GetComponents <MonoBehaviour>(); foreach (var s in scripts) { s.enabled = true; } activeCharacter = character; character.tag = "Player"; character.gameObject.layer = 12; GameTriggers.OnPlayerAssigned(); selectscreen.SetActive(false); Cursor.visible = false; Cursor.lockState = CursorLockMode.Locked; Time.timeScale = 1; }