// Update is called once per frame void Update() { cooldown -= Time.deltaTime; if (cooldown <= 0.0f && CharacterUtils.GetCharactersInRange(GameController.instance.party.activeCharacters, position, radius).Count > 0) { GameController.instance.ChangeScene(sceneBuildIndex, spawnIndex); } }
/// <summary> /// Fetch the target array for this cursor. This highly depends on the target mode /// </summary> private void fetchTargets() { targets = new List <Character>(); if (targetMode == OnHitCursorTargetMode.Enemy) { targets = CharacterUtils.GetCharactersInRange(GameController.instance.enemies, character.transform.position, maxRange); } if (targetMode == OnHitCursorTargetMode.Allies) { targets = CharacterUtils.GetCharactersInRange(GameController.instance.party.activeCharacters, character.transform.position, maxRange); } }
void Update() { if (isAggressive && !isFighting) { List <Character> charactersInRange = CharacterUtils.GetCharactersInRange(GameController.instance.party.activeCharacters, transform.position, aggroRange); if (charactersInRange != null && charactersInRange.Count > 0) { isFighting = true; GameController.instance.JoinCombat(GetComponent <Character>()); } } }