Exemple #1
0
    public virtual void Init()
    {
        _PlayedCastingAudio = _PlayedChannelingAudio = false;

        if (_ChannelingParticle != null)
        {
            ParticleInterface ChannelingParticlePI = _ChannelingParticle.GetComponent <ParticleInterface>();
            ChannelingParticlePI.Init();
            _ChannelingTimer = ChannelingParticlePI.GetLongestParticleEffect();
            //Debug.Log("Channeling Particle: " + _ChannelingTimer);
        }
        else
        {
            _ChannelingTimer = _ChannelingTime;
        }

        if (_CastingParticle != null)
        {
            ParticleInterface CastingParticlePI = _CastingParticle.GetComponent <ParticleInterface>();
            CastingParticlePI.Init();
            _CastingTimer = CastingParticlePI.GetLongestParticleEffect();
            //Debug.Log("Casting Particle: " + _CastingTimer);
        }
        else
        {
            _CastingTimer = _CastingTime;
        }

        _Multiplyer       = ((_SkillTier != null) ? _SkillTier.GetMultiplyer() : 1);
        _ScreenShakeTimer = 0;
    }
Exemple #2
0
    public void Init(SpawningProperties Properties)
    {
        _SpawnedEnding      = false;
        _PlayedCastingAudio = _PlayedEndingAudio = false;


        _Properties = Properties;
        ParticleInterface ParticlePI = null;

        if (_Properties.GetStartingParticle() != null)
        {
            ParticlePI = _Properties.GetStartingParticle().GetComponent <ParticleInterface>();
            ParticlePI.Init();
            _StartingTime = ParticlePI.GetLongestParticleEffect();

            GameObject temp = Instantiate(_Properties.GetStartingParticle(), gameObject.transform);
            Destroy(temp, _StartingTime);

            if (!_PlayedCastingAudio)
            {
                if (_Properties.GetCastingAudio() != null)
                {
                    _PlayedCastingAudio = true;
                    AudioManager.Instance.PlaySE(_Properties.GetCastingAudio().name, _Properties.IsCastingLoop());
                }
            }
        }
        else
        {
            _StartingTime = 0;
        }

        if (_Properties.GetEndingParticle() != null)
        {
            _Properties = Properties;
            ParticlePI  = _Properties.GetEndingParticle().GetComponent <ParticleInterface>();
            ParticlePI.Init();
            _EndingTime = ParticlePI.GetLongestParticleEffect();
        }
        else
        {
            _EndingTime = 0;
        }

        _Delay = 0;
    }
    public override void Init(Vector3 dir, float speed, ProjectileProperties projectile_properties, List <StatusEffect> Status, GameObjectList Targetable, float timer = 5, float damage = 1, float multiplyer = 1, float percentage = 0)
    {
        _Dir                  = dir;
        _speed                = speed;
        _timer                = timer * multiplyer;
        _damage               = damage;
        _multiplyer           = multiplyer;
        _percentage           = percentage;
        _ProjectileProperties = projectile_properties;
        _PlayedCastingAudio   = _PlayedEndingAudio = false;

        if (projectile_properties.GetMovingParticle() != null)
        {
            _MovingParticleCopy = Instantiate(projectile_properties.GetMovingParticle(), gameObject.transform);
        }

        if (projectile_properties.GetImpactParticle() != null)
        {
            ParticleInterface temp = projectile_properties.GetImpactParticle().GetComponent <ParticleInterface>();
            temp.Init();
            _impact_particle_timer = temp.GetLongestParticleEffect();
        }

        if (_Targetable.Count > 0)
        {
            _Targetable.Clear();
        }
        _Targetable.AddRange(Targetable.GetList());

        if (_StatusEffects.Count > 0)
        {
            _StatusEffects.Clear();
        }

        if (Status.Count > 0)
        {
            _StatusEffects.AddRange(Status);
        }
    }
 protected override void Awake()
 {
     _pSystem     = GetComponentInChildren <ParticleSystem>();
     _pInterface  = GetComponent <ParticleInterface>();
     _pSystemMain = _pSystem.main;
 }