void doEmit()
    {
        releasePower = chargedPower;
        chargedPower = 0;

        if (releasePower > 0)
        {
            //setUp speedUtil
            if (explosionCube == null)
            {
                float total_distance = (releasePower * 60F * 0.8F);
                myMove.setTarget(releasePower, total_distance, chargeDuration);
            }
            else
            {
                //if explosionCube is here, the speedUnit will no need
                if (weapon != null)
                {
                    foreach (WeaponController wp in weapon)
                    {
                        wp.Action_attack_rotate(360F * 3, 1.5F);
                    }
                }
            }
        }
    }
예제 #2
0
    public void AIActionMoveTo(Vector3 n_point)
    {
        KnockBackHelper comp_kb = GetComponent <KnockBackHelper>();

        if (comp_kb != null)
        {
            SpeedUnit n_speedUnit = new SpeedUnit();
            n_speedUnit.setTarget(getMaxMoveSpeed(), attack_radius / 2, getSpeedUpDuration());

            comp_kb.doMoveToPositionWithUpdate(n_speedUnit, n_point);
            Debug.Log("Do move to " + n_point);
        }
    }
예제 #3
0
    /// <summary>
    /// Players the action move to.
    /// </summary>
    /// <param name="n_point">N point.</param>

    public void PlayerActionMoveTo(Vector3 n_point)
    {
        //tend to target position
        AngleProvidor comp_tend          = GetComponent <AngleProvidor>();
        float         lookAtPos_distance = comp_tend.LookAtWithTargetPosition(n_point, false);

        //do transform the n_point with maximu move distance
        if (lookAtPos_distance > attack_radius / 2)
        {
            Debug.Log("lookat Position " + n_point + " is too far. ");
            n_point = comp_tend.GetTendPositionWithOutNewTarget(attack_radius / 2);
        }

        KnockBackHelper comp_kb = GetComponent <KnockBackHelper>();

        if (comp_kb != null)
        {
            SpeedUnit n_speedUnit = new SpeedUnit();
            n_speedUnit.setTarget(getMaxMoveSpeed(), attack_radius / 2, getSpeedUpDuration());

            comp_kb.doMoveToPositionWithUpdate(n_speedUnit, n_point);
            Debug.Log("Do move to " + n_point);
        }
    }