コード例 #1
0
        public RangedAbilityObject PerformCastForwardWithInstantiate(RangedCharacterClass rangedClass, IAbilityWithGameEffect ability)
        {
            Transform spellCastingSpotTransform = rangedClass.GetComponentsInChildren <Transform>()
                                                  .Where(x => x.name == "SpellCastingSpot")
                                                  .SingleOrDefault();

            GameObject instantiatedObject = Instantiate(ability.AbilityGameModel,
                                                        spellCastingSpotTransform.position,
                                                        Quaternion.Euler(rangedClass.transform.eulerAngles.x, rangedClass.transform.eulerAngles.y, 0f));

            if (ability.IsRanged)
            {
                if (spellCastingSpotTransform != null)
                {
                    instantiatedObject.GetComponent <Rigidbody>().AddForce(rangedClass.transform.forward * 20f, ForceMode.Impulse);
                    instantiatedObject.AddComponent <RangedAbilityObject>().AddParams(rangedClass, ability);
                }
                else
                {
                    Debug.LogError(ErrorMessages.SpawnPointNotSet);
                }
            }
            else
            {
                Debug.LogError(ErrorMessages.WrongTypeOfAbility);
            }

            return(instantiatedObject.GetComponent <RangedAbilityObject>());
        }
コード例 #2
0
    //public delegate void ColliderHitHandler();
    // public  event ColliderHitHandler OnColliderHit;

    public void AddParams(RangedCharacterClass rangedCharacterClass, IAbilityWithGameEffect ability)
    {
        castingCharacter = rangedCharacterClass;
        castedAbility    = ability;
    }
コード例 #3
0
 internal void CastAreaAbilityAtSelectedPossition(RangedCharacterClass rangedClass, IAbility ability, Vector3 possition)
 {
     throw new NotImplementedException();
 }
コード例 #4
0
 internal void CastAreaAbilityAtCurrentPossition(RangedCharacterClass rangedClass, IAbility ability)
 {
     throw new NotImplementedException();
 }