public void TryInstantiateSpell(SpellSpawner spawner) { if (_spellData.CurrentUsableCharges > 0) { _spellData.CurrentUsableCharges--; Instantiate(Spell.Prefab, spawner.transform.position, spawner.transform.rotation); } }
private void Update() { ability1Icon.enabled = false; ability1Text.text = "Ability 1"; ability2Icon.enabled = false; ability2Text.text = "Ability 2"; ability3Icon.enabled = false; ability3Text.text = "Ability 3"; if (SessionManager.PlayerInventory.Count > 0) { a1 = SessionManager.PlayerInventory[0]; ability1Icon.enabled = true; ability1Icon.sprite = iconsDictionary[a1]; ability1Text.text = a1.ToString(); } if (SessionManager.PlayerInventory.Count > 1) { a2 = SessionManager.PlayerInventory[1]; ability2Icon.enabled = true; ability2Icon.sprite = iconsDictionary[a2]; ability2Text.text = a2.ToString(); } if (SessionManager.PlayerInventory.Count > 2) { a3 = SessionManager.PlayerInventory[2]; ability3Icon.enabled = true; ability3Icon.sprite = iconsDictionary[a3]; ability3Text.text = a3.ToString(); } if (!Weapon.abilityActive) { if (SpellSpawner.GetAbilityType(a1) == WeaponType.Ability) { ability1Icon.enabled = false; ability1Text.text = "USED"; } if (SpellSpawner.GetAbilityType(a2) == WeaponType.Ability) { ability2Icon.enabled = false; ability2Text.text = "USED"; } if (SpellSpawner.GetAbilityType(a3) == WeaponType.Ability) { ability3Icon.enabled = false; ability3Text.text = "USED"; } } hpBar.fillAmount = player.HealthPercent; }
void Start(){ movementManager = GetComponent<MovementManager> (); playerSpawner = GetComponent<PlayerSpawner> (); player = GetComponent<Player> (); elementSpawner = GetComponent<ElementSpawner> (); spellSpawner = GetComponent<SpellSpawner> (); shieldSpawner = GetComponent<ShieldSpawner> (); audioManager = GetComponent<AudioManager> (); }
public void InitiateLevel() { GameObject player = GameObject.FindGameObjectWithTag("Player"); SpellSpawner spellSpawner = player.GetComponentInChildren <SpellSpawner>(); Debug.Log("Spawning"); LpPlayer.acquiredLPs = new List <Abilities>(); foreach (Abilities a in playerInventory) { spellSpawner.SpawnAbility(a); } }
public void AddAbility(Abilities a) { for (int i = 0; i < playerInventory.Count; ++i) { if (SpellSpawner.IsSameType(a, (Abilities)playerInventory[i])) { playerInventory[i] = a; return; } } playerInventory.Add(a); }
private void Start() { SpellSpawner sp = GetComponentInParent <SpellSpawner>(); if (sp != null) { if (sp.currentWeapon != null && weaponType == WeaponType.Attack) { Destroy(sp.currentWeapon.gameObject); sp.currentWeapon = this; } if (sp.currentWeapon != null && weaponType == WeaponType.Ability) { Destroy(sp.currentAbility.gameObject); sp.currentAbility = this; } } if (weaponType == WeaponType.Ability) { Weapon.abilityActive = true; } }
void Awake () { //singleton instance = this; }
public void Initialize(SpellSpawner spawner, Vector3 position) { this.spawner = spawner; this.transform.position = position; }
public static bool IsSameType(Abilities a, Abilities b) { return(SpellSpawner.GetAbilityType(a) == SpellSpawner.GetAbilityType(b)); }
void Start() { m_SpellPool = GetComponent <SpellPool>(); m_SpellSpawner = GetComponent <SpellSpawner>(); }