void SpawnMiniature(SpellCard _spellCard, bool _loadAdvancedSpell = false, int offset = 0) { GameObject _spawnedMiniature = objectPooler.SpawnFromPool("CombatMiniature", Vector3.zero, Quaternion.identity, playerScript.playerCanvas.transform); _spawnedMiniature.transform.localPosition = Vector3.forward * (offset * 0.01f); _spawnedMiniature.transform.localRotation = Quaternion.Euler(Vector3.zero); SpellVisuals _spawnedMiniatureSpell = _spawnedMiniature.GetComponent <SpellVisuals>(); CombatMiniatureProperties _miniatureProperties = _spawnedMiniature.GetComponent <CombatMiniatureProperties>(); _spawnedMiniature.GetComponent <SpriteRenderer>().sprite = null; //Load combat spell visuals and logic if (_loadAdvancedSpell == false) { _spawnedMiniatureSpell.spell = _spellCard; _spawnedMiniatureSpell.LoadSpell(_spellCard); combatMenu.MoveCardToDestination(_spellCard, CardDestination.Hand, CardDestination.Combat); } else { SpellCard _tempAdvancedSpell = _spellCard.advancedSpellComponents[0].advancedSpell; _spawnedMiniatureSpell.spell = _tempAdvancedSpell; _spawnedMiniatureSpell.LoadSpell(_tempAdvancedSpell); combatMenu.MoveCardToDestination(_tempAdvancedSpell, CardDestination.Hand, CardDestination.Combat); } _miniatureProperties.OnSpellLogicChange(_spawnedMiniature.GetComponent <SpellVisuals>().spell.spellLogic); cardHolder.spellMiniatures.Add(_spawnedMiniature); }
public void SetMiniature() { SpellVisuals _spellVis = miniature.GetComponent <SpellVisuals>(); _spellVis.spell = currentCard; _spellVis.LoadSpell(currentCard); _spellVis.gameObject.GetComponent <SpellMiniature>().spellSlot = this; }
public virtual void OnSetType(SpellVisuals spellVisuals) { SpellElement t = BattleManager.GetResourcesManager().typeElement; SpellVisualsProperties type = spellVisuals.GetProperty(t); type.textUI.text = typeName; }
public override void OnSetType(SpellVisuals spellVisuals) { base.OnSetType(spellVisuals); spellVisuals.damageHolder.SetActive(false); }