Exemplo n.º 1
0
        protected override void OnTriggerEnter(Collider col)
        {
            if (col.gameObject.layer == (int)ObjectLayer.Player)
            {
                RealAttack = BasicAttack * AttackFactor;
                //传参给Player告知受伤
                TransformForward = EnemyMedi.EnemyMono.transform.forward;
                PlayerHurtAttr.ModifyAttr((int)RealAttack, VelocityForward, VelocityVertical, TransformForward, canDefeatedFly);
                if (IsOnlyPlayer)
                {
                    if (OnlyPlayerMono == null)
                    {
                        OnlyPlayerMono = col.GetComponent <IPlayerMono>();
                    }
                    OnlyPlayerMono.Hurt(PlayerHurtAttr);
                }
                else
                {
                    col.GetComponent <IPlayerMono>().Hurt(PlayerHurtAttr);
                }
                if (hitEffectPath != string.Empty)
                {
                    resourcesMgr.LoadAsset(hitEffectPath, true, transform.position, Quaternion.identity);
                }

                //HasHit = true;
                OnWeaponHit.Invoke();
            }
        }  // end_function
 public void Invoke(Unit attacker, Unit target)
 {
     Effect.Invoke(attacker, target, Value);
 }