minor bug fixes, settings menu fixed, tutorial fixes

This commit is contained in:
2023-05-18 00:08:40 -04:00
parent 7f2dc9d2e3
commit 461a297e12
17 changed files with 629 additions and 534 deletions

View File

@ -28,8 +28,7 @@ public class SkinlessMonsterAnimator : MonoBehaviour
private float fastDeathduration = 1f;
[SerializeField]
private float deathDuration = 5f;
[SerializeField]
private string deathAnimationName = "PainScream";
// Start is called before the first frame update
@ -123,7 +122,7 @@ public class SkinlessMonsterAnimator : MonoBehaviour
{
//animator.speed = 0;
InLight();
//animator.Play(this.deathAnimationName);
isAlive = false;
foreach(GameObject obj in this.objectsThatFallOnDeath)

View File

@ -44,7 +44,7 @@ public class SkinlessMonsterComponent : MonoBehaviour
private float timeSinceTarget = 0f;
private InGameManager manager;
private bool prePauseStoppedState = false;
//private bool prePauseStoppedState = false;
[SerializeField]
private BoxCollider leftHandDamage;

View File

@ -13,8 +13,8 @@ public class SwarmAnimator : MonoBehaviour
private Vector3 previousPosition;
[SerializeField]
private Rigidbody rb;
[SerializeField]
private string parameterName = "DeltaVector";
//[SerializeField]
//private string parameterName = "DeltaVector";
[SerializeField]
private Vector3 avoidancePosDefault;

View File

@ -19,13 +19,16 @@ public class InGameManager : MonoBehaviour
private bool isPaused = false;
private bool isTransitioning = false;
[SerializeField]
private float pauseTransitionDuration = 1f;
// [SerializeField]
//private float pauseTransitionDuration = 1f;
[SerializeField]
private Canvas gameCanvas;
[SerializeField]
private Canvas pausedCanvas;
[SerializeField]
private List<AudioSource> sounds = new List<AudioSource>();
private List<float> initSoundVolumes = new List<float>();
public bool IsPaused { get { return this.isPaused; } }
@ -99,7 +102,13 @@ public class InGameManager : MonoBehaviour
}
public void SetVolume(float volume)
{
for (int i = 0;i<sounds.Count;i++)
{
sounds[i].volume = initSoundVolumes[i]*volume;
}
}
// Start is called before the first frame update
void Start()
{
@ -110,7 +119,12 @@ public class InGameManager : MonoBehaviour
pausedVolume.weight = 0;
gameCanvas.gameObject.SetActive(true);
pausedCanvas.gameObject.SetActive(false);
foreach (AudioSource source in sounds)
{
initSoundVolumes.Add(source.volume);
}
}
// Update is called once per frame
@ -119,7 +133,7 @@ public class InGameManager : MonoBehaviour
if (Input.GetButtonDown("Pause"))
{
this.TogglePause();
print("Toggled!");
}
if (isTransitioning||true)

View File

@ -12,7 +12,10 @@ public class InGameMenuManager : MonoBehaviour
private Animator menuAnimator;
[SerializeField]
private Scrollbar sensitivitySlider;
[SerializeField]
private Scrollbar volumeSlider;
private PlayerComponent player;
private InGameManager gameManager;
// Start is called before the first frame update
void Start()
@ -21,6 +24,7 @@ public class InGameMenuManager : MonoBehaviour
settingsButton.onClick.AddListener(SettingsClicked);
returnToMenuButton.onClick.AddListener(SettingsUnClicked);
player = GameObject.FindObjectOfType(typeof(PlayerComponent)) as PlayerComponent;
gameManager = GameObject.FindObjectOfType<InGameManager>();
}
void SettingsClicked()
{
@ -33,7 +37,11 @@ public class InGameMenuManager : MonoBehaviour
}
public void UpdateSensitivity()
{
this.player.SetSensitivity(sensitivitySlider.value);
this.player.SetSensitivity(sensitivitySlider.value*4f);
}
public void UpdateVolume()
{
gameManager.SetVolume(volumeSlider.value*2);
}
// Update is called once per frame

View File

