Ejemplo n.º 1
0
    private void Start()
    {
        target      = TFOGPlayerManager.instance.player.transform;
        aradisStats = TFOGPlayerManager.instance.Aradis.GetComponent <AradisStats>();

        direction   = target.position - transform.position;
        direction.z = direction.y = 0f;
        direction   = direction.normalized * movementSpeed;

        particleSystems = GetComponentsInChildren <ParticleSystem>();
        fxManager       = FX_Manager.Instance;

        var playComponents = TFOGPlayerManager.instance.player.GetComponents <PlayParticleSystem>();

        for (int i = 0; i < playComponents.Length; i++)
        {
            if (playComponents[i].particleName == StringsInGame.ImpactParticlesName)
            {
                impactParticles = playComponents[i];
                break;
            }
        }

        if (impactParticles == null)
        {
            impactParticles              = target.gameObject.AddComponent <PlayParticleSystem>();
            impactParticles.particles    = Instantiate(impact, target, false) as ParticleSystem;
            impactParticles.particleName = StringsInGame.ImpactParticlesName;
        }
    }
        public void Awake()
        {
            Agent = GetComponent <EnemyAgent>();


            ExploderConfig = ConfigManager.ExploderConfigDictionary[Agent.EnemyDataID];
            GlowColor      = Util.GetUnityColor(ExploderConfig.ColorData);

            Agent.MaterialHandler.m_defaultGlowColor = GlowColor;

            if (staticValuesLoaded == false)
            {
                s_explodeFXPool    = FX_Manager.GetPreloadedEffectPool("FX_InfectionSpit");
                staticValuesLoaded = true;
            }

            Agent.add_OnDeadCallback((Action)(() => {
                if (ExploderConfig.NoExplosionOnDeath)
                {
                    return;
                }
                if (Activated == true)
                {
                    return;
                }
                Trigger();
            }));
        }
Ejemplo n.º 3
0
 void OnDestroy()
 {
     if (HasLight)
     {
         FX_Manager.DeallocateFXLight(light);
         light = null;
     }
 }
Ejemplo n.º 4
0
 // Use this for initialization
 void Start()
 {
     attackHash     = Animator.StringToHash("PlayerAttack");
     attackModeHash = Animator.StringToHash("PlayerAttackCount");
     isAttacking    = false;
     animator.SetBool(attackHash, isAttacking);
     attackCount   = 0;
     canDealDamage = true;
     fxManager     = FX_Manager.Instance;
 }
Ejemplo n.º 5
0
        void Awake()
        {
            HasLight = FX_Manager.TryAllocateFXLight(out light);

            if (HasLight)
            {
                light.SetColor(Color.white);
                light.SetRange(100);
                light.m_intensity = 0.1f;
                light.m_isOn      = true;
                light.UpdateData();
                light.UpdateTransform();
            }
        }
Ejemplo n.º 6
0
        public void Awake()
        {
            enemyAgent     = GetComponent <EnemyAgent>();
            exploderConfig = ConfigManager.ExploderConfigDictionary[enemyAgent.EnemyDataID];

            glowColor = Util.GetUnityColor(exploderConfig.ColorData);

            enemyAgent.MaterialHandler.m_defaultGlowColor = glowColor;
            if (staticValuesLoaded == false)
            {
                s_explodeFXPool    = FX_Manager.GetPreloadedEffectPool("FX_InfectionSpit");
                staticValuesLoaded = true;
            }

            enemyAgent.add_OnDeadCallback((Action)(() => {
                Explode();
            }));
        }
Ejemplo n.º 7
0
 private void Awake()
 {
     Instance = this;
 }
Ejemplo n.º 8
0
 void Start()
 {
     canDealDamage = true;
     isAttacking   = false;
     fxManager     = FX_Manager.Instance;
 }