Exemplo n.º 1
0
    //停止动作(技能目标死亡或被击飞时,停止AttackAction)
    void StopAction(AnimationEvent animEvent)
    {
        ActorProp selfProp = transform.parent.GetComponent <ActorProp>();

        if (null == selfProp)
        {
            Debug.LogWarning("StopAction return, actorProp get failed");
            return;
        }
        Actor self = selfProp.ActorLogicObj;

        if (null != self && !self.IsDead)
        {
            AttackAction action = self.ActionControl.LookupAction(ActorAction.ENType.enAttackAction) as AttackAction;
            if (null != action)
            {
                if (action.m_skillTarget != null)
                {
                    if (action.m_skillTarget.IsDead)
                    {//技能目标死亡
                        action.IsFinished = true;
                    }
                    else
                    {
                        BeAttackAction baAction = action.m_skillTarget.ActionControl.LookupAction(ActorAction.ENType.enBeAttackAction) as BeAttackAction;
                        if (baAction != null && baAction.m_isFly)
                        {//技能目标被击飞
                            action.IsFinished = true;
                        }
                    }
                }
            }
        }
    }
Exemplo n.º 2
0
    void RefreshWithActions(ActorProp obj)
    {
        if (obj == null)
        {
            return;
        }
        ActorActionControl accontrol = obj.ActorLogicObj.ActionControl;

        if (accontrol != null)
        {
            for (int i = 0; i < accontrol.ActionList.Count; i++)
            {
                ActorAction ac  = accontrol.ActionList[i];
                string      str = ac.GetActionType().ToString();
                m_strs.Add(str);
            }
            return;
        }
        else
        {
            Trap tmpTrap = obj.ActorLogicObj as Trap;
            TrapActionControl trapActionControl = tmpTrap.mActionControl;
            for (int i = 0; i < trapActionControl.ActionList.Count; i++)
            {
                TrapAction ac  = trapActionControl.ActionList[i];
                string     str = ac.GetActionType().ToString();
                m_strs.Add(str);
            }
        }
    }
Exemplo n.º 3
0
    public override void OnDoubleTap(Vector2 fingerPos)
    {
        if (!BattleArena.Singleton.m_roomIsRolling)
        {
            return;
        }

        if (IsGamePause())
        {
            return;
        }
        //Debug.Log("--------------OnDoubleTap------------------");
        RaycastHit hitInfo;
        Ray        ray = Camera.main.ScreenPointToRay(fingerPos);

        if (!Physics.Raycast(ray, out hitInfo, 1500.0f))
        {
            return;
        }
        Transform transform         = hitInfo.collider.gameObject.transform;
        Transform mayActorTransform = transform.parent;

        while (mayActorTransform != null)
        {
            ActorProp cfg = mayActorTransform.GetComponent <ActorProp>();
            if (cfg != null && cfg.ActorLogicObj != mainPlayer && cfg.ActorLogicObj.Props.GetProperty_Int32(ENProperty.islive) == 1)
            {
                return;
            }
            mayActorTransform = mayActorTransform.parent;
        }
        //mainPlayer.CurrentCmd = new MainPlayer.Cmd(hitInfo.point, Player.ENCmdType.enRoll);
    }
Exemplo n.º 4
0
    /*void OnTriggerEnter(Collider other)
     * {
     * if (!ActorTargetManager.IsTrigger(other))
     * {
     *  return;
     * }
     * //Debug.LogWarning(gameObject.name + " trigger with " + other);
     *      ActorProp selfProp = transform.parent.GetComponent<ActorProp>();
     *      if (null == selfProp)
     *      {
     *  Debug.LogWarning("trigger return, actorProp get failed");
     *              return;
     *      }
     * GlobalEnvironment.Singleton.IsInCallbackOrTrigger = true;
     * try
     * {
     *  Actor self = selfProp.ActorLogicObj;
     *  if (null != self && !self.IsDead)
     *  {
     *      AttackAction action = self.ActionControl.LookupAction(ActorAction.ENType.enAttackAction) as AttackAction;
     *      if (null != action)
     *      {
     *          action.OnTriggerEnter(gameObject, other);
     *      }
     *      else
     *      {
     *          AttackingMoveAction amAction = self.ActionControl.LookupAction(AttackingMoveAction.SGetActionType()) as AttackingMoveAction;
     *          if (amAction != null)
     *          {
     *              amAction.OnTriggerEnter(gameObject, other);
     *          }
     *      }
     *  }
     * }
     * catch (Exception e)
     * {
     *  Debug.LogError("Error On OnTriggerEnter" + e.Message + ",,,,Stack:" + e.StackTrace.ToString());
     *  DebugLog.Singleton.OnShowLog("[AttackActionCallback Error On OnTriggerEnter] " + e.Message + " " + e.StackTrace.ToString());
     * }
     * GlobalEnvironment.Singleton.IsInCallbackOrTrigger = false;
     * }*/
    void ChangeInstantResultID(AnimationEvent animEvent)
    {
        ActorProp selfProp = transform.parent.GetComponent <ActorProp>();

        if (null == selfProp)
        {
            return;
        }
        Actor self = selfProp.ActorLogicObj;

        if (null != self && !self.IsDead)
        {
            AttackAction action = self.ActionControl.LookupAction(ActorAction.ENType.enAttackAction) as AttackAction;
            if (null != action)
            {
                ++action.m_skillResultIDIndex;
                action.CreateSkillResult();
            }
            else
            {
                AttackingMoveAction amAction = self.ActionControl.LookupAction(AttackingMoveAction.SGetActionType()) as AttackingMoveAction;
                if (amAction != null)
                {
                    ++amAction.m_skillResultIDIndex;
                    amAction.CreateSkillResult();
                }
            }
        }
    }
    void ShaderParamInTarget(AnimationEvent animEvent)
    {
        GameObject actorObj  = gameObject.transform.parent.gameObject;
        ActorProp  actorProp = actorObj.GetComponent <ActorProp>();

        if (actorProp == null)
        {
            return;
        }
        Actor        actor  = actorProp.ActorLogicObj;
        AttackAction action = actor.ActionControl.LookupAction(ActorAction.ENType.enAttackAction) as AttackAction;

        if (null == action)
        {
            return;
        }
        Actor targetActor = action.m_skillTarget;

        if (targetActor == null)
        {
            return;
        }
        if (targetActor.IsDead)
        {
            return;
        }
        AnimationShaderParamCallback[] callbacks = targetActor.MainObj.GetComponentsInChildren <AnimationShaderParamCallback>();
        foreach (AnimationShaderParamCallback c in callbacks)
        {
            c.ShaderParam(animEvent);
        }
    }
Exemplo n.º 6
0
    void ChangeResultID(AnimationEvent animEvent)
    {
        ActorProp selfProp = transform.parent.GetComponent <ActorProp>();

        if (null == selfProp)
        {
            return;
        }
        AttackAction action = selfProp.ActorLogicObj.ActionControl.LookupAction(ActorAction.ENType.enAttackAction) as AttackAction;

        if (null != action)
        {
            //action.m_triggerSkillResultID = animEvent.intParameter;
            ++action.m_skillResultIDIndex;
            action.m_firstTarget = null;
        }
        else
        {
            AttackingMoveAction amAction = selfProp.ActorLogicObj.ActionControl.LookupAction(AttackingMoveAction.SGetActionType()) as AttackingMoveAction;
            if (amAction != null)
            {
                //amAction.m_triggerSkillResultID = animEvent.intParameter;
                ++amAction.m_skillResultIDIndex;
                amAction.m_firstTarget = null;
            }
        }
    }
    void CameraAction(AnimationEvent animEvent)
    {
        ActorProp selfProp = transform.parent.GetComponent <ActorProp>();

        if (null == selfProp)
        {
            return;
        }
        Actor self = selfProp.ActorLogicObj;

        if (self.Type != ActorType.enMain)
        {//不是主控角色
            return;
        }
        MainGame.Singleton.MainCamera.Shake(animEvent.stringParameter);
        //string[] theparams = animEvent.stringParameter.Split(new char[1]{','});
        //float shakeRange = float.Parse(theparams[0]);
        //float shakeTime = float.Parse(theparams[1]);
        //float fieldOfView = float.Parse(theparams[2]);
        //if (fieldOfView <= 0.0001f)
        //{
        //    fieldOfView = GameSettings.Singleton.CameraFieldOfView;
        //}
        //int shakeType = int.Parse(theparams[3]);
        //if (MainGame.Singleton != null && MainGame.Singleton.MainCamera!=null)
        //{
        //    MainGame.Singleton.MainCamera.Shake(shakeRange, shakeTime, fieldOfView, shakeType);
        //}

        //ShakeParamInfo shakeInfo = GameTable.ShakeTableAsset.Lookup(animEvent.intParameter);
        //if (null != shakeInfo)
        //{
        //    MainGame.Singleton.MainCamera.Shack(shakeInfo.CameraParam1, shakeInfo.CameraParam2, shakeInfo.CameraParam3, shakeInfo.ShakeNum);
        //}
    }
Exemplo n.º 8
0
    void OnCheckExitCallBack(GameObject gameObject, Collider other)
    {
        if (other.isTrigger)
        {
            return;
        }
        Transform targetObj = other.transform;

        while (null != targetObj && targetObj.name != "body")
        {
            targetObj = targetObj.parent;
        }
        if (targetObj == null)
        {
            return;
        }

        ActorProp prop        = targetObj.parent.GetComponent <ActorProp>();
        Actor     targetActor = prop.ActorLogicObj;

        if (targetActor.Type == ActorType.enNPCTrap)
        {
            return;
        }
        if (mEnterActorIDList.Contains(targetActor.ID))
        {
            mEnterActorIDList.Remove(targetActor.ID);
        }

        /*(SelfAI as AINpcTrap).mEnterActorIDList.Remove(targetActor.ID);*/
    }
    public void EffectInTarget(AnimationEvent animEvent)
    {
        GameObject actorObj  = gameObject.transform.parent.gameObject;
        ActorProp  actorProp = actorObj.GetComponent <ActorProp>();

        if (actorProp == null)
        {
            return;
        }
        Actor        actor  = actorProp.ActorLogicObj;
        AttackAction action = actor.ActionControl.LookupAction(ActorAction.ENType.enAttackAction) as AttackAction;

        if (null == action)
        {
            return;
        }
        Actor target = action.m_skillTarget;

        if (target == null)
        {
            return;
        }
        if (target.IsDead)
        {
            return;
        }
        target.OnPlayEffect(null, animEvent);
    }
    //远程攻击-激发飞行特效
    void RemoteAttack(AnimationEvent animEvent)
    {
        GameObject actorObj  = gameObject.transform.parent.gameObject;
        ActorProp  actorProp = actorObj.GetComponent <ActorProp>();

        if (actorProp == null)
        {
            return;
        }
        Actor        actor  = actorProp.ActorLogicObj;
        AttackAction action = actor.ActionControl.LookupAction(ActorAction.ENType.enAttackAction) as AttackAction;

        if (null == action)
        {
            Debug.LogWarning("Remote Attack is error, attack action is null");
            return;
        }
        ++action.m_skillResultIDIndex;
        if (null == action.m_skillInfo)
        {//技能为空
            Debug.LogWarning("remote attack,skill info is null,skillID:" + action.m_skillID);
            return;
        }
        int skillID = action.m_skillID;
        //飞行道具的id和SkillResultID是一样的
        FlyingItemInfo itemInfo = GameTable.FlyingItemTableAsset.LookUp(action.SkillResultID);

        if (itemInfo == null)
        {
            Debug.LogWarning("flying item info is null, id is " + action.SkillResultID.ToString());
            return;
        }
        Vector3 targetPos   = Vector3.zero;
        Actor   skillTarget = action.m_skillTarget;

        if (skillTarget != null)
        {
            if (skillTarget.Type == ActorType.enMain && skillTarget.IsActorExit)
            {
                skillTarget            = ActorManager.Singleton.MainActor;
                action.m_skillTargetID = skillTarget.ID;
            }
            targetPos = skillTarget.RealPos;
        }
        if (skillTarget != null)
        {
            actor.Forward(skillTarget.RealPos);
        }
        RemoteAttackManager.Info info = new RemoteAttackManager.Info(itemInfo);
        info.m_srcActor  = actor;
        info.m_dstActor  = skillTarget;
        info.m_targetPos = targetPos;
        info.m_skillID   = skillID;
        RemoteAttackManager.Singleton.Add(info);
        if (animEvent.intParameter != 0)
        {//隐藏武器
            actor.ShowWeaponModelWithTable(false);
        }
    }
Exemplo n.º 11
0
    void OnTriggerExit(Collider other)
    {
        if (other.isTrigger)
        {
            return;
        }
        Transform targetObj = other.transform;

        while (null != targetObj && targetObj.name != "body")
        {
            targetObj = targetObj.parent;
        }
        if (null == targetObj)
        {
            return;
        }
        ActorProp prop = targetObj.parent.GetComponent <ActorProp>();

        if (null == prop)
        {
            return;
        }
        if (!ClientNet.Singleton.IsConnected || prop.Type != ActorType.enMain)
        {
            return;
        }
        if (prop.ID != ActorManager.Singleton.MainActor.ID)
        {
            return;
        }

        SceneFuncPoint pointComp = gameObject.GetComponent <SceneFuncPoint>();

        if (pointComp == null)
        {
            return;
        }
        if (pointComp.m_pointType != ENScenePointType.triggerArea)
        {
            return;
        }

        int triggerID = pointComp.m_triggerAreaInfo.m_triggerID;

        if (triggerID != 0)
        {
            //发送触发区域事件 modify by luozj
            //ClientNet.Singleton.SendPacket(new AreaOnTriggerPacket(ENTriggerOpt.enExit, triggerID));
        }
        if (pointComp.m_triggerAreaInfo.m_triggerType == ENTriggerType.enOnceTrigger)
        {
            gameObject.GetComponent <Collider>().enabled = false;
        }
    }
    //显示残影
    public void ShowGhost(AnimationEvent animEvent)
    {
        ActorProp selfProp = transform.parent.GetComponent <ActorProp>();

        if (null == selfProp || selfProp.ActorLogicObj == null)
        {
            return;
        }
        Actor self = selfProp.ActorLogicObj;

        self.ShowGhost(animEvent.floatParameter);
    }
Exemplo n.º 13
0
    public void OnTriggerEnter(Collider other)
    {
        if (other.isTrigger)
        {
            return;
        }
        Transform targetObj = other.transform;

        while (null != targetObj && targetObj.name != "body")
        {
            targetObj = targetObj.parent;
        }
        if (null == targetObj)
        {
            return;
        }
        ActorProp prop = targetObj.parent.GetComponent <ActorProp>();

        if (null == prop)
        {
            return;
        }
        if (!ClientNet.Singleton.IsConnected || prop.Type != ActorType.enMain)
        {
            return;
        }
        if (prop.ID != ActorManager.Singleton.MainActor.ID)
        {
            return;
        }

        SceneFuncPoint pointComp = gameObject.GetComponent <SceneFuncPoint>();

        if (pointComp == null)
        {
            return;
        }
        if (pointComp.m_pointType != ENScenePointType.triggerArea)
        {
            return;
        }

        //int triggerID = pointComp.m_triggerAreaInfo.m_triggerID;
        //UIPlayerGuide playerGuide = UIManager.Singleton.GetUI<UIPlayerGuide>();
        //playerGuide.ShowWindow();
        //playerGuide.SetTriggerID(triggerID);
        //if (triggerID != 0)
        //{
        //    //发送触发区域事件
        //    ClientNet.Singleton.SendPacket(new AreaOnTriggerPacket(ENTriggerOpt.enEnter, triggerID));
        //}
    }
Exemplo n.º 14
0
    public ActorProp SearchParentComponentActorProp(Transform obj)
    {
        ActorProp c = obj.GetComponent <ActorProp>();

        if (c != null)
        {
            return(c);
        }
        if (obj.transform.parent != null)
        {
            return(SearchParentComponentActorProp(obj.transform.parent));
        }
        return(null);
    }
    void MoveToTarget(AnimationEvent animEvent)
    {
        GameObject actorObj  = gameObject.transform.parent.gameObject;
        ActorProp  actorProp = actorObj.GetComponent <ActorProp>();

        if (actorProp == null)
        {
            return;
        }
        Actor actor = actorProp.ActorLogicObj;
        //actor.ActionControl.LookupAction<AttackAction>
        Actor target = actor.TargetManager.CurrentTarget;

        if (target == null)
        {
            return;
        }

        string[] theparams = animEvent.stringParameter.Split(new char[1] {
            ','
        });
        Vector3 pos = target.MainPos;

        ///Vector3 forward = actor.MainObj.transform.forward;
        //bool rot = false;
        try
        {
            if (theparams.Length >= 3)
            {
                pos.x = float.Parse(theparams[0]);
                pos.y = float.Parse(theparams[1]);
                pos.z = float.Parse(theparams[2]);
                pos   = target.MainObj.transform.TransformPoint(pos);
                //rot = true;
            }
        }
        catch (System.Exception e)
        {
            Debug.LogError("MoveToTarget:" + animEvent.stringParameter + "======error:" + e.Message);
            pos = target.MainPos;
        }
        actor.MainObj.transform.localPosition = pos;

        Vector3 direction = target.MainPos - pos;

        direction.y = 0.0f;
        direction.Normalize();
        actor.MainObj.transform.forward = direction;
    }
Exemplo n.º 16
0
    void ChangeResultID(AnimationEvent animEvent)
    {
        ActorProp selfProp = transform.parent.GetComponent <ActorProp>();

        if (null == selfProp)
        {
            return;
        }
        TrapAttackAction action = (selfProp.ActorLogicObj as Trap).mActionControl.LookupAction(TrapAction.ENType.enAttackAction) as TrapAttackAction;

        if (null != action)
        {
            action.mSkillResultID = animEvent.intParameter;
        }
    }
Exemplo n.º 17
0
    void TriggerBoneEndPosition(AnimationEvent animEvent)
    {
        ActorProp selfProp = transform.parent.GetComponent <ActorProp>();

        if (null == selfProp)
        {
            return;
        }
        string    boneName = animEvent.stringParameter;
        Transform trans    = RecursionQueryBone(selfProp.ActorLogicObj.MainObj.transform, boneName);

        if (trans != null)
        {
            selfProp.ActorLogicObj.mCurAttackBoneEndPos = trans.position;
        }
    }
Exemplo n.º 18
0
    //显示武器model
    void ShowWeapon(AnimationEvent animEvent)
    {
        ActorProp selfProp = transform.parent.GetComponent <ActorProp>();

        if (null == selfProp)
        {
            Debug.LogWarning("StopAction return, actorProp get failed");
            return;
        }
        Actor self = selfProp.ActorLogicObj;

        if (null != self && !self.IsDead)
        {
            self.ShowWeaponModelWithTable(animEvent.intParameter == 0);
        }
    }
Exemplo n.º 19
0
    //播放武器动作(int:0为左手,其它为右手,string:动画名称)
    void PlayWeaponsAnimation(AnimationEvent animEvent)
    {
        ActorProp selfProp = transform.parent.GetComponent <ActorProp>();

        if (null == selfProp)
        {
            Debug.LogWarning("StopAction return, actorProp get failed");
            return;
        }
        Actor self = selfProp.ActorLogicObj;

        if (null != self && !self.IsDead)
        {
            self.PlayWeaponsAnimation(animEvent.intParameter != 0, animEvent.stringParameter);
        }
    }
Exemplo n.º 20
0
    void OnTriggerEnter(Collider other)
    {
        //Debug.Log("OnTriggerEnter");
        if (m_enter == false)
        {
            return;
        }

        GlobalEnvironment.Singleton.IsInCallbackOrTrigger = true;
        try
        {
            Transform targetObj = other.transform;
            while (null != targetObj && targetObj.name != "body")
            {
                targetObj = targetObj.parent;
            }
            if (null != targetObj)
            {
                ActorProp actorProp = targetObj.parent.GetComponent <ActorProp>();
                if (null != actorProp && actorProp.Type == ActorType.enMain)
                {
                    m_targetObj = actorProp.ActorLogicObj.CenterPart;

                    Rigidbody body = transform.gameObject.GetComponent <Rigidbody>();
                    body.useGravity  = false;
                    body.isKinematic = true;



                    m_lastTime = TimeUtil.GetCurrentTimeMillis();
                    // Debug.Log("碰到金币了 m_lastTime:" + m_lastTime);
                    m_enter = false;
                }
            }
        }
        catch (Exception e)
        {
            Debug.LogError("Error On PickUpCallback  OnTriggerEnter" + e.Message + ",,,,Stack:" + e.StackTrace.ToString());
        }
        GlobalEnvironment.Singleton.IsInCallbackOrTrigger = false;

        svelocitx = 0f;
        svelocity = 0f;
        svelocitz = 0f;
    }
    public void CameraFieldOfView(AnimationEvent animEvent)
    {
        ActorProp selfProp = transform.parent.GetComponent <ActorProp>();

        if (null == selfProp)
        {
            return;
        }
        Actor self = selfProp.ActorLogicObj;

        if (self.Type != ActorType.enMain)
        {//不是主控角色
            return;
        }
        string[] theparams = animEvent.stringParameter.Split(new char[1] {
            ','
        });
        try
        {
            CameraFOVData fovChanged = new CameraFOVData();
            if (theparams.Length >= 4)
            {
                fovChanged.m_fov = float.Parse(theparams[0]);
                if (fovChanged.m_fov > 10)
                {
                    fovChanged.m_fov = (fovChanged.m_fov / 25.0f) * GameSettings.Singleton.CameraFieldOfView;
                }
                else
                {
                    fovChanged.m_fov = fovChanged.m_fov * GameSettings.Singleton.CameraFieldOfView;
                }
                fovChanged.m_currentToFovTime = float.Parse(theparams[1]);
                fovChanged.m_fovLoopTime      = float.Parse(theparams[2]);
                fovChanged.m_fovGoBackTime    = float.Parse(theparams[3]);
                fovChanged.m_startFov         = GameSettings.Singleton.CameraFieldOfView;
                m_fovLinear = fovChanged;
                UpdateFov();
            }
        }
        catch (System.Exception e)
        {
            Debug.LogError("CameraFieldOfView:" + animEvent.stringParameter + "======error:" + e.Message);
        }
    }
    //清除命令
    void ClearCMD(AnimationEvent animEvent)
    {
        ActorProp selfProp = transform.parent.GetComponent <ActorProp>();

        if (null == selfProp)
        {
            return;
        }
        Actor actor = selfProp.ActorLogicObj;

        if (actor.Type == ActorType.enMain || actor.Type == ActorType.enPlayer)
        {
            (actor as Player).CurrentCmd = null;
        }
        else if (actor.Type == ActorType.enNPC)
        {
            (actor as NPC).CurrentCmd = null;
        }
    }
Exemplo n.º 23
0
    void TriggerSelfSpasticity(AnimationEvent animEvent)
    {
        ActorProp selfProp = transform.parent.GetComponent <ActorProp>();

        if (null == selfProp)
        {
            return;
        }
        SelfSpasticityAction spAction = selfProp.ActorLogicObj.ActionControl.LookupAction(ActorAction.ENType.enSelfSpasticityAction) as SelfSpasticityAction;

        if (null == spAction)
        {
            spAction = selfProp.ActorLogicObj.ActionControl.AddAction(ActorAction.ENType.enSelfSpasticityAction) as SelfSpasticityAction;
        }
        if (null != spAction)
        {
            spAction.ChangeDurationTime(animEvent.floatParameter);
        }
    }
Exemplo n.º 24
0
    //攻击中,开始旋转
    //void StartRotate(AnimationEvent animEvent)
    //{
    //    ActorProp selfProp = transform.parent.GetComponent<ActorProp>();
    //    if (null == selfProp)
    //    {
    //        Debug.LogWarning("StopAction return, actorProp get failed");
    //        return;
    //    }
    //    Actor self = selfProp.ActorLogicObj;
    //    if (null != self && !self.IsDead)
    //    {
    //        AttackAction action = self.ActionControl.LookupAction(AttackAction.SGetActionType()) as AttackAction;
    //        if (action != null)
    //        {
    //            action.StartRotate(animEvent.floatParameter);
    //        }
    //    }
    //}
    //立即结束攻击动作
    void TerminateAttackAction(AnimationEvent animEvent)
    {
        ActorProp selfProp = transform.parent.GetComponent <ActorProp>();

        if (null == selfProp)
        {
            Debug.LogWarning("StopAction return, actorProp get failed");
            return;
        }
        Actor self = selfProp.ActorLogicObj;

        if (null != self && !self.IsDead)
        {
            AttackAction action = self.ActionControl.LookupAction(AttackAction.SGetActionType()) as AttackAction;
            if (action != null)
            {
                action.IsFinished = true;
            }
        }
    }
Exemplo n.º 25
0
    public void OnTriggerEnter(Collider other)
    {
        if (other.isTrigger)
        {
            return;
        }
        Transform targetObj = other.transform;

        while (null != targetObj && targetObj.name != "body")
        {
            targetObj = targetObj.parent;
        }
        if (null == targetObj)
        {
            return;
        }
        ActorProp prop = targetObj.parent.GetComponent <ActorProp>();

        if (null == prop)
        {
            return;
        }
//      if (prop.Type != ActorType.enMain)
//      {
//          return;
//      }
        if (ENTriggerEventType.enTriggerArrowEvent == mEventType)
        {
            ForwardDirectionArrow.Singleton.HideArrow(gameObject);
        }
        else if (ENTriggerEventType.enTriggerBossWarningEvent == mEventType)
        {
//             gameObject.GetComponent<Collider>().isTrigger = false;
//             gameObject.GetComponent<Collider>().enabled = false;
//             SceneManger.Singleton.NotifyChanged((int)SceneManger.ENPropertyChanged.enUIBossRoomWarning, null);
//             CursorEffectFunc.Singleton.Active();
        }
        else if (ENTriggerEventType.enTriggerPlayerEnter == mEventType)
        {
        }
    }
Exemplo n.º 26
0
        void OnCheckEnterCallBack(GameObject gameObject, Collider other)
        {
            if (other.isTrigger)
            {
                return;
            }
            Transform targetObj = other.transform;

            while (null != targetObj && targetObj.name != "body")
            {
                targetObj = targetObj.parent;
            }
            if (targetObj == null)
            {
                return;
            }

            ActorProp prop        = targetObj.parent.GetComponent <ActorProp>();
            Actor     targetActor = prop.ActorLogicObj;

            if (targetActor.Type == ActorType.enMain)
            {
                if (!mStarBattleActive)
                {
                    mStarBattleActive = true;
                    SM.RandomRoomLevel.Singleton.NotifyChanged((int)SM.RandomRoomLevel.ENPropertyChanged.enBeginBattle, null);
                    //RoomCloseGates();
                    foreach (var item in mNpcList)
                    {
                        ActorManager.Singleton.m_actorMap.Add(item.ID, item);
                        Actor delayActor;
                        ActorManager.Singleton.m_delayReleaseActorDict.TryGetValue(item.ID, out delayActor);
                        if (null != delayActor)
                        {
                            ActorManager.Singleton.m_delayReleaseActorDict.Remove(item.ID);
                        }
                    }
                }
            }
        }
Exemplo n.º 27
0
    void OnTriggerEnter(Collider other)
    {
        if (other.isTrigger)
        {
            return;
        }
        Transform targetObj = other.transform;

        while (null != targetObj && targetObj.name != "body")
        {
            targetObj = targetObj.parent;
        }
        if (targetObj == null)
        {
            return;
        }
        ActorProp prop        = targetObj.parent.GetComponent <ActorProp>();
        Actor     targetActor = prop.ActorLogicObj;

        if (targetActor.Type != ActorType.enMain)
        {
            return;
        }
        MainPlayer player = targetActor as MainPlayer;

        SM.SceneRoomInfoTree infoTree = null;
        if (Target == sboss)
        {
            infoTree = SM.RandomRoomLevel.Singleton.LookupBossRoomInfo(LevelId);
            if (null != infoTree)
            {
                player.Teleport(infoTree.CharPosTransform);
            }
        }
        else if (Target == slevel)
        {
            SM.RandomRoomLevel.Singleton.OnLeaveLevel(LevelId);
            SM.RandomRoomLevel.Singleton.OnEnterlevel(LevelId + 1);
        }
    }
    void OnTriggerEnter(Collider other)
    {
        if (other.isTrigger)
        {
            return;
        }
        if (isOver)
        {
            return;
        }
        Transform targetObj = other.transform;

        while (null != targetObj && targetObj.name != "body")
        {
            targetObj = targetObj.parent;
        }
        if (null == targetObj)
        {
            return;
        }
        ActorProp prop = targetObj.parent.GetComponent <ActorProp>();

        if (null == prop)
        {
            return;
        }
        if (prop.ActorLogicObj.IsDead)
        {
            return;
        }
        if (prop.Type == ActorType.enMain)
        {
            WorldParamInfo WorldParamList;
            WorldParamList = GameTable.WorldParamTableAsset.Lookup((int)ENWorldParamIndex.enAttackActionName);
            gameObject.GetComponent <Animation>().Play(WorldParamList.StringTypeValue);
            WorldParamList = GameTable.WorldParamTableAsset.Lookup((int)ENWorldParamIndex.enAttackedActionName);
            targetObj.gameObject.GetComponent <Animation>().Play(WorldParamList.StringTypeValue);
            isOver = true;
        }
    }
Exemplo n.º 29
0
    //摄像机变暗变亮
    void CameraCoverLightChange(AnimationEvent animEvent)
    {
        ActorProp selfProp = transform.parent.GetComponent <ActorProp>();

        if (null == selfProp)
        {
            return;
        }
        Actor self = selfProp.ActorLogicObj;

        if (self.Type != ActorType.enMain)
        {//不是主控角色
            return;
        }
        string[] param = animEvent.stringParameter.Split(new char[1] {
            ','
        });
        if (param.Length != 2)
        {
            return;
        }
        MainGame.Singleton.MainCamera.CameraCoverLightChange(param[0], param[1], animEvent.floatParameter);
    }
Exemplo n.º 30
0
    void OnTriggerEnter(Collider other)
    {
        if (other.isTrigger)
        {
            return;
        }
        Transform targetObj = other.transform;

        while (null != targetObj && targetObj.name != "body")
        {
            targetObj = targetObj.parent;
        }
        if (null == targetObj)
        {
            return;
        }
        ActorProp prop = targetObj.parent.GetComponent <ActorProp>();

        if (null == prop)
        {
            return;
        }
        if (ClientNet.Singleton.IsConnected && prop.Type == ActorType.enMain)
        {
            if ((mDropID > 0) && (mItemID > 0))
            {
                ////拾取掉落 modify by luozj
                //ClientNet.Singleton.SendPacket(new PickupDropPacket(mDropID, mItemID));
            }
            if (mDropTrigger != null)
            {
                mDropTrigger.DisableDropHolder();
            }
            mDropID = -1;
            mItemID = -1;
        }
    }