@ -7,8 +7,7 @@ public class ItemSelector : MonoBehaviour
[SerializeField]
private Camera cam;
private InteractableItem selected;
[SerializeField]
private bool debug = false;
[SerializeField]
private LayerMask mask;
public static ItemSelector instance;

View File

@ -11,8 +11,8 @@ public class BasicLevelProgressionSystem : MonoBehaviour
private WaypointMarker marker;
[SerializeField]
private PlayerComponent player;
[SerializeField]
private float minDist = 3;
//[SerializeField]
//private float minDist = 3;
[SerializeField]
private List<ProgressionSection> sections;

View File

@ -6,8 +6,8 @@ using UnityEngine.SceneManagement;
public class LevelZeroSpecial : MonoBehaviour
{
[SerializeField]
private int initalPlaceIndex = 0;
//[SerializeField]
//private int initalPlaceIndex = 0;
[SerializeField]
private DoorInteractable recepticleOne;
@ -70,8 +70,10 @@ public class LevelZeroSpecial : MonoBehaviour
marker2Ref.target = recepticals[1].transform;
marker3Ref.target = recepticals[2].transform;
markers.Add(marker2Ref);
markers.Add(marker3Ref);
}
if (isEnabled)
{
@ -86,9 +88,9 @@ public class LevelZeroSpecial : MonoBehaviour
WaypointMarker marker = markers[i];
if (marker.gameObject.activeInHierarchy)
{
if (marker.target = recepitcal.transform)
if (marker.target == recepitcal.transform)
{
marker.gameObject.SetActive(true);
marker.gameObject.SetActive(false);
markers.Remove(marker);
}
}

View File

@ -8,8 +8,8 @@ using UnityEngine;
public class CameraController : MonoBehaviour
{
private float mouseX = 0;
private float mouseY;
//private float mouseX = 0;
//private float mouseY;
[SerializeField]
private Camera cam;
@ -24,10 +24,10 @@ public class CameraController : MonoBehaviour
public Vector3 Forward { get { return this.forward; } }
public Vector3 Right { get { return this.right; } }
private float originalDist = 0;
private float newDist = 0;
[SerializeField]
private bool isChild = false;
//private float originalDist = 0;
//private float newDist = 0;
//[SerializeField]
// private bool isChild = false;

View File

@ -15,7 +15,9 @@ public class CameraShift : MonoBehaviour
private float cameraSpeed = 5f;
[SerializeField]
private CinemachineFreeLook freelook;
[SerializeField]
private float initRadius = 3f;
[SerializeField]
private float aimingRadius = 2f;
//[SerializeField]
//private PlayerMovementController movementController;

View File

@ -17,13 +17,13 @@ public class PlayerAnimationController : MonoBehaviour
private float sideStepSpeed;
private bool isRunning;
private bool movementInterrupt = false;
//private bool movementInterrupt = false;
[SerializeField]
private PlayerInteractionHandler interactionHandler;
[SerializeField]
private PlayerMovementController movement;
private float verticalAiming = 0;
//private float verticalAiming = 0;
[SerializeField]
private Camera hiddenCam;

View File

@ -10,7 +10,7 @@ public class PlayerMovementController : MonoBehaviour
private float x = 0;
private float y = 0;
private float mouseX = 0;
//private float mouseX = 0;
private bool isRunning = false;
private bool isSneaking = false;
@ -71,7 +71,7 @@ public class PlayerMovementController : MonoBehaviour
public void SetSensitivity(float sensitivity)
{
this.freelook.m_XAxis.m_MaxSpeed = initXSensitivity * sensitivity;
this.freelook.m_YAxis.m_MaxValue= initYSensitivity * sensitivity;
this.freelook.m_YAxis.m_MaxSpeed= initYSensitivity * sensitivity;
}
private void MovePlayer()
{
@ -110,7 +110,7 @@ public class PlayerMovementController : MonoBehaviour
void Update()
{
if(isDead) return;
AllowRotation = Input.GetMouseButton(1) || Input.GetAxis("Aim")>0.5f;
AllowRotation = Input.GetMouseButton(1) || Input.GetAxis("Aim")>0.5f||IsRunning;
GetMovementOld();
MovePlayer();