IEnumerator HeroPathOnObjectMove(GameObject go)
        {
            yield return(new WaitForSeconds(1f));

            HeroPathtContrler.GetInstantiate().SetAniObject(go);
            HeroPathtContrler.GetInstantiate().SetHerosParent(go);
            HeroPathNormalMove();
        }
        /// <summary>
        /// 获得怪物向前移动指定距离后的位置;
        /// </summary>
        /// <param name="waveIdx">第几波数</param>
        /// <param name="monsterIdx">怪物索引</param>
        /// <returns></returns>
        public Vector3 GetMonsterMovePos(int waveIdx, int monsterIdx)
        {
            Vector3 orgiPos = GetMonsterGroupEditorData(waveIdx)[monsterIdx].MyPos;
            //Vector3 direction = GetHerosCenter() - GetMonstersCenter();
            //Vector3 result = orgiPos + HeroPathdata.MoveDistance * direction.normalized;
            Vector3 result = orgiPos - HeroPathtContrler.GetInstantiate().GetMoveTargetOffset();

            return(result);
        }
        /// <summary>
        /// 停止移动;
        /// </summary>
        /// <param name="data"></param>
        public void HeroOnObject(string data)
        {
            GameObject go = GameObject.Find(data);

            if (go != null)
            {
                HeroPathtContrler.GetInstantiate().SetHeroPathIdle();
                StartCoroutine("HeroPathOnObjectMove", go as object);
            }
            else
            {
                Debug.LogError("不存在指定名字的GameObject,name=" + data);
            }
        }
Example #4
0
        private void FightCenterUpdate()
        {
            switch (CamAnglesMovetype)
            {
            case CamMoveType.MomentMove:
                CamCenter = HeroPathtContrler.GetInstantiate().GetFightCenter() + CamCenterDeviant;
                break;

            case CamMoveType.NormalMove:
                //CamAnglesMoveLerp = Mathf.PingPong(Time.time, CamAnglesMoveSpeed * 100) / (CamAnglesMoveSpeed * 100);
                CamCenter = Vector3.Lerp(CamCenter, HeroPathtContrler.GetInstantiate().GetFightCenter() + CamCenterDeviant, CamAnglesMoveSpeed * Time.deltaTime);
                break;

            case CamMoveType.NormalMoveTime:
                CamCenter = Vector3.SmoothDamp(CamCenter, HeroPathtContrler.GetInstantiate().GetFightCenter() + CamCenterDeviant, ref CamAnglesvelocity, CamAnglesMoveTime);
                break;
            }
        }
Example #5
0
        //===================================================================摄像机场景状态更新=============================================================================
        private void CamTypeUpdate()
        {
            switch (Camtype)
            {
            case CamType.Null:
                NullUpdate();
                break;

            case CamType.Enter:
                EnterUpdate();
                break;

            case CamType.LineUp:
                LineUpUpdate();
                break;

            case CamType.Fight:
                FightUpdate();
                break;

            case CamType.FightFixedAOV:
                if (HeroPathtContrler.GetInstantiate() != null)
                {
                    HeroPathtContrler.GetInstantiate().SetFightFollowCamFixEulerAngle();
                }
                FightFixedAOVUpdate();
                break;

            case CamType.DefaultFight:
                DefaultFightUpdate();
                break;

            case CamType.StaticMove:
                MoveUpdate();
                break;

            case CamType.Animation:
                AnimationUpdate();
                break;
            }
        }
 /// <summary>
 /// 初始化阵型坐标给Hero
 /// </summary>
 /// <param name="HeroObj">HeroObj</param>
 /// <param name="i">索引值</param>
 /// <returns></returns>
 public void InitFormationPos(ObjectCreature HeroObj, int i)
 {
     HeroPathtContrler.GetInstantiate().InitFormationPos(HeroObj, i);
 }
 /// <summary>
 /// 获取GameObjAngle
 /// </summary>
 /// <param name="i">索引</param>
 /// <returns></returns>
 public Quaternion GetFormationCenterAngle(int i)
 {
     return(HeroPathtContrler.GetInstantiate().GetFormationCenterAngle(i));
 }
 /// <summary>
 /// 获取阵型前后排距离
 /// </summary>
 /// <returns></returns>
 public float GetFormationSpacing()
 {
     return(HeroPathtContrler.GetInstantiate().GetFormationSpacing());
 }
 public Vector3 GetMonstersCenter()
 {
     return(HeroPathtContrler.GetInstantiate().GetMonstersCenter());
 }
 //############################################英雄阵型调用接口############################################
 /// <summary>
 /// 获取英雄路径信息
 /// </summary>
 /// <returns></returns>
 public HeroPathDataObj GetHeroPathData()
 {
     return(HeroPathtContrler.GetInstantiate().GetHeroPathData());
 }
 /// <summary>
 /// 获取英雄对应的阵型前后排信息(临时接口)
 /// </summary>
 /// <param name="HeroObj">英雄Obj</param>
 /// <returns></returns>
 public string GetFormationTag(ObjectCreature HeroObj)
 {
     return(HeroPathtContrler.GetInstantiate().GetFormationTag(HeroObj));
 }
