コード例 #1
0
ファイル: AIRunCut.cs プロジェクト: HuaniuW/myScript
    void GetAtk()
    {
        print("  getAtk!!!   isAtking " + isAtking);
        if (GetComponent <RoleDate>().isBeHiting)
        {
            print("------------------------------------------------->被击中打断!");
            AcOver();
            return;
        }

        if (gameBody.GetDB().animation.lastAnimationName == AtkName && gameBody.GetDB().animation.isCompleted)
        {
            AcOver();
            return;
        }

        if (!isAtking)
        {
            isAtking = true;
            if (AtkMsgName != Ac2Name && IsAC2 && Ac2Name != "")
            {
                if (GetComponent <RoleDate>().live < GetComponent <RoleDate>().maxLive *Live_bili)
                {
                    AtkMsgName = Ac2Name;
                }
            }
            gameBody.GetAtk(AtkMsgName);
        }


        if (isAtking && gameBody.GetDB().animation.lastAnimationName != AtkName)
        {
            AcOver();
        }
    }
コード例 #2
0
ファイル: AIZiDan.cs プロジェクト: HuaniuW/myScript
 private void OnDisable()
 {
     //print("AIZidan   我被销毁了");
     if (_gameBody && _gameBody.GetDB())
     {
         _gameBody.GetDB().RemoveDBEventListener(DragonBones.EventObject.FRAME_EVENT, this.ShowACTX);
     }
 }
コード例 #3
0
ファイル: AI_Chongci.cs プロジェクト: HuaniuW/myScript
    public void GetStart(GameObject player)
    {
        //判断是否有动作
        if (!_gameBody.GetDB().animation.HasAnimation(RunName))
        {
            _isAcOver = true;
            return;
        }
        else
        {
            _ysRunSpeed = _gameBody.maxSpeedX;
            _ysRunName  = _gameBody.GetRunName();
            _gameBody.RunACChange(RunName, Speed);
        }


        //寻找玩家
        if (!_player)
        {
            _player = player;
        }
        if (_player.GetComponent <RoleDate>().isDie)
        {
            _isAcOver = true;
            return;
        }

        //判断距离  大于冲刺距离 结束
        if (Mathf.Abs(_player.transform.position.x - this.transform.position.x) > Distances)
        {
            ReSetAll();
            return;
        }


        _positionX = this.transform.position.x;


        //判断 玩家 在左还是右
        if (_player.transform.position.x > this.transform.position.x)
        {
            runDirection = "right";
        }
        else
        {
            runDirection = "left";
        }

        _isAcOver   = false;
        _isStarting = true;
        if (!IsHasQSAC)
        {
            //如果没有 前置动作 直接显示碰撞快 和特效
            HitKuai.SetActive(true);
            ShowTX();
        }
    }
コード例 #4
0
    //bool isHasPlayerACAudio = false;

    protected virtual void GetAC()
    {
        //判断有没有 攻击动作 没有直接退出
        if (!_gameBody.GetDB().animation.HasAnimation(ACName))
        {
            print("没有攻击动作 直接退出!!");
            ReSetAll();
            return;
        }

        //防止 侦听 进入 gamebody
        _gameBody.IsSFSkill = true;

        //转向


        //收招延迟时间
        if (ACOverYCTimes != 0)
        {
            _gameBody.GetACMsgOverYC(ACOverYCTimes);
        }

        //角色 释放动作
        print(" ********************************************************** @@@@@@@@@@@@@@@   acName    " + ACName);
        _gameBody.GetAcMsg(ACName);
        //if (!isHasPlayerACAudio)
        //{
        //    isHasPlayerACAudio = true;

        //}
        if (ACAudio)
        {
            ACAudio.Play();
        }
        //print("  临时 提高硬直   "+AddYZ);
        if (AddYZ != 0)
        {
            GetComponent <TempAddValues>().TempAddYZ(AddYZ, AddYZTimes);
        }

        //起始效果 提示音 光 提示特效 等

        //这里是否有 什么释放动作  慢动作 减速 +硬直 等   地上的前置特效

        //起手慢动作

        if (qishoudongzuoyanchi != 0)
        {
            _gameBody.GetPause(qishoudongzuoyanchi, 0);
        }
        //print("_gameBody.GetDB().animation.timeScale:       "+ _gameBody.GetDB().animation.timeScale);
        //_gameBody.GetDB().animation.timeScale = 0;
        //print("_gameBody.GetDB().animation.timeScale2 :       " + _gameBody.GetDB().animation.timeScale);
    }
