Ejemplo n.º 1
0
    private void Jump()
    {
        jumping = false;

        EditorDebug.Log(eventQueue.Count);

        while (eventQueue.Count != 0)
        {
            Character.Order ev = eventQueue.Dequeue();

            EditorDebug.Log(ev);

            if (ev == Character.Order.OrderJump)
            {
                rigidbody2D.AddForce(jumpForce, ForceMode2D.Impulse);

                if (character.transform.position.y < maxHeight)
                {
                    jumping = true;
                }
            }
        }

        if (!jumping)
        {
            stateMachine.Trigger(Character.Trigger.Fall);
        }
    }
Ejemplo n.º 2
0
    protected override void onSkillTriggerEnter(Collider _collider)
    {
        base.onSkillTriggerEnter(_collider);

        var bsa = _collider.GetComponentInParent <BattleStageActor> ();

        if (bsa != null)
        {
                        #if EditorDebug
            sb.Append("技能 :[" + skillMapId + "]" + "碰撞到目标  [" + bsa.actordata.logName + "] \n");
                        #endif

            bool ispass = SkillFilter.SkillBasicFilter(bsa.actordata, skillData.attackerData, skillData.compareContent);
            if (ispass)
            {
                bsa.buffAndSkill.OnSkillEnter(skillData);
                setState(fireFinish_state);
            }

                        #if EditorDebug
            sb.Append(ispass ? "命中有效" : "命中无效");
            EditorDebug.Log(sb.ToString());
                        #endif
        }
    }
Ejemplo n.º 3
0
    protected override void OnEnter(ref Character.ChangedStateEventArgs e)
    {
        EditorDebug.Log("JUMPING ENTER");

        float initPosY = character.transform.position.y;

        maxHeight = initPosY + height;

        rigidbody2D.AddForce(jumpForce, ForceMode2D.Impulse);
    }
Ejemplo n.º 4
0
    /// <summary>
    /// 添加buff
    /// </summary>
    /// <param name="_buffdata">Buffdata.</param>
    public void AddBuff(BuffData _buffdata)
    {
                #if EditorDebug
        EditorDebug.Log("添加buffId :[" + _buffdata.buffId + "] name :[" + JSONBuffData.instance.GetName(_buffdata.buffId) + "  attacker :[" + _buffdata.attackerData.logName + "]  hiter :[" + _buffdata.hiterData.logName + "]");
                #endif


        BuffCompute _bb = new BuffCompute(_buffdata, 1);

        _bb.BuffBegin();
    }
Ejemplo n.º 5
0
        public string GetLineByTagAttribute(string tag)
        {
            foreach (XmlNode lineInfo in lines)
            {
                if (lineInfo.Attributes["tag"].Value == tag)
                {
                    return(lineInfo.InnerText);
                }
            }

            EditorDebug.Log("TAG NOT FOUND! REMEMBER BUILD ASSETBUNDLES!");

            return(string.Empty);
        }
Ejemplo n.º 6
0
    public void Attack()
    {
        attackingTime = 2.0f;
        cachedTime    = Time.time;
                #if EditorDebug
        EditorDebug.Log(stageActor.actordata.logName + "  发起攻击 目标 : [" + cachedWeaponData.target.actordata.logName + "]");
                #endif

        SkillData sd = new SkillData();
        sd.skillId      = cachedWeaponData.skillId;
        sd.attackerData = stageActor.actordata;
        sd.hiterData    = cachedWeaponData.target.actordata;
        sd.targetPos    = cachedWeaponData.target.transform.position;
        sd.power        = 100;


        SkillMgr.instance.PlaySkill(sd);
    }
Ejemplo n.º 7
0
 protected override void OnEnter(ref Character.ChangedStateEventArgs e)
 {
     EditorDebug.Log("FALLING ENTER");
 }