Ejemplo n.º 1
0
        /// <summary>
        /// 获取目标位置
        /// </summary>
        /// <param name="posType"></param>
        /// <returns></returns>
        public Transform GetTranform(PosType posType)
        {
            switch (posType)
            {
            case PosType.HEAD:
                return(this.headPos);

            case PosType.GROUND:
                return(this.groundPos);

            case PosType.FRONT:
                return(this.channelPos);

            case PosType.CENTER:
                return(this.centerPos);

            case PosType.LEFTHAND:
                return(this.leftHeadPos);

            case PosType.RIGHTTHAND:
                return(this.rightHeadPos);

            case PosType.WEAPONSTART:
                return(this.weaponStartPos);

            case PosType.WEAPONCENTER:
                return(this.weaponCenterPos);

            case PosType.WEAPONEND:
                return(this.weaponEndPos);
            }
            return(null);
        }
 public void OnAttackButtonClick(bool isPress, PosType posType)
 {
     if (posType == PosType.Basic)
     {
         if (isPress)
         {
             anim.SetTrigger("Attack");
         }
     }
     else
     {
         if (isPress)
         {
             anim.SetBool("Skill" + (int)posType, true);
             texiao.SetActive(true);
             if ((int)posType == 3)
             {
                 lifeTime = 3;
             }
             else
             {
                 lifeTime = 2;
             }
         }
         else
         {
             anim.SetBool("Skill" + (int)posType, false);
         }
     }
 }
