Exemplo n.º 1
0
    public override bool OnTrigger(LCharacterColliderData cdata, Collider other, LChatacterInterface character, LChatacterInformationInterface information)
    {
        if (cdata.type == "hit")
        {
            LCharacterHitData data   = cdata.getData <LCharacterHitData>();
            ActionType        status = (ActionType)data.value.GetValueInt("status", 0);
            if (GetActionType() == status)
            {
                if (!data.hittedObject.Contains(character.GetId()) && null != data.value)
                {
                    data.hittedObject.Add(character.GetId());

                    if (character.IsAI())
                    {
                        character.AddHaterd(data.characterId, 1);
                    }
                    float slow_motion = data.value.GetValueFloat("slow_motion", 0f);
                    if (data.firstHit)
                    {
                        if (data.cdState == CdState.HIT)
                        {
                            LChatacterInterface chr = information.GetCharacter(data.characterId);
                            chr.updateCDState(data.cdName, data.skillState);
                        }
                        if (slow_motion > 0.0001f)
                        {
                            information.slowly(0.01f, slow_motion);
                            data.firstHit = true;
                        }
                    }

                    Vector3 dir = other.transform.forward;
                    dir.y = 0;
                    dir.Normalize();
                    SetHitData(data, dir);
                    return(true);
                }
            }
        }
        return(false);
    }
Exemplo n.º 2
0
 public override void endAction(LChatacterInterface character, LChatacterInformationInterface information)
 {
     if (cdState != CdState.HIT)
     {
         character.updateCDState(cdName, skillState);
     }
     for (int i = 0, c0 = objList.Length; i < c0; i++)
     {
         var o0 = objList[i];
         if (o0.objId != -1)
         {
             if (o0.type == 2 || o0.type == 3)
             {
                 if (null != o0.gameobject)
                 {
                     o0.gameobject.SetActive(false);
                 }
             }
         }
     }
 }