Beispiel #1
0
    public virtual void Crush(TypeCrush type = TypeCrush.NONE)
    {
        if (CameraShake.Instance)
        {
            CameraShake.Instance.StartShakeBy(ShakeTime, ShakePreset);
        }
        if (type != TypeCrush.NONE)
        {
            switch (TypeEnemy)
            {
            case 0:
                if (SaveManager.Instance.dataKlaus != null)
                {
                    SaveManager.Instance.dataKlaus.AddDestroy_Clone();
                }
                break;

            case 1:
                if (SaveManager.Instance.dataKlaus != null)
                {
                    SaveManager.Instance.dataKlaus.AddDestroy_MugClone();
                }
                break;
            }
        }
        Kill();
        ManagerStop.Instance.StopAll(0.1f);
    }
Beispiel #2
0
    public override void Crush(TypeCrush type = TypeCrush.Middle)
    {
        if (CameraShake.Instance != null)
        {
            CameraShake.Instance.StartShakeBy(ShakeTime, ShakePreset);
        }

        killer.Explode(moveStateTarget);
        ManagerStop.Instance.StopAll(0.1f);
    }
Beispiel #3
0
    public void Crush(TypeCrush type = TypeCrush.Middle)
    {
        if (!vulnerable)
        {
            return;
        }

        vulnerable = false;
        StopCoroutine("VulnerableTimer");
        StartCoroutine("TakeHit");
    }
Beispiel #4
0
    public override void DoBeforeEntering()
    {
        // SI hay suscriptores a este evento, NO lanzar ataque
        if (LaunchPunchAction != null)
        {
            LaunchPunchAction();
            fsm.PerformTransition(Transition.CrushToMove);
            return;
        }

        //rigidbody2D.isKinematic = true;
        rigidBody2D.velocity     = Vector2.zero;
        store_GravityScale       = rigidBody2D.gravityScale;
        rigidBody2D.gravityScale = 0;
        anim.SetBool("isCrushing", true);
        anim.SetTrigger("CrushTrigger");

        ManagerPause.SubscribeOnPauseGame(OnPauseGame);
        ManagerPause.SubscribeOnResumeGame(OnResumeGame);

        anim.SetFloat("CrushDir", directionAxis);

        //Defino al direccion del golpe:
        if (directionAxis > inputOffset && canPuchUp)//arriba
        {
            typeC       = TypeCrush.Upper;
            useForceUp  = true;
            canPuchUp   = false;
            timerPuchUp = false;
            moveState.SetIsNONWhenJump();
            StartCoroutine("StartCrush", TimeToCrushUp);
            StartCoroutine(timerVar.StartTime(SetTimerPushUp, TimeToPushUp + TimeToCrushUp));
            highHitSFX.Spawn(transform.position, transform.rotation);
        }
        else if (directionAxis < -1 * inputOffset)//abajo
        {
            typeC  = TypeCrush.Down;
            isDown = true;
            moveState.RemoveLayerToWhatisGround("Obstacle");
            StartCoroutine("StartCrush", TimeToCrushDown);
            lowHitSFX.Spawn(transform.position, transform.rotation);
        }
        else//middle
        {
            typeC                = TypeCrush.Middle;
            puno.enabled         = true;
            punoRenderer.enabled = true;

            StartCoroutine("StartCrush", TimeToCrush);
            anim.SetFloat("CrushDir", 0);
            middleHitSFX.Spawn(transform.position, transform.rotation);
        }
    }
Beispiel #5
0
 public void Crush(TypeCrush type = TypeCrush.Middle)
 {
     if (!isDestroyed)
     {
         if (SaveManager.Instance.dataKlaus != null)
         {
             if (type == TypeCrush.Upper)
             {
                 SaveManager.Instance.dataKlaus.AddDestroy_ObjectUpper();
             }
             SaveManager.Instance.dataKlaus.AddDestroy_Object();
         }
         StartDestroy();
     }
 }
Beispiel #6
0
 public void Crush(TypeCrush type = TypeCrush.Middle)
 {
     controller.Crush();
 }
Beispiel #7
0
 public void Crush(TypeCrush type = TypeCrush.Middle)
 {
     GetComponentInChildren <MoveState>().Kill();
 }