public IEnumerator SetSpikeFalse() { yield return new WaitForSeconds(0.3f); if(player.transform.localPosition.y > -75f) pMotion = MotionType.JUMP; else { pMotion = MotionType.WALK; playerSprite.Play("Idle"); can_swipe = true; } pSpike = SpikeType.NONE; motion_change = false; motion_change_spike = false; }
// isMidLeft means that if user swipe left then this value gets true else false public void P1Spiking(SpikeType st, bool isMidLeft) { //float velx, vely; //velx = P1.vel_x; //vely = P1.vel_y; if(P1.transform.localPosition.y < -70f) // if Player1's y-axis position is smaller than -70f, then just return return; if(st == SpikeType.HIGH) { P1.pSpike = SpikeType.HIGH; } else if(st == SpikeType.LOW) { P1.pSpike = SpikeType.LOW; } else { P1.pSpike = SpikeType.MID; /*if(isMidLeft) { P1.vel_x = -P1.spike_x_speed; } else { P1.vel_x = P1.spike_x_speed; }*/ } P1.pMotion = MotionType.SPIKE; //if(P1vel_x != P1.vel_x || P1vel_y != P1.vel_y) // is_P1_vel_changed = true; }