예제 #1
0
    // 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);
        }
    }
예제 #2
0
    /// <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);
        }
    }
예제 #3
0
    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>());
            }
        }
    }