Пример #1
0
 public void HitEffect(SkillHit skills, HashSet <GameObject> Gameobjects) //打击效果实现
 {
     if (skills.UseReturn && enemys.Count == 0)                           //做投技时用于返回到初始状态
     {
         MessageDispatcher.Instance.DispatchMessage(0, this.transform, GameObject.FindGameObjectWithTag("Player").transform, (int)MessagesType.Player_Idle, EntityManager.Instance.GetEntityFromTransform(this.transform), 1f);
         ChangerCollider(false);
         Destroy(this.gameObject, 0.2f);
     }
     foreach (GameObject o in enemys)
     {
         if (o != null)
         {
             if (Boom != null)       //若Boom不为空,生成特效
             {
                 Instantiate(Boom, new Vector3(o.transform.position.x, o.transform.position.y + 1f, o.transform.position.z), o.transform.rotation);
             }
             if (Skillinfo == null)
             {
                 MessageDispatcher.Instance.DispatchMessage(0, this.transform, o.transform, (int)skills.Message, EntityManager.Instance.GetEntityFromTransform(this.transform), PlayerProperty.Attack1);
             }
             else
             {
                 MessageDispatcher.Instance.DispatchMessage(0, this.transform, o.transform, (int)skills.Message, EntityManager.Instance.GetEntityFromTransform(this.transform), Skillinfo.hitnum);
             }
             //传递消息,造成打击效果
             Vector3 dir = GameObject.FindGameObjectWithTag("player").transform.TransformPoint(skills.ForceE.Direction);
             dir = o.transform.InverseTransformPoint(dir);
             o.GetComponent <RPGMotor>().AddForce(skills.ForceE.ForceName, dir, Vector3.zero, skills.ForceE.EffectTimes);
             //对目标添加力的作用
             if (skills.IsDestroy)           //打击完成后删除该特效
             {
                 Destroy(this.gameObject);
             }
             if (skills.CloseCollider)       //打击完成后停用该碰撞体
             {
                 ChangerCollider(false);
             }
             //if (ChildOf)                    //被击的敌人成为子物体
             //{
             //    o.transform.parent = this.transform;
             //}
         }
     }
 }
Пример #2
0
    static void Hit(Character cha, ChildObject childObj, SkillContext context, excel_skill_event e)
    {
        int hitID = e.evnetParam1;

        SkillHit.Hit(context.mOwner, hitID, context);
    }