Example #12
0
 private void OnDestroy()
 {
     inst = this;
 }
 /// <summary>
 /// 英雄阵型进入瞬间移动
 /// </summary>
 public void HeroPathMomentMoveEnter(int i)
 {
     HeroPathtContrler.GetInstantiate().SetHeroPathMomentMoveEnter(i);
 }
 /// <summary>
 /// 英雄阵型退出瞬间移动
 /// </summary>
 public void HeroPathMomentMoveExit()
 {
     HeroPathtContrler.GetInstantiate().SetHeroPathMomentMoveExit();
 }
 /// <summary>
 /// 英雄阵型进入待机
 /// </summary>
 public void HeroPathIdle()
 {
     HeroPathtContrler.GetInstantiate().SetHeroPathIdle();
 }
 /// <summary>
 /// 英雄阵型进入正常移动
 /// </summary>
 public void HeroPathNormalMove()
 {
     HeroPathtContrler.GetInstantiate().SetHeroPathNormalMove();
 }
 /// <summary>
 /// 初始化阵型速度
 /// </summary>
 public void HeroPathInitSpeed()
 {
     HeroPathtContrler.GetInstantiate().HeroPathInitSpeed();
 }
 /// <summary>
 /// 改变英雄阵型移动速度
 /// </summary>
 /// <param name="speed">速度值</param>
 public void HeroPathSetSpeed(float speed)
 {
     HeroPathtContrler.GetInstantiate().SetFormationSpeed(speed);
 }
 /// <summary>
 /// 英雄阵型关
 /// </summary>
 public void HeroPathPause()
 {
     HeroPathtContrler.GetInstantiate().HeroPathPause();
 }
 /// <summary>
 /// 获取英雄整形向前移动后的阵型位置;
 /// </summary>
 /// <param name="HeroObj"></param>
 /// <returns></returns>
 public Vector3 GetFormationMovePos(ObjectCreature HeroObj)
 {
     return(HeroPathtContrler.GetInstantiate().GetFormationMovePos(HeroObj));
 }
 /// <summary>
 /// 获取默认视角战斗摄像机
 /// </summary>
 /// <returns></returns>
 public GameObject GetFightDefaultCam()
 {
     return(HeroPathtContrler.GetInstantiate().GetFightDefaultCam());
 }
 public Quaternion GetFormationAngle(ObjectCreature HeroObj)
 {
     return(HeroPathtContrler.GetInstantiate().GetFormationAngle(HeroObj));
 }
 /// <summary>
 /// 英雄阵型状态进入准备整队状态
 /// </summary>
 public void HeroPathLineUpReady()
 {
     HeroPathtContrler.GetInstantiate().SetHeroPathLineUpReady();
 }
Example #24
0
 protected override void InitData()
 {
     inst = this;
 }
 /// <summary>
 /// 改变阵型
 /// </summary>
 /// <param name="type">阵型类型</param>
 public void HeroPathSetFormation()
 {
     HeroPathtContrler.GetInstantiate().SetFormation();
 }
 public void HeroOffObject()
 {
     HeroPathtContrler.GetInstantiate().SetAniObject(null);
     HeroPathtContrler.GetInstantiate().SetHerosParent(null);
 }
 /// <summary>
 ///  获取阵型GameObjPos
 /// </summary>
 /// <param name="i">索引</param>
 /// <returns></returns>
 public Vector3 GetFormationCenterPos(int i)
 {
     return(HeroPathtContrler.GetInstantiate().GetFormationCenterPos(i));
 }
 /// <summary>
 /// 英雄阵型战斗进入状态结束
 /// </summary>
 public void HeroPathFightEnterEnd()
 {
     HeroPathtContrler.GetInstantiate().SetHeroPathFightEnterEnd();
 }
 /// <summary>
 /// 获取整队摄像机
 /// </summary>
 /// <returns></returns>
 public GameObject GetLineUpFollowCam()
 {
     return(HeroPathtContrler.GetInstantiate().GetLineUpFollowCam());
 }