Example #1
0
    public void AttackProj(AnimationClip clip, Vector3 dir, float speed)
    {
        Transform o = Instantiate(Projectiles, transform.position + dir / 4, Quaternion.identity);

        ProjectilesData projectilesData = ScriptableObject.CreateInstance <ProjectilesData>();

        int dP = Enemy.PhysicsDamage;

        projectilesData.Created(dir.normalized, speed, dP, 0, "Player", clip,
                                1, Color.black, 0, 0, 0, 0);

        Projectiles script = o.GetComponent <Projectiles>();

        script.Create(projectilesData);
    }
Example #2
0
    private void InstantiateProjectiles(ProjComp competence, Vector3 dir)
    {
        Transform o = Instantiate(Proj, transform.position + dir / 4, Quaternion.identity);

        o.name = competence.Name;

        ProjectilesData projectilesData = ScriptableObject.CreateInstance <ProjectilesData>();
        int             dP = 25;
        int             dM = 25;

        if (_playerData.MultiID + "" == (string)Coffre.Regarder("id"))
        {
            dP = _playerData.PhysicsDamage + _playerData.Inventory.Weapon.PhysicsDamage + competence.AdDamage;
            dM = _playerData.MagicDamage + _playerData.Inventory.Weapon.MagicDamage + competence.ApDamage;
        }
        projectilesData.Created(dir.normalized, competence.Speed, dP, dM, competence.EnemyTag, _playerData.AnimProj(),
                                competence.Live, _playerData.AnimColor(), _playerData.Prob(), _playerData.Effect(), _playerData.EffectDamage(), _playerData.Duration());

        Projectiles script = o.GetComponent <Projectiles>();

        script.Create(projectilesData);
    }