コード例 #5
0
ファイル: B_sanjiaoYi.cs プロジェクト: HuaniuW/myScript
 void HideHui()
 {
     //GetDB().armature.GetSlot("辫子右")._SetDisplayIndex(1);
     _gameBody.GetDB().armature.GetSlot("hui_3")._SetDisplayIndex(-1);//引擎1 从下往上数
     _gameBody.GetDB().armature.GetSlot("hui_2")._SetDisplayIndex(-1);
     _gameBody.GetDB().armature.GetSlot("hui_1")._SetDisplayIndex(-1);
     _gameBody.GetDB().armature.GetSlot("hui_4")._SetDisplayIndex(-1);
 }
コード例 #6
0
ファイル: AIRunCut.cs プロジェクト: HuaniuW/myScript
    public void GetStart(GameObject obj)
    {
        EnemyObj = obj;

        //提高硬值
        if (!isAcing)
        {
            isAcing = true;
            GetComponent <RoleDate>().addYZ(addYZNum);
            gameBody = GetComponent <GameBody>();
            _aiBase  = GetComponent <AIBase>();

            if (RunName == "" || !gameBody.GetDB().animation.HasAnimation(RunName) || !gameBody.GetDB().animation.HasAnimation(AtkName))
            {
                AcOver();
                return;
            }
            oldRunName   = gameBody.GetRunName();
            oldRunSpeedX = gameBody.maxSpeedX;
            //print("---------------->AtkName    " + AtkName + "   RunName  " + RunName+ "     oldRunName  "+ oldRunName);

            gameBody.RunACChange(RunName, moveSpeedX);

            if (AudioRunCut)
            {
                AudioRunCut.Play();
            }
        }
    }
コード例 #7
0
 protected virtual void OnDisable()
 {
     if (_gameBody)
     {
         _gameBody.GetDB().RemoveDBEventListener(DragonBones.EventObject.FRAME_EVENT, this.ShowACTX);
         ObjectEventDispatcher.dispatcher.removeEventListener(EventTypeName.ZD_SKILL_SHOW, ZDSkillShow);
         //ObjectEventDispatcher.dispatcher.removeEventListener(EventTypeName.ZD_SKILL_OVER, ZDSkillOver);
         ObjectEventDispatcher.dispatcher.removeEventListener(EventTypeName.ZD_SKILL_OVER_ALL, ZDSkillOverAll);
     }
 }
コード例 #8
0
ファイル: Plot_enemy.cs プロジェクト: HuaniuW/myScript
    void GetStands()
    {
        if (!IsGetStand)
        {
            return;
        }
        if (_gamebody.GetDB().animation.lastAnimationName != STAND)
        {
            _gamebody.GetDB().animation.GotoAndPlayByFrame(STAND);
            _gamebody.isAcing = true;
        }

        if (player.GetComponent <GameBody>().GetDB().animation.lastAnimationName != PLAYER_STAND)
        {
            player.GetComponent <GameBody>().GetDB().animation.GotoAndPlayByFrame(PLAYER_STAND);
            player.GetComponent <GameBody>().isAcing = true;
        }
    }
コード例 #9
0
 // Start is called before the first frame update
 protected virtual void Start()
 {
     if (IsGetBody)
     {
         //print("  释放技能 ??  start! ");
         _gameBody = GetComponent <GameBody>();
         _gameBody.GetDB().AddDBEventListener(DragonBones.EventObject.FRAME_EVENT, this.ShowACTX);
     }
 }
コード例 #10
0
ファイル: AIYinshen.cs プロジェクト: HuaniuW/myScript
 // Start is called before the first frame update
 void Start()
 {
     _gameBody  = GetComponent <GameBody>();
     _roledate  = GetComponent <RoleDate>();
     _aiAirBase = GetComponent <AIAirBase>();
     if (!_db)
     {
         _db = _gameBody.GetDB();
     }
 }
コード例 #11
0
ファイル: AI_GDPotZhongya.cs プロジェクト: HuaniuW/myScript
    void StartXiaya()
    {
        if (!IsStartXiaya)
        {
            return;
        }



        if (IsHitGround)
        {
            print("撞到地面!!");
            IsStartXiaya = false;
            //出下压的 烟尘技能
            _runNear.ZJStop();
            _gameBody.StopVSpeed();

            ShowHitSkillObj();
            _gameBody.isAcing = false;

            //需不需要 延迟 几秒 结束?  动作做完啊

            IsHitDownOnGround = true;


            return;
        }

        if (_runNear.ZhijieMoveToPoint(XiaYaTot, 0.5f, 4, false, true, 20))
        {
            ReSetAll();
            print("到达点!!!!!");
            _isGetOver = true;
        }


        if (_gameBody.GetDB().animation.lastAnimationName != XiayaACName)
        {
            _gameBody.isAcing = true;
            _gameBody.GetDB().animation.GotoAndStopByFrame(XiayaACName);
        }
    }
コード例 #12
0
 //5判断攻击是否完成
 bool IsAtkOver()
 {
     if (gameBody.isAtking)
     {
         if (gameBody.GetDB().animation.isCompleted)
         {
             return(true);
         }
     }
     return(false);
 }
コード例 #13
0
ファイル: ChiXuShangHai.cs プロジェクト: HuaniuW/myScript
    void FDDianMaBi()
    {
        if (!IsDian)
        {
            return;
        }
        _DianMabiJishi += Time.deltaTime;
        //print("附带 麻痹 效果 _DianMabiJishi " + _DianMabiJishi+ " _CMaxDianMabiShijian    "+ _CMaxDianMabiShijian);

        _gameBody.GetDB().animation.timeScale = 0.1f;
        _gameBody.GetDB().animation.Stop();
        _gameBody.GetPlayerRigidbody2D().velocity = Vector2.zero;
        //GetPlayerRigidbody2D().gravityScale = 0;

        if (_DianMabiJishi >= _CMaxDianMabiShijian || _roledate.isDie)
        {
            IsDian = false;
            print(" 电效果结束!!!!!  ");
            _gameBody.GetDB().animation.Play();
            _gameBody.GetDB().animation.timeScale = 1;
            _DianMabiJishi       = 0;
            _CMaxDianMabiShijian = 0;
            //GetPlayerRigidbody2D().gravityScale = 4.5f;
        }
    }
コード例 #14
0
    void ACToZidan()
    {
        if (!IsAtking)
        {
            return;
        }
        IsAtking = false;
        IsAtked  = false;
        ToziDan();
        return;



        print(gameBody.GetDB().animation.lastAnimationName + "   p  " + gameBody.GetDB().animation.isCompleted + "  p111  " + gameBody.GetDB().animation.GetStates());
        if (gameBody.GetDB().animation.lastAnimationName == ATK_1AC && gameBody.GetDB().animation.isCompleted)
        {
            print("------------->吐子弹!!!");
            IsAtking         = false;
            IsAtked          = false;
            gameBody.isAcing = false;
            ToziDan();
            return;
        }


        if (!IsAtked && gameBody.GetDB().animation.lastAnimationName != ATK_1AC)
        {
            IsAtked          = true;
            gameBody.isAcing = true;
            gameBody.GetDB().animation.GotoAndPlayByFrame(ATK_1AC);
        }
    }
コード例 #15
0
    // Start is called before the first frame update
    void Start()
    {
        _gameBody = GetComponent <GameBody>();
        _roleDate = GetComponent <RoleDate>();
        _gameBody.GetDB().AddDBEventListener(DragonBones.EventObject.FRAME_EVENT, this.ShowACTX);

        ObjectEventDispatcher.dispatcher.addEventListener(EventTypeName.ZD_SKILL_SHOW, ZDSkillShow);
        //ObjectEventDispatcher.dispatcher.addEventListener(EventTypeName.ZD_SKILL_OVER, ZDSkillOver);
        ObjectEventDispatcher.dispatcher.addEventListener(EventTypeName.ZD_SKILL_OVER_ALL, ZDSkillOverAll);
        //print(" zd **********************  正厅了 ");

        _yuanshiOverDelayTimes = OverDelayTimes;
        _AtkDistances          = AtkDistances;
        TheStart();
    }
コード例 #16
0
ファイル: AIBump.cs プロジェクト: HuaniuW/myScript
    public void GetStart()
    {
        //停止移动 取消 寻路 和移动
        GetComponent <AirGameBody>().GetStop();
        //动作
        gameBody = GetComponent <GameBody>();
        if (gameBody.GetDB().animation.HasAnimation(""))
        {
            gameBody.GetAcMsg("");
        }
        //动作做完冲刺弹射  速度用推力还是速度? 测试再看
        BumpSpeed = GetJiaodu();
        //gameBody.GetPlayerRigidbody2D().AddForce(BumpSpeed*400);
        //弹力炸弹
        //速度的话 要计算速度 总速度 或者 横向速度

        //播放特效
        TuoWeiTXPlay();

        isStart = true;
    }
コード例 #17
0
    // Update is called once per frame
    void Update()
    {
        if (_roleDate.isDie || _roleDate.isBeHiting || (_player && _player.GetComponent <RoleDate>().isDie))
        {
            ReSetAll();
            _isGetOver = true;
            ObjectEventDispatcher.dispatcher.dispatchEvent(new UEvent(EventTypeName.CAMERA_SHOCK, "end"), this);
            return;
        }

        if (GetInStand)
        {
            if (IsOverInStand())
            {
                //print(" inStand!!!!!   ");
                ReSetAll();
                _isGetOver = true;
            }
            return;
        }
        //print(_gameBody.GetDB().animation.lastAnimationName + "   zhuangtai     " + _gameBody.GetDB().animation.lastAnimationState._fadeProgress);

        if (IsGetStartAC && !_gameBody.isAcing)
        {
            IsGetStartAC = false;
            //_gameBody.isAcing = false;
            print("  ---->???  qishou wancheng ");
            _gameBody.GetPlayerRigidbody2D().velocity = Vector2.zero;



            IsStartPenhuo = true;
            //播放 起始 的特效  这里是循环的

            //_gameBody.GetAcMsg(PenHuoACName);

            return;
        }

        if (IsStartPenhuo)
        {
            //GetInStand = true;

            if (!IsInPenhuoing)
            {
                IsInPenhuoing = true;
                penhuoJishi   = 0;
                _gameBody.GetDB().animation.FadeIn(PenHuoACName);
                TX_Huoyan.gameObject.SetActive(true);
                TX_Huoyan.Play();

                moveSpeedX = this.transform.localScale.x > 0 ? -Mathf.Abs(moveSpeedX) : Mathf.Abs(moveSpeedX);
                print(" ******************************* moveSpeedX  " + moveSpeedX + "     localScale    " + this.transform.localScale.x);
            }

            if (!IsShock)
            {
                IsShock = true;
                ObjectEventDispatcher.dispatcher.dispatchEvent(new UEvent(EventTypeName.CAMERA_SHOCK, "z2-" + (penhuoCXTimes - 0.4f)), this);
            }


            penhuoJishi += Time.deltaTime;


            this.transform.position = new Vector2(this.transform.position.x + moveSpeedX, this.transform.position.y);
            //print("  moveSpeedX  "+ moveSpeedX+ "     localScale    "+ this.transform.localScale.x);

            //print(" penhuoJishi  "+ penhuoJishi);
            if (penhuoJishi >= penhuoCXTimes)
            {
                penhuoJishi = 0;
                print(" penghuo OVER!!!!!!! ");
                TX_QS.Stop();
                TX_Huoyan.Stop();
                TX_Huoyan.gameObject.SetActive(false);
                IsStartPenhuo = false;
                GetInStand    = true;
            }
        }
    }
コード例 #18
0
ファイル: AI_HXChongji2.cs プロジェクト: HuaniuW/myScript
    void ChongjiBegin()
    {
        if (!IsChongjiHX2Start)
        {
            return;
        }

        if (_roledate.isBeHiting || _roledate.isDie || _gameBody.IsGround || _gameBody.IsHitWall)
        {
            ReSetAll();
            IsChongjiOver = true;
            return;
        }

        if (IsChongjiOver)
        {
            return;
        }
        if (isStartChongji)
        {
            _gameBody.isAcing = true;
            if (!IsInStartAC)
            {
                IsInStartAC       = true;
                _gameBody.isAcing = true;

                _gameBody.RunACChange(CJ_Start);
                _gameBody.GetDB().animation.FadeIn(CJ_Start, 0.2f);
                //_gameBody.GetDB().animation.GotoAndPlayByTime(CJ_Start, 0);
                //print("  进入 飞行 冲击动作  "+ CJ_Start+"   是否包含该动作 "+ _gameBody.GetDB().animation.HasAnimation(CJ_Start)+"    当前动作???  "+ _gameBody.GetDB().animation.lastAnimationName);

                Lizi_Huoyan.Play();
                ChongJiHitKuai.SetActive(true);
                SelfHitKuai.SetActive(false);

                //伤害变动
                GetComponent <JN_Date>().atkPower = ChongjiShanghai;
            }

            if (!IsToEnd && GetComponent <AIAirRunNear>().ZhijieMoveToPoint(TargetPos, 1, MinSpeed, false, true, MaxSpeed))
            {
                IsToEnd = true;
                //还原到 站立动作
                _gameBody.RunACChange(MoRenRunACName);
                print(" 还原的 跑动动作是啥?????????MoRenRunACName    " + MoRenRunACName);
                _gameBody.isAcing = false;

                _gameBody.GetAcMsg(_gameBody.GetStandACName());
                ReSetAll();
                IsChongjiOver = true;
            }

            if (!_gameBody.isAcing)
            {
                ReSetAll();
                IsChongjiOver = true;
            }

            return;
        }

        if (_gameBody.GetDB().animation.lastAnimationName == CJ_Begin && !_gameBody.isAcing)
        {
            isStartChongji = true;
        }
    }