示例#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;
        }
    }
示例#2
0
    private void OnParticleCollision(GameObject other)
    {
        aradisStats = AradisController.aradis.GetComponent <AradisStats>();

        if (other.gameObject.tag == StringsInGame.PlayerTag)
        {
            playerStats = other.gameObject.GetComponent <CharacterStats>();
            if (playerStats != null)
            {
                if (aradisStats != null)
                {
                    playerStats.TakeDamage(aradisStats.castDamage.GetValue());
                }
                else
                {
                    playerStats.TakeDamage(5);
                }
            }
        }
    }
示例#3
0
 private void Start()
 {
     aradisStats = TFOGPlayerManager.instance.Aradis.GetComponent <AradisStats>();
     playerStats = PlayerManager.instance.player.GetComponent <PlayerStats>();
 }