public void ShakeFloor() { // move floor up and down if (_current_shake_num >= _shake_num) { _done_attacking = true; Debug.Log("Done attacking"); _FloorController.enable(); _FloorController.resetFloor(); return; } _current_shake_num++; if (_shake_dir == 1) { StartCoroutine(RaiseFloorLeft(_shake_voltage, _shake_intival / 2)); StartCoroutine(RaiseFloorRight(_shake_voltage, _shake_intival / 2)); } else if (_shake_dir == -1) { StartCoroutine(RaiseFloorRight(_shake_voltage, _shake_intival / 2)); StartCoroutine(RaiseFloorLeft(_shake_voltage, _shake_intival / 2)); } else if (_shake_dir == 2) { StartCoroutine(RaiseFloorBack(_shake_voltage, _shake_intival / 2)); StartCoroutine(RaiseFloorFront(_shake_voltage, _shake_intival / 2)); } else if (_shake_dir == -2) { StartCoroutine(RaiseFloorRight(_shake_voltage, _shake_intival / 2)); StartCoroutine(RaiseFloorFront(_shake_voltage, _shake_intival / 2)); } // play shake sound // PlayShakeSound (); }