Ejemplo n.º 3
0
        virtual protected void updateSceneCardPosInternal(CardArea area, bool bUpdateIdx = true)
        {
            int           idx      = 0;
            SceneCardBase cardItem = null;
            WayPtItem     pt       = null;
            PosType       posType  = PosType.eHandDown;

            if (CardArea.CARDCELLTYPE_HAND == area)
            {
                posType = PosType.eHandDown;
            }
            else if (CardArea.CARDCELLTYPE_COMMON == area)
            {
                posType = PosType.eOutDown;
            }

            getCardPos();

            while (idx < m_sceneCardList.Count())
            {
                cardItem = m_sceneCardList[idx];
                if (bUpdateIdx)
                {
                    cardItem.curIndex = (ushort)idx;
                }

                pt     = cardItem.trackAniControl.wayPtList.getAndAddPosInfo(posType);
                pt.pos = m_posList[idx];
                cardItem.trackAniControl.moveToDestPos(posType);

                ++idx;
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 改变任务在列表中的位置
        /// </summary>
        /// <param name="gid">任务标识符param>
        /// <param name="pos">位置</param>
        /// <param name="how">更改方式, "POS_SET":列表首位, "POS_CUR":移动到pos指定位置,  "POS_END":列表末尾</param>
        /// <returns>成功返回true, 失败返回fale</returns>
        public static bool ChangePosition(string gid, int pos, PosType how)
        {
            string desc    = Aria2cTools.GetEnumDescription(how);
            int    resultt = aria2c.ChangePosition(Aria2cRpcSecret, gid, pos, desc);

            return(true);
        }
Ejemplo n.º 5
0
    Transform GetPos(PosType pos)
    {
        switch (pos)
        {
        case PosType.Hero1: return(HeroPos1);

        case PosType.Hero2: return(HeroPos2);

        case PosType.Hero3: return(HeroPos3);

        case PosType.Hero4: return(HeroPos4);

        case PosType.Hero5: return(HeroPos5);

        case PosType.EmbattlePos: return(EmbattlePos);

        case PosType.SelectPos: return(SelectPos);

        case PosType.TitlePos: return(TitlePos);

        case PosType.uisign: return(uisign);

        case PosType.NpcPos: return(npcPos);

        default: return(DetailPos);
        }
    }
Ejemplo n.º 6
0
    /// <summary>
    /// 播放特效
    /// </summary>
    /// <param name="type"></param>
    /// <param name="tt"></param>
    /// <param name="count"></param>
    /// <param name="_type"></param>
    public void ShowLottryAnimaEffect(PosType type, LotteryType tt, int count, CostType _type)
    {
        switch (type)
        {
        case PosType.Lorry:
            ty         = type;
            typ        = tt;
            this.count = count;
            t          = _type;
            if (!Chouxiangzi.gameObject.activeInHierarchy)
            {
                Chouxiangzi.gameObject.SetActive(true);
            }
            UI_KaiBaoXiang_01.gameObject.SetActive(true); break;

        case PosType.heroEffect:
            if (!Chouxiangzi.gameObject.activeInHierarchy)
            {
                Chouxiangzi.gameObject.SetActive(true);
            }
            UI_KaiBaoXiang_Hero_01.gameObject.SetActive(true);
            break;
        }
        this.type = AnimType.None;
    }
Ejemplo n.º 7
0
    Vector3 GetBoundaryPoint(PosType type)
    {
        Vector3 point   = Vector3.zero;
        float   factor  = 0.5f;
        float   factorX = 1f;
        float   factorY = 1f;

        switch (type)
        {
        case PosType.LeftTop:
            factorX *= -1;
            break;

        case PosType.LeftBottom:
            factorY *= -1;
            factorX *= -1;
            break;

        case PosType.RightTop:
            break;

        case PosType.RightBottom:
            factorY *= -1;
            break;

        default:
            break;
        }

        point = rectTransform.anchoredPosition + new Vector2(rectTransform.sizeDelta.x * factorX * factor + factorX * offset.x, rectTransform.sizeDelta.y * factorY * factor + factorY * offset.y);
        return(point);
    }
Ejemplo n.º 8
0
    public void OnAttackButtonClick(bool isPress, PosType posType)
    {
        if (this.GetComponent <PlayerAttack>().isDead)
        {
            Debug.Log("Player has die");
            return;
        }
        if (posType == PosType.Basic)
        {
            if (isPress)
            {
                anim.SetTrigger("Attack");
            }
        }
        else
        {
            anim.SetBool("Skill" + (int)posType, isPress);
        }
        //判断是否组队,如果是就发送请求到服务器

        if (TeamInviteController.Instance.isTeam)
        {
            PlayerAnimationModel model = new PlayerAnimationModel()
            {
                attack = (posType == PosType.Basic && isPress) ? true : false,
                skill1 = (posType == PosType.One && isPress) ? true : false,
                skill2 = (posType == PosType.Two && isPress) ? true : false,
                skill3 = (posType == PosType.Three && isPress) ? true : false,
            };
            BattleController.Instance.SyncPlayerAttackAnimationRequest(model, PhotonEngine.Instance.role.ID);
        }
    }
Ejemplo n.º 9
0
 public static void Pos(PosType type, double x, double y, double z)
 {
     if (Position != null)
     {
         Position(type, x, y, z);
     }
 }
Ejemplo n.º 10
0
    //public int[] AttackInfo = new int[] { 20,30,30,30};

    public void OnAttackClick(PosType posType)
    {
        //Debug.Log("OnAttackClick");

        if (posType == PosType.Basic)
        {
            PlayerAnim._Instance.PlayAttackAnim();
            //
        }
        else
        {
            if (posType == PosType.One)
            {
                PlayerAnim._Instance.PlaySkillOne();
                StartCoroutine(StopSkill());
            }
            else if (posType == PosType.Two)
            {
                PlayerAnim._Instance.PlaySkillTwo();
                StartCoroutine(StopSkill());
            }
            else if (posType == PosType.Three)
            {
                PlayerAnim._Instance.PlaySkillThree();
                StartCoroutine(StopSkill());
            }
        }
    }
Ejemplo n.º 11
0
    private void Update()
    {
                if (Input.GetKeyDown(KeyCode.A))
        {
            posType = PosType.LEFT;
        }
        else if (Input.GetKeyDown(KeyCode.S))
        {
            posType = PosType.CENTER;
        }
        else if (Input.GetKeyDown(KeyCode.D))
        {
            posType = PosType.RIGHT;
        }

        length += Time.deltaTime * speed;

        if (length >= GameController.instance.routeManger.centerPoints.Count - 1)
        {
            length = GameController.instance.routeManger.centerPoints.Count - 1;
        }

        if (posType == PosType.LEFT)
        {
            rig.transform.localPosition = GameController.instance.routeManger.leftPoints[(int)(length)];
        }
        else if (posType == PosType.CENTER)
        {
            rig.transform.localPosition = GameController.instance.routeManger.centerPoints[(int)(length)];
        }
        else
        {
            rig.transform.localPosition = GameController.instance.routeManger.rightPoints[(int)(length)];
        }
    }
Ejemplo n.º 12
0
 public void ShowModel(PosType pos = PosType.All)
 {
     if (pos == PosType.All)
     {
         return;
     }
     GetPos(pos).gameObject.SetActive(true);
 }
Ejemplo n.º 13
0
 public AnimationPosition(AnimationPosition source) : base(source)
 {
     fromPos      = source.fromPos;
     toPos        = source.toPos;
     lerpType     = source.lerpType;
     posType      = source.posType;
     isFromTarget = source.isFromTarget;
 }
Ejemplo n.º 14
0
 public AnimationPosition(RectTransform target, float length, AnimationCurve curve, Vector3 from_pos, Vector3 to_pos, LerpType lerp_type, PosType pos_type, bool is_from_target) : base(target, length, curve)
 {
     fromPos      = from_pos;
     toPos        = to_pos;
     lerpType     = lerp_type;
     posType      = pos_type;
     isFromTarget = is_from_target;
 }
Ejemplo n.º 15
0
 public float DoComp(float value, ConType conType, PosType posType, PointType pointType)
 {
     if (ContainsKey(conType))
     {
         value = this[conType].DoComp(value, posType, pointType);
     }
     return(value);
 }
Ejemplo n.º 16
0
    public void OnAttackButtonClick(bool isPress, PosType posType)
    {
        if (playerAttack.hp <= 0)
        {
            return;
        }
        if (posType == PosType.Basic)
        {
            if (isPress)
            {
                anim.SetTrigger("Attack");
                if (isSyncPlayerAnimation)
                {
                    battleController.SyncPlayerAnimation(new PlayerAnimationModel()
                    {
                        attack = true
                    });
                }
            }
        }
        else
        {
            anim.SetBool("Skill" + (int)posType, isPress);
            if (isSyncPlayerAnimation)
            {
                if (isPress)
                {
                    switch ((int)posType)
                    {
                    case 1:
                        battleController.SyncPlayerAnimation(new PlayerAnimationModel()
                        {
                            skill1 = true
                        });
                        break;

                    case 2:
                        battleController.SyncPlayerAnimation(new PlayerAnimationModel()
                        {
                            skill2 = true
                        });
                        break;

                    case 3:
                        battleController.SyncPlayerAnimation(new PlayerAnimationModel()
                        {
                            skill3 = true
                        });
                        break;
                    }
                }
                else
                {
                    battleController.SyncPlayerAnimation(new PlayerAnimationModel());
                }
            }
        }
    }
Ejemplo n.º 17
0
        public WayPtItem getAndAddPosInfo(PosType wherePos)
        {
            if (m_ptList[(int)wherePos] == null)
            {
                m_ptList[(int)wherePos] = new WayPtItem();
            }

            return(m_ptList[(int)wherePos]);
        }
Ejemplo n.º 18
0
        public WayPtItem getAndAddPosInfo(PosType wherePos)
        {
            if (m_ptList[(int)wherePos] == null)
            {
                m_ptList[(int)wherePos] = new WayPtItem();
            }

            return m_ptList[(int)wherePos];
        }
Ejemplo n.º 19
0
	public Skill GetSkillByPosition(PosType posType){
		PlayerInfo info = PlayerInfo._instance;
		foreach(Skill skill in skillList){
			if(skill.PlayerType == info.PlayerType && skill.PosType == posType){
				return skill;
			}
		}
		return null;
	}
Ejemplo n.º 20
0
 public GameBase(TileShape _tileShape = TileShape.SQUARE,
                 PosType _posType     = PosType.GridPos,
                 LandType _landType   = LandType.BasicLand)
 {
     turnNumber = 0;
     tileShape  = _tileShape;
     posType    = _posType;
     landType   = _landType;
 }
Ejemplo n.º 21
0
    public void OnAttacButtonClick(bool isPress, PosType posType)
    {
        if (playerAttack.hp < 0)
        {
            return;
        }
        anim.SetTrigger("Skill" + posType);



        //发起动画同步的申请
        if (isSyncPlayerAnimation)
        {
            if (isPress)
            {
                switch ((int)posType)
                {
                case 0:
                    PlayerAnimationModel model0 = new PlayerAnimationModel()
                    {
                        skillBasic = true
                    };
                    battleController.SyncPlayerAnimation(model0);
                    break;

                case 1:
                    PlayerAnimationModel model1 = new PlayerAnimationModel()
                    {
                        skillOne = true
                    };
                    battleController.SyncPlayerAnimation(model1);
                    break;

                case 2:
                    battleController.SyncPlayerAnimation(new PlayerAnimationModel()
                    {
                        skillTwo = true
                    });
                    break;

                case 3:
                    battleController.SyncPlayerAnimation(new PlayerAnimationModel()
                    {
                        skillThree = true
                    });
                    break;
                }
            }
            else
            {
                PlayerAnimationModel model = new PlayerAnimationModel();
                battleController.SyncPlayerAnimation(model);
            }
        }
    }
Ejemplo n.º 22
0
 public Skill GetSkillByPos(PosType pos)
 {
     foreach(Skill skill in skillListInfo)
     {
         if (skill.Postype == pos && skill.PlayerType == playerInfo._instance.PlayerType)
         {
             return skill;
         }
     }
     return null;
 }
Ejemplo n.º 23
0
 public Skill GetSkillByPos(PosType posType)
 {
     foreach (Skill item in skillList)
     {
         if (item.PositionSkill == posType && PlayerInfo.GetInstance.PlayerClass == item.PlayerClass)
         {
             return(item);
         }
     }
     return(null);
 }
Ejemplo n.º 24
0
 public Skill GetSkillByPos(PosType pos)
 {
     foreach (Skill skill in skillListInfo)
     {
         if (skill.Postype == pos && skill.PlayerType == playerInfo._instance.PlayerType)
         {
             return(skill);
         }
     }
     return(null);
 }
Ejemplo n.º 25
0
 public Skill GetSkillByPosition(PosType type)
 {
     for (int i = 0; i < skillList.Count; i++)
     {
         if (skillList[i].PosType == type)
         {
             return skillList[i];
         }
     }
     return null;
 }
Ejemplo n.º 26
0
 /// <summary>
 /// 改变任务在列表中的位置
 /// </summary>
 /// <param name="gid">任务标识符param>
 /// <param name="pos">位置</param>
 /// <param name="how">更改方式, "POS_SET":列表首位, "POS_CUR":移动到pos指定位置,  "POS_END":列表末尾</param>
 /// <returns>成功返回true, 失败返回fale</returns>
 public bool ChangePosition(string gid, int pos, PosType how)
 {
     try
     {
         return(Aria2cWarpper.ChangePosition(gid, pos, how));
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex);
         return(false);
     }
 }
Ejemplo n.º 27
0
    public Skill GetSkillByPostype(PosType posType)
    {
        for (int i = 0; i < skillList.Count; i++)
        {
            if (skillList[i].PlayerType == PlayerInfo._Instance.PlayerType && skillList[i].PosType == posType)
            {
                return(skillList[i]);
            }
        }


        return(null);
    }
Ejemplo n.º 28
0
    public Skill GetSkillByPosition(PosType posType)
    {
        PlayerInfomation info = PlayerInfomation.instance;

        foreach (Skill skill in skillList)
        {
            if (skill.MType == info.MType && skill.PosType == posType)  //返回的技能唯一
            {
                return(skill);
            }
        }
        return(null);
    }
Ejemplo n.º 29
0
    public Skill GetSkillByPostion(PosType posType)
    {
        PlayerInfo info = PlayerInfo.Intance;

        foreach (Skill skill in skillList)
        {
            if (skill.PlayerType == info.PlayerType && skill.PosType == posType)
            {
                return(skill);
            }
        }
        return(null);
    }
Ejemplo n.º 30
0
 public void OnAttackButtonClick(bool isPress, PosType posType)   //from skillbutton
 {
     if (posType == PosType.Basic)
     {
         if (isPress)//鼠标按下 true
         {
             ainm.SetTrigger("attack");
         }
     }
     else
     {
         ainm.SetBool("skill" + (int)posType, isPress);
     }
 }
Ejemplo n.º 31
0
    public GameObject CreatModel(string goName, PosType pos, SpinWithMouse spin, AnimType type = AnimType.None, int rota = 180, float z = 0)
    {
        this.type = type;
        model     = null;
        DestroyModel(pos);
        SetEmbattleBG(pos);
        model = Resource.CreateCharacter(goName, parent.gameObject);
        if (goName == "boss_009")
        {
            model.transform.localPosition = new Vector3(0, 0.2f, 0);
        }
        model.transform.localRotation = Quaternion.Euler(0, rota, 0);
        if (z != 0)
        {
            model.transform.localPosition = new Vector3(0, 0, z);
        }
        Transform redCircle = model.transform.FindChild("Effect_targetselected01");

        if (redCircle != null)
        {
            redCircle.gameObject.SetActive(false);
        }
        NGUITools.SetLayer(model, LayerMask.NameToLayer("UI"));
        model.tag = Tag.monster;
        //if (pos == PosType.SelectPos)
        //{
        //    model.transform.localScale = model.transform.localScale * 1.4f;
        //}
        GameObject taizi = transform.Find("TitlePos/fazhenxuanren_taizi").gameObject;

        if (taizi != null && pos == PosType.TitlePos)
        {
            model.transform.parent = taizi.transform;
            spin.target            = taizi.transform;
        }
        else if (pos == PosType.SelectPos)
        {
            spin.target = SelectPos;
        }
        else if (spin != null)
        {
            spin.target = model.transform;
        }

        if (null != model)
        {
            PlayAppearedAnim(model);
        }
        return(model);
    }
	public void OnAttackButtonClick(bool isPress,PosType posType)
	{
		if(posType == PosType.Basic)
		{
			if(isPress)
			{
				anim.SetTrigger("Attack");
			}
		}
		else
		{
			anim.SetBool(("Skill"+(int)posType), isPress);
		}
	}
Ejemplo n.º 33
0
        private void GRBLMachinePlugin_Position(PosType type, double x, double y, double z)
        {
            if (type == PosType.MachineCoordinates ||
                type == PosType.WorkCoordinates)
            {
                Units drawingUnits = CamBamUI.MainUI.ActiveView.CADFile.DrawingUnits;

                if (!double.IsNaN(x))
                {
                    _posiX = x.GetWorkOrMachinePosition(type, _WCO_x, PosType.WorkCoordinates, GRBLMachinePlugin.Props.ReportInInches, drawingUnits);
                }

                if (!double.IsNaN(y))
                {
                    _posiY = y.GetWorkOrMachinePosition(type, _WCO_y, PosType.WorkCoordinates, GRBLMachinePlugin.Props.ReportInInches, drawingUnits);
                }

                if (!double.IsNaN(z))
                {
                    _posiZ = z.GetWorkOrMachinePosition(type, _WCO_z, PosType.WorkCoordinates, GRBLMachinePlugin.Props.ReportInInches, drawingUnits);
                }

                CalcNext();
            }
            else if (type == PosType.WCO)
            {
                bool needNewLimits = (_WCO_x != x) || (_WCO_y != y) || (_WCO_z != z);

                if (!double.IsNaN(x))
                {
                    _WCO_x = x;
                }

                if (!double.IsNaN(y))
                {
                    _WCO_y = y;
                }

                if (!double.IsNaN(z))
                {
                    _WCO_z = z;
                }

                if (GRBLMachinePlugin.Props.DrawLimits == EnabledDisabled.Enabled && needNewLimits)
                {
                    CreateLimits();
                }
            }
        }
Ejemplo n.º 34
0
        public void Set(float value, ConType conType, PosType posType, PointType pointType)
        {
            CompPOS pos;

            if (ContainsKey(conType))
            {
                pos = this[conType];
            }
            else
            {
                pos = new CompPOS();
                Add(conType, pos);
            }
            pos.Set(value, posType, pointType);
        }
Ejemplo n.º 35
0
        public void LoadPts(string file)
        {
            using (var fs = new FileStream(file, FileMode.Open))
            {
                using (var sr = new StreamReader(fs))
                {
                    //find platform pos start line
                    var line = sr.ReadLine();
                    if (line != null && line.StartsWith(Name))
                    {
                        var propCount = PosType.GetProperties().Length;

                        //start read pos lines
                        line = sr.ReadLine();
                        while (!string.IsNullOrEmpty(line))
                        {
                            var data = line.Split(',');
                            if (data.Length == propCount)
                            {
                                if (PosType == typeof(PosXYZ))
                                {
                                    Positions.Add(PosXYZ.Create(line));
                                }
                                else if (PosType == typeof(PosXYZU))
                                {
                                    Positions.Add(PosXYZU.Create(line));
                                }
                                else if (PosType == typeof(PosXYZUVW))
                                {
                                    Positions.Add(PosXYZUVW.Create(line));
                                }
                                else
                                {
                                    //pos type error
                                }
                            }
                            else
                            {
                                //pos prop length error
                                MessageBox.Show($"{line} Props Count Error");
                            }

                            line = sr.ReadLine();
                        }
                    }
                }
            }
        }
Ejemplo n.º 36
0
	public void OnAttackButtonClick(bool isPress,PosType posType){
		if (playerAttack.hp <= 0) {
			return;
		}
		if (posType == PosType.Basic) {
			if(isPress){
				anim.SetTrigger("Attack");
			}
		} else {
			if(isPress){
				anim.SetBool("Skill"+(int)posType,true);
			} else {
				anim.SetBool("Skill"+(int)posType,false);
			}
		}
	}
Ejemplo n.º 37
0
	public void OnAttackButtonClick(bool isPress,PosType posType)
	{
	    if (playerAttack.hp <= 0) return;
	    if (posType == PosType.Basic)
	    {
	        if (isPress)
	        {
	            anim.SetTrigger("Attack");
	            if (isSyncPlayerAnimation)
	            {
                    battleController.SyncPlayerAnimation(new PlayerAnimationModel(){attack = true});
	            }
	        }
	    }
	    else
	    {
	        anim.SetBool("Skill" + (int) posType, isPress);
	        if (isSyncPlayerAnimation)
	        {

	            if (isPress)
	            {
                    switch ((int)posType)
                    {
                        case 1:
                            battleController.SyncPlayerAnimation(new PlayerAnimationModel() { skill1 = true });
                            break;
                        case 2:
                            battleController.SyncPlayerAnimation(new PlayerAnimationModel() { skill2 = true });
                            break;
                        case 3:
                            battleController.SyncPlayerAnimation(new PlayerAnimationModel() { skill3 = true });
                            break;
                    }
	            }
	            else
	            {
                    battleController.SyncPlayerAnimation(new PlayerAnimationModel()); 
	            }

	            
	        }
	    }
	}
Ejemplo n.º 38
0
    /// <summary>
    /// //目の前の攻撃判定
    /// </summary>
    /// <param name="enemyPosition">敵の位置(ワールド座標)</param>
    /// <param name="type">攻撃手段</param>
    /// <param name="isEffect">特殊攻撃?</param>
    /// <returns></returns>
    bool AttackFront(Vector3 enemyPosition, PosType type, bool isEffect)
    {
        enemyLocalPosition = transform.InverseTransformPoint(enemyPosition);

        if (enemyLocalPosition.z > 0.0f)//敵は正面にいる
        {
            attackDis = getAttackDis(type, isEffect);
            //Debug.Log(playerState.GetAttackDis());
            if (Vector3.Distance(enemyPosition, transform.position) < attackDis)
            {
                //Debug.Log("hit!");
                return true;
            }
        }
        return false;
    }
Ejemplo n.º 39
0
 float getAttackDis(PosType type, bool isEffect)
 {
     switch (type)
     {
         case PosType.basic:
             attackDis = playerState.GetAttackDis();
             break;
         case PosType.one:
             attackDis = isEffect ? SkillManager._instance.GetSkillByPosition(PosType.one).EffectDis : SkillManager._instance.GetSkillByPosition(PosType.one).AttackDis;
             break;
         case PosType.two:
             attackDis = isEffect ? SkillManager._instance.GetSkillByPosition(PosType.two).EffectDis : SkillManager._instance.GetSkillByPosition(PosType.two).AttackDis;
             break;
         case PosType.three:
             attackDis = isEffect ? SkillManager._instance.GetSkillByPosition(PosType.three).EffectDis : SkillManager._instance.GetSkillByPosition(PosType.three).AttackDis;
             break;
         default:
             break;
     }
     return attackDis;
 }
Ejemplo n.º 40
0
 /// <summary>
 /// 動画管理
 /// </summary>
 /// <param name="skillType"></param>
 /// <param name="posType"></param>
 public void Attack(SkillType skillType, PosType posType)
 {
     //今回の攻撃が未完成時攻撃を入力すると、次の攻撃を備える
     switch (skillType)
     {
         case SkillType.basic:
             {
                 if ((anim.GetCurrentAnimatorStateInfo(1).fullPathHash == (hash.EmptyState) ||
                     anim.GetCurrentAnimatorStateInfo(1).fullPathHash == (hash.NormalAttack1State) ||
                     anim.GetCurrentAnimatorStateInfo(1).fullPathHash == (hash.NormalAttack2State)) &&
                     CanAttack(SkillType.basic, 0))
                 {
                     anim.SetTrigger(hash.AttackTrigger);
                 }
                 break;
             }
         case SkillType.skill:
             {
                 switch (posType)
                 {
                     case PosType.one:
                         {
                             if (anim.GetCurrentAnimatorStateInfo(1).fullPathHash == (hash.EmptyState) && CanAttack(SkillType.skill, PosType.one))
                             {
                                 anim.SetTrigger(hash.Skill1Trigger);
                             }
                             break;
                         }
                     case PosType.two:
                         {
                             if (anim.GetCurrentAnimatorStateInfo(1).fullPathHash == (hash.EmptyState) && CanAttack(SkillType.skill, PosType.two))
                             {
                                 anim.SetTrigger(hash.Skill2Trigger);
                             }
                             break;
                         }
                     case PosType.three:
                         {
                             if (anim.GetCurrentAnimatorStateInfo(1).fullPathHash == (hash.EmptyState) && CanAttack(SkillType.skill, PosType.three))
                             {
                                 anim.SetTrigger(hash.Skill3Trigger);
                             }
                             break;
                         }
                 }
                 break;
             }
     }
 }
Ejemplo n.º 41
0
    /// <summary>
    /// 攻撃動作による、体力足りるか否や
    /// </summary>
    /// <param name="skillType">攻撃種類</param>
    /// <param name="posType">スキル種類</param>
    /// <returns></returns>
    bool CanAttack(SkillType skillType, PosType posType)
    {

        switch (skillType)
        {
            case SkillType.basic:
                {
                    if (playerState.energy < 20)
                    {
                        return false;
                    }
                    break;
                }
            case SkillType.skill:
                {
                    switch (posType)
                    {
                        case PosType.one:
                            {
                                if (playerState.energy < SkillManager._instance.GetSkillByPosition(PosType.one).Enegy)
                                {
                                    return false;
                                }
                                break;
                            }
                        case PosType.two:
                            {
                                if (playerState.energy < SkillManager._instance.GetSkillByPosition(PosType.two).Enegy)
                                {
                                    return false;
                                }
                                break;
                            }
                        case PosType.three:
                            {
                                if (playerState.energy < SkillManager._instance.GetSkillByPosition(PosType.three).Enegy)
                                {
                                    return false;
                                }
                                break;
                            }
                    }
                    break;
                }
        }
        return true;
    }
Ejemplo n.º 42
0
        //// 到目标位置,移动、旋转、缩放
        //private void moveToDestRST(PosType type = PosType.eHandDown)
        //{
        //    m_curPt = m_wayPtList.getPosInfo(type);

        //    RSTAni rstAni;
        //    rstAni = new RSTAni();
        //    m_numAniParal.addOneNumAni(rstAni);
        //    rstAni.setGO(m_card.gameObject());
        //    rstAni.destPos = m_curPt.pos;
        //    rstAni.destRot = m_curPt.rot;
        //    rstAni.destScale = m_curPt.scale;

        //    m_numAniParal.play();
        //}

        //// 到目标位置,移动、缩放
        //private void moveToDestST(PosType type = PosType.eHandDown)
        //{
        //    m_curPt = m_wayPtList.getPosInfo(type);

        //    STAni stAni;
        //    stAni = new STAni();
        //    m_numAniParal.addOneNumAni(stAni);
        //    stAni.setGO(m_card.gameObject());
        //    stAni.destPos = m_curPt.pos;
        //    stAni.destScale = m_curPt.scale;

        //    m_numAniParal.play();
        //}

        //// 到目标位置,移动、旋转
        //private void moveToDestRT(PosType type = PosType.eHandDown)
        //{
        //    m_curPt = m_wayPtList.getPosInfo(type);

        //    RTAni rtAni;
        //    rtAni = new RTAni();
        //    m_numAniParal.addOneNumAni(rtAni);
        //    rtAni.setGO(m_card.gameObject());
        //    rtAni.destPos = m_curPt.pos;
        //    rtAni.destRot = m_curPt.rot;

        //    m_numAniParal.play();
        //}

        //// 移动动画
        //private void moveToDestT(PosType type = PosType.eHandDown)
        //{
        //    m_curPt = m_wayPtList.getPosInfo(type);

        //    // 旋转和缩放直接设置
        //    UtilApi.setRot(m_card.transform(), m_curPt.rot);
        //    UtilApi.setScale(m_card.transform(), m_curPt.scale);

        //    PosAni posAni;
        //    posAni = new PosAni();
        //    m_numAniParal.addOneNumAni(posAni);
        //    posAni.setGO(m_card.gameObject());
        //    posAni.destPos = m_curPt.pos;

        //    m_numAniParal.play();
        //}

        //// 缩放
        //private void moveToDestScale(PosType type)
        //{
        //    m_curPt = m_wayPtList.getPosInfo(type);

        //    ScaleAni scaleAni = new ScaleAni();
        //    m_numAniParal.addOneNumAni(scaleAni);
        //    scaleAni.setGO(m_card.gameObject());
        //    scaleAni.destScale = m_curPt.scale;
        //    m_numAniParal.play();
        //}

        // 移动动画
        public void moveToDestPos(PosType type = PosType.eHandDown)
        {
            // 开始做轨迹动画前需要关闭 DopeSheet 动画 Drag Title 动画
            // 停止 DopeSheet 动画
            if (m_startAni != null)
            {
                m_startAni.stop();
                m_startAni.disable();
            }
            disableWindowTitle();

            m_curPt = m_wayPtList.getPosInfo(type);

            if (!UtilApi.isVectorEqual(m_card.transform().localEulerAngles, m_curPt.rot))
            {
                RotAni rotAni;
                rotAni = new RotAni();
                m_numAniParal.addOneNumAni(rotAni);
                rotAni.setGO(m_card.gameObject());
                rotAni.destRot = m_curPt.rot;
            }
            if (!UtilApi.isVectorEqual(m_card.transform().localScale, m_curPt.scale))
            {
                ScaleAni scaleAni;
                scaleAni = new ScaleAni();
                m_numAniParal.addOneNumAni(scaleAni);
                scaleAni.setGO(m_card.gameObject());
                scaleAni.destScale = m_curPt.scale;
            }
            if (!UtilApi.isVectorEqual(m_card.transform().localPosition, m_curPt.pos))
            {
                PosAni posAni;
                posAni = new PosAni();
                m_numAniParal.addOneNumAni(posAni);
                posAni.setGO(m_card.gameObject());
                posAni.destPos = m_curPt.pos;
            }

            m_numAniParal.play();
        }
Ejemplo n.º 43
0
    /// <summary>
    /// Energy消費
    /// </summary>
    /// <param name="skillType"></param>
    /// <param name="posType"></param>
    public void UseEnergy(SkillType skillType, PosType posType)
    {

        switch (skillType)
        {
            case SkillType.basic:
                {
                    playerState.UseEnergy(8);
                    break;
                }
            case SkillType.skill:
                {
                    switch (posType)
                    {
                        case PosType.one:
                            {
                                playerState.UseEnergy(SkillManager._instance.GetSkillByPosition(PosType.one).Enegy);
                                break;
                            }
                        case PosType.two:
                            {
                                playerState.UseEnergy(SkillManager._instance.GetSkillByPosition(PosType.two).Enegy);
                                break;
                            }
                        case PosType.three:
                            {
                                playerState.UseEnergy(SkillManager._instance.GetSkillByPosition(PosType.three).Enegy);
                                break;
                            }
                    }
                    break;
                }
        }
    }
	public void OnAttackButtonClick(bool isPress,PosType posType)
	{
        if (posType == PosType.Basic)
        {
            if (isPress)
            {
                anim.SetTrigger("Attack");
                if(isSyncPlayerAnimation)
                    battleController.SyncPlayerAnimation(new PlayerAnimationModel() { attack = true });
            }
        }
        else
        {
            switch (posType)
            {
                case PosType.One:
                    if (isPress){
                        anim.SetBool("skill1", true);
                        if (isSyncPlayerAnimation)
                        {
                            battleController.SyncPlayerAnimation(new PlayerAnimationModel() { skill1 = true });
                        }
                    }
                        
                    else
                    {
                        anim.SetBool("skill1", false);
                        if (isSyncPlayerAnimation)
                        {
                            PlayerAnimationModel model = new PlayerAnimationModel() {};
                            battleController.SyncPlayerAnimation(model);
                        }
                    }
                    break;
                case PosType.Two:
                    if (isPress){
                        anim.SetBool("skill2", true);
                        if (isSyncPlayerAnimation)
                        {
                            battleController.SyncPlayerAnimation(new PlayerAnimationModel() { skill2 = true });
                        }
                    }
                    else
                    {
                        anim.SetBool("skill2", false);
                        if (isSyncPlayerAnimation)
                        {
                            PlayerAnimationModel model = new PlayerAnimationModel() {};
                            battleController.SyncPlayerAnimation(model);
                        }
                    }
                    break;
                case PosType.Three:
                    if (isPress)
                    {
                        anim.SetBool("skill3", true);
                        if (isSyncPlayerAnimation)
                        {
                            PlayerAnimationModel model = new PlayerAnimationModel() { skill3 = true };
                            battleController.SyncPlayerAnimation(model);
                        }
                    }
                    else
                    {
                        anim.SetBool("skill3", false);
                        if (isSyncPlayerAnimation)
                        {
                            PlayerAnimationModel model = new PlayerAnimationModel() { };
                            battleController.SyncPlayerAnimation(model);
                        }
                    }   
                    break;
            }
        } 
    }
Ejemplo n.º 45
0
 public void setPosInfo(PosType wherePos, WayPtItem pos)
 {
     m_ptList.Add(pos);
 }
Ejemplo n.º 46
0
 public WayPtItem getPosInfo(PosType wherePos)
 {
     return m_ptList[(int)wherePos];
 }
Ejemplo n.º 47
0
 /// <summary>
 /// 周りの攻撃判定
 /// </summary>
 /// <param name="enemyPosition">敵の位置(ワールド座標)</param>
 /// <param name="type">攻撃手段</param>
 /// <param name="isEffect">特殊攻撃?</param>
 /// <returns></returns>
 bool AttackAround(Vector3 enemyPosition, PosType type, bool isEffect)
 {
     attackDis = getAttackDis(type, isEffect);
     if (Vector3.Distance(enemyPosition, transform.position) < attackDis)
     {
         //Debug.Log("hit!");
         return true;
     }
     return false;
 }