コード例 #1
0
    public virtual IEnumerator CastAbilityQCoroutine(RaycastHit targetinfo)
    {
        // Rotate
        Quaternion targetRotation = Quaternion.LookRotation(targetPoint - transform.position);

        targetRotation.x       = 0;
        targetRotation.z       = 0;
        thisTransform.rotation = targetRotation;

        // Cast ability
        GameObject clone = (GameObject)Instantiate(abilityQPrefab, thisTransform.position, thisTransform.rotation);

        cachedAbilityQController = clone.GetComponent <AbilityController>();

        // Set target and stats
        cachedAbilityQController.GenerateCombatStatistics(_statsGeneral, _statsOffense, _statsDefense);

        // Start global cooldown
        _statsGeneral.StartCooldown();

        yield return(null);
    }