public void SpellUpdate(ref SpellCasting spellCasting) { if (Input.GetButtonDown("Spell 1")) { spellCasting.SpellPressed(0); } else if (Input.GetButtonUp("Spell 1")) { spellCasting.SpellReleased(0); } if (Input.GetButtonDown("Spell 2")) { spellCasting.SpellPressed(1); } else if (Input.GetButtonUp("Spell 2")) { spellCasting.SpellReleased(1); } if (Input.GetButtonDown("Spell 3")) { spellCasting.SpellPressed(2); } else if (Input.GetButtonUp("Spell 3")) { spellCasting.SpellReleased(2); } if (Input.GetButtonDown("Spell 4")) { spellCasting.SpellPressed(3); } else if (Input.GetButtonUp("Spell 4")) { spellCasting.SpellReleased(3); } if (spellCasting.casting) { spellCasting.CastUpdate(rayCast.BoardRayCast()); } }
private void Update() { if (isSpawning) { Vector3 boardPosition; bool validRayCastHit; validRayCastHit = rayCast.BoardRayCast(out boardPosition, spawnLayer.Value); unit.transform.position = new Vector3(boardPosition.x, unitSizeOffset, boardPosition.z); if (validRayCastHit && Input.GetMouseButtonDown(0)) { ((NonControllableUnit)unit).Initialize(npcHero, selectedCard.unitStats, "PlayerTeam"); playerSide.Add(unit); unit = null; isSpawning = false; } } commander.Think(); }