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