Exemple #1
0
 public void HitInform(BaseHitData hit_data, bool state)
 {
     fight.Switch(hit_data, state);
     if (state)
     {
         move.OtherState(state);
     }
 }
Exemple #2
0
 public void Switch(BaseHitData hit_data, bool state)
 {
     HitDict[hit_data.BoxName].Switch(hit_data, state);
     if (state)
     {
         ApplyHitImpulsion(hit_data);
         is_hitting = true;
     }
     else
     {
         is_hitting = false;
     }
 }
Exemple #3
0
    public void Impacted(Transform ennemy_transform, BaseHitData impact_hit_data)
    {
        // Vector3 direction = Vector3.ProjectOnPlane(transform.position - pos, Vector3.up).normalized;
        Vector3 direction_parameters = impact_hit_data.DirectionComponents;

        Vector3 direction = ennemy_transform.forward * direction_parameters.z +
                            ennemy_transform.up * direction_parameters.y +
                            ennemy_transform.right * direction_parameters.x;

        rb.velocity += direction.normalized * impact_hit_data.ImpactForce;


        anim.SetTrigger(impact_hit_data.ImpactTriggerName);
    }
Exemple #4
0
 public void Switch(BaseHitData hit_data, bool state)
 {
     Active = state;
     if (Active)
     {
         current_hit_data = hit_data;
         trail.enabled    = true;
         trail.Clear();
     }
     else
     {
         trail.enabled = false;
     }
 }
Exemple #5
0
    void Impacted(BaseHitImpact other_hit, BaseHitData impact_hit_data)
    {
        // Stopping Time
        GoWCommon.StopTime();

        // Visual FX
        Vector3    hit_position     = other_hit.transform.position;
        Vector3    ennemy_position  = other_hit.holder.transform.position;
        Transform  ennemy_transform = other_hit.holder.transform;
        GameObject p = Instantiate(ImpactEffect, hit_position, ImpactEffect.transform.rotation) as GameObject;

        // Physical response and animation
        holder.Impacted(ennemy_transform, impact_hit_data);
    }
Exemple #6
0
 public void ApplyHitImpulsion(BaseHitData hd)
 {
     rb.velocity += transform.forward * hd.ImpulsionStrength;
 }