예제 #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();
            }));
        }
예제 #3
0
 void OnDestroy()
 {
     if (HasLight)
     {
         FX_Manager.DeallocateFXLight(light);
         light = null;
     }
 }
예제 #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;
 }
예제 #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();
            }
        }
예제 #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();
            }));
        }
예제 #7
0
 private void Awake()
 {
     Instance = this;
 }
예제 #8
0
 void Start()
 {
     canDealDamage = true;
     isAttacking   = false;
     fxManager     = FX_Manager.Instance;
 }