From 5d7588748373d6223bfdda0bc9ba867ed449623e Mon Sep 17 00:00:00 2001 From: ygr4789 Date: Sat, 21 Dec 2024 14:30:15 +0900 Subject: [PATCH 1/5] refactor: refactor controller codes - code conventions (variables) - encapsulation - break long functions (in update) into smaller ones --- Assets/02.Scripts/Managers/PlayManager.cs | 1 - Assets/02.Scripts/Objects/AnimalController.cs | 64 +++--- Assets/02.Scripts/Objects/DoorController.cs | 4 +- Assets/02.Scripts/Objects/RockController.cs | 33 +-- Assets/02.Scripts/Objects/SignController.cs | 4 +- Assets/02.Scripts/Objects/TreeController.cs | 124 +++++------ Assets/02.Scripts/Player/PlayerMovement.cs | 200 +++++++++--------- Assets/02.Scripts/RipplesHandler.cs | 1 - Assets/02.Scripts/Tests/TestInputHandler.cs | 14 +- 9 files changed, 216 insertions(+), 229 deletions(-) diff --git a/Assets/02.Scripts/Managers/PlayManager.cs b/Assets/02.Scripts/Managers/PlayManager.cs index d6c2dc10..b93badcc 100644 --- a/Assets/02.Scripts/Managers/PlayManager.cs +++ b/Assets/02.Scripts/Managers/PlayManager.cs @@ -12,7 +12,6 @@ public class PlayManager : MonoBehaviour public Dictionary> activeRipplesColors = new Dictionary>(); public Transform currentTarget; - private float defaultSize = 6; private float targetScaleMultiplier = 5.0f; private void Start() diff --git a/Assets/02.Scripts/Objects/AnimalController.cs b/Assets/02.Scripts/Objects/AnimalController.cs index a0a3b37d..cca16283 100644 --- a/Assets/02.Scripts/Objects/AnimalController.cs +++ b/Assets/02.Scripts/Objects/AnimalController.cs @@ -11,6 +11,8 @@ public enum AnimalState public class AnimalController : Interactable { + private static readonly int IsMoving = Animator.StringToHash("isMoving"); + // SerializeFields [SerializeField] private AnimalState currentState = AnimalState.FollowPath; [Range(0f, 5f)] @@ -24,23 +26,23 @@ public class AnimalController : Interactable [Range(0f, 5f)] [SerializeField] private float pathWaitTime = 0.3f; - private SurfaceContactController animalBody; - private Animator animalAnimator; - private Vector3 currentForward; - private int currentPathIndex = 0; - private bool isRushing = false; + private SurfaceContactController _animalBody; + private Animator _animalAnimator; + private Vector3 _currentForward; + private int _currentPathIndex = 0; + private bool _isRushing = false; private void Awake() { gameObject.AddComponent(); gameObject.AddComponent(); Assert.IsNotNull(animalModel); - animalAnimator = animalModel.GetComponent(); - Assert.IsNotNull(animalAnimator); - animalBody = GetComponent(); - Assert.IsNotNull(animalBody); + _animalAnimator = animalModel.GetComponent(); + Assert.IsNotNull(_animalAnimator); + _animalBody = GetComponent(); + Assert.IsNotNull(_animalBody); - ResonatableObject resonatable = gameObject.AddComponent(); + var resonatable = gameObject.AddComponent(); resonatable.properties = new[] { PitchType.Do }; resonatable.resonate += AnimalResonate; } @@ -49,13 +51,13 @@ private void AnimalResonate(PitchType pitch) { switch (pitch) { - case PitchType.Do: { isRushing = true; break; } + case PitchType.Do: { _isRushing = true; break; } } } void Start() { - currentForward = animalModel.forward; + _currentForward = animalModel.forward; // Start the initial behavior based on the current state if (currentState == AnimalState.Idle) @@ -70,16 +72,16 @@ void Start() void Update() { - animalModel.forward = currentForward; - animalAnimator.SetBool("isMoving", animalBody.Velocity.magnitude > 0.1f); + animalModel.forward = _currentForward; + _animalAnimator.SetBool(IsMoving, _animalBody.Velocity.magnitude > 0.1f); - if (isRushing) + if (_isRushing) { - isRushing = false; + _isRushing = false; if (currentState != AnimalState.Rush) TriggerRush(); // Move forward while rushing - animalBody.Velocity = currentForward * rushSpeed; + _animalBody.Velocity = _currentForward * rushSpeed; } else if (currentState == AnimalState.Rush) StopRush(); // Stop rushing when the key is released } @@ -101,13 +103,13 @@ public void TriggerRush() } // Set animator parameter - animalAnimator.SetLayerWeight(animalAnimator.GetLayerIndex("Rush"), 1f); + _animalAnimator.SetLayerWeight(_animalAnimator.GetLayerIndex("Rush"), 1f); } } void StopRush() { - isRushing = false; + _isRushing = false; // Stop particle effect if playing if (rushParticleEffect) @@ -116,8 +118,8 @@ void StopRush() } // Reset animator parameter - animalAnimator.SetLayerWeight(animalAnimator.GetLayerIndex("Rush"), 0f); - animalBody.Velocity = Vector3.zero; + _animalAnimator.SetLayerWeight(_animalAnimator.GetLayerIndex("Rush"), 0f); + _animalBody.Velocity = Vector3.zero; // Return to the previous behavior if (pathPoints != null && pathPoints.Length > 0) @@ -138,9 +140,9 @@ IEnumerator IdleBehavior() while (currentState == AnimalState.Idle) { yield return new WaitForSeconds(3f); - animalAnimator.Play("stand_to_sit"); + _animalAnimator.Play("stand_to_sit"); yield return new WaitForSeconds(3f); - animalAnimator.Play("sit_to_stand"); + _animalAnimator.Play("sit_to_stand"); } } @@ -152,15 +154,15 @@ IEnumerator FollowPathBehavior() yield break; // Get the next waypoint - Vector3 targetPosition = pathPoints[currentPathIndex].position; + Vector3 targetPosition = pathPoints[_currentPathIndex].position; // Rotate towards the target Vector3 targetDirection = Vector3.ProjectOnPlane(targetPosition - transform.position, Vector3.up).normalized; - Vector3 currentDirection = Vector3.ProjectOnPlane(currentForward, Vector3.up).normalized; + Vector3 currentDirection = Vector3.ProjectOnPlane(_currentForward, Vector3.up).normalized; while (Vector3.Angle(targetDirection, currentDirection) > 0.5f) { - currentDirection = Vector3.ProjectOnPlane(currentForward, Vector3.up).normalized; - currentForward = Vector3.RotateTowards(currentDirection, targetDirection, idleSpeed * 3 * Time.deltaTime, 0f); + currentDirection = Vector3.ProjectOnPlane(_currentForward, Vector3.up).normalized; + _currentForward = Vector3.RotateTowards(currentDirection, targetDirection, idleSpeed * 3 * Time.deltaTime, 0f); yield return null; if (currentState != AnimalState.FollowPath) yield break; @@ -175,18 +177,18 @@ IEnumerator FollowPathBehavior() flattenDistance = flattenDisplacement.magnitude; targetDirection = Vector3.ProjectOnPlane(targetPosition - transform.position, Vector3.up).normalized; - currentForward = targetDirection; - animalBody.Velocity = currentForward * idleSpeed; + _currentForward = targetDirection; + _animalBody.Velocity = _currentForward * idleSpeed; yield return null; if (currentState != AnimalState.FollowPath) yield break; } // Stop walking animation - animalBody.Velocity = Vector3.zero; + _animalBody.Velocity = Vector3.zero; // Move to the next waypoint - currentPathIndex = (currentPathIndex + 1) % pathPoints.Length; + _currentPathIndex = (_currentPathIndex + 1) % pathPoints.Length; // Wait before moving to the next waypoint yield return new WaitForSeconds(pathWaitTime); diff --git a/Assets/02.Scripts/Objects/DoorController.cs b/Assets/02.Scripts/Objects/DoorController.cs index cef7292f..8f5782e7 100644 --- a/Assets/02.Scripts/Objects/DoorController.cs +++ b/Assets/02.Scripts/Objects/DoorController.cs @@ -66,7 +66,7 @@ private void DisableInput() { PlayerInput playerInput = playerMovement.GetPlayerInput(); if (playerInput != null) - playerInput.active = false; // 플레이어 움직임 활성화 + playerInput.Active = false; // 플레이어 움직임 활성화 } } @@ -77,7 +77,7 @@ private void EnableInput() { PlayerInput playerInput = playerMovement.GetPlayerInput(); if (playerInput != null) - playerInput.active = false; // 플레이어 움직임 활성화 + playerInput.Active = false; // 플레이어 움직임 활성화 } } diff --git a/Assets/02.Scripts/Objects/RockController.cs b/Assets/02.Scripts/Objects/RockController.cs index a335b316..69a21323 100644 --- a/Assets/02.Scripts/Objects/RockController.cs +++ b/Assets/02.Scripts/Objects/RockController.cs @@ -72,18 +72,7 @@ void Update() { ApplyVelocity(); if (isRolling) RollRock(_rockBody.Velocity); - - // Check speed and play/stop sound - if (_rockBody.Velocity.magnitude > SpeedThreshold && !isPlayingSound) - { - PlayMovingSound(); - isPlayingSound = true; - } - else if (_rockBody.Velocity.magnitude <= SpeedThreshold && isPlayingSound) - { - StopMovingSound(); - isPlayingSound = false; - } + HandleSound(); } private void ApplyVelocity() @@ -113,22 +102,34 @@ private void MoveAwayFromPlayer() _currentVelocity = directionAwayFromPlayer * moveSpeed; } + private void HandleSound() + { + // Check speed and play/stop sound + if (_rockBody.Velocity.magnitude > SpeedThreshold && !isPlayingSound) + { + PlayMovingSound(); + isPlayingSound = true; + } + else if (_rockBody.Velocity.magnitude <= SpeedThreshold && isPlayingSound) + { + StopMovingSound(); + isPlayingSound = false; + } + } + private void PlayMovingSound() { // Implement sound playing logic here _movingSound = GameManager.sm.PlayLoopSound("stone-moving"); - AudioSource source = _movingSound.GetComponent(); - if (source != null) + if (_movingSound.TryGetComponent(out var source)) { source.volume *= 0.3f; // Reduce volume by half } - Debug.Log("Playing rolling sound"); } private void StopMovingSound() { // Implement sound stopping logic here Destroy(_movingSound); - Debug.Log("Stopping rolling sound"); } } \ No newline at end of file diff --git a/Assets/02.Scripts/Objects/SignController.cs b/Assets/02.Scripts/Objects/SignController.cs index a4a2edd0..f6712028 100644 --- a/Assets/02.Scripts/Objects/SignController.cs +++ b/Assets/02.Scripts/Objects/SignController.cs @@ -65,7 +65,7 @@ public void Inspect(GameObject floatingText) currentIndex = 0; if (playerInput != null) - playerInput.active = true; // 플레이어 움직임 활성화 + playerInput.Active = true; // 플레이어 움직임 활성화 } else { @@ -98,7 +98,7 @@ public void Inspect(GameObject floatingText) isActive = true; if (playerInput != null) - playerInput.active = false; // 플레이어 움직임 비활성화 + playerInput.Active = false; // 플레이어 움직임 비활성화 } } diff --git a/Assets/02.Scripts/Objects/TreeController.cs b/Assets/02.Scripts/Objects/TreeController.cs index 248b4327..b3b3c170 100644 --- a/Assets/02.Scripts/Objects/TreeController.cs +++ b/Assets/02.Scripts/Objects/TreeController.cs @@ -16,19 +16,17 @@ public class TreeController : Interactable [SerializeField, Range(3f, 15f)] private float maxHeight = 13f; [SerializeField, Range(3f, 15f)] private float currentHeight = 8f; [SerializeField, Range(0f, 1f)] private float radius = 0.7f; + + private const float HeightChangeSmoothTime = 0.6f; + private const float HeightChangeSpeed = 1f; + private Vector3 _currentVelocity = Vector3.zero; - private readonly float heightChangeSmoothTime = 0.6f; - private float heightChangeSpeed = 1f; - private Vector3 currentVelocity = Vector3.zero; - - private HingeJoint hinge; - private CapsuleCollider capsuleCollider; - private bool isCollapsed = false; + private HingeJoint _hinge; + private CapsuleCollider _capsuleCollider; - private bool isPlayingSound = false; private GameObject _movingSound; - private void Start() + private void OnValidate() { Assert.IsNotNull(treePrefab, "TreePrefab cannot be null."); Assert.IsTrue(treePrefab.TryGetComponent(out _), "TreePrefab must have MeshFilter component."); @@ -37,15 +35,16 @@ private void Start() currentHeight = Mathf.Clamp(currentHeight, minHeight, maxHeight); treePrefab.transform.localPosition = new Vector3(0f, currentHeight - prefabHeight, 0f); treePrefab.transform.localScale = Vector3.one; - capsuleCollider = gameObject.GetComponent(); - capsuleCollider.height = 2 * currentHeight; - capsuleCollider.radius = radius; + _capsuleCollider = gameObject.GetComponent(); + _capsuleCollider.height = 2 * currentHeight; + _capsuleCollider.radius = radius; } private void Awake() { - hinge = gameObject.GetComponent(); - ResonatableObject resonatable = gameObject.AddComponent(); + _hinge = gameObject.GetComponent(); + _capsuleCollider = gameObject.GetComponent(); + var resonatable = gameObject.AddComponent(); resonatable.properties = new[] { PitchType.So, PitchType.La }; resonatable.resonate += TreeResonate; resonatable.ripplesPositionOffset = Vector3.up * 0.5f; @@ -62,95 +61,75 @@ private void TreeResonate(PitchType pitch) private void Update() { - if (isCollapsed) return; + SetPrefabPosition(); + HandleSound(); + } + + private void SetPrefabPosition() + { Vector3 currentPosition = treePrefab.transform.localPosition; Vector3 targetPosition = new Vector3(0f, currentHeight - prefabHeight, 0f); - capsuleCollider.height = 2 * currentHeight; - - if (currentPosition != targetPosition) - { - treePrefab.transform.localPosition = Vector3.SmoothDamp(currentPosition, targetPosition, ref currentVelocity, heightChangeSmoothTime); - if (Vector3.Distance(currentPosition, targetPosition) < 0.02f) - { - if (isPlayingSound) - { - StopTreeSound(); - isPlayingSound = false; - } - } - } - else - { - if (isPlayingSound) - { - StopTreeSound(); - isPlayingSound = false; - } - } + _capsuleCollider.height = 2 * currentHeight; + treePrefab.transform.localPosition = Vector3.SmoothDamp(currentPosition, targetPosition, ref _currentVelocity, HeightChangeSmoothTime); } private void SmoothIncreaseHeight() { - currentHeight += heightChangeSpeed * Time.deltaTime; + currentHeight += HeightChangeSpeed * Time.deltaTime; currentHeight = Mathf.Clamp(currentHeight, minHeight, maxHeight); - - // Play tree sound - if (!isPlayingSound) - { - PlayTreeSound("increase"); - isPlayingSound = true; - } } private void SmoothDecreaseHeight() { - currentHeight -= heightChangeSpeed * Time.deltaTime; + currentHeight -= HeightChangeSpeed * Time.deltaTime; currentHeight = Mathf.Clamp(currentHeight, minHeight, maxHeight); - - // Play tree sound - if (!isPlayingSound) + } + + private void HandleSound() + { + switch (_currentVelocity.y) { - PlayTreeSound("decrease"); - isPlayingSound = true; + case < -0.1f: + PlayTreeSound("decrease"); + break; + case > 0.1f: + PlayTreeSound("increase"); + break; + default: + StopTreeSound(); + break; } } private void PlayTreeSound(string action) { + if (_movingSound) return; _movingSound = GameManager.sm.PlayLoopSound("tree-" + action); - AudioSource source = _movingSound.GetComponent(); - if (source != null) + if (_movingSound.TryGetComponent(out var source)) { source.volume *= 1f; // Reduce volume by half } - Debug.Log("Playing tree sound"); } private void StopTreeSound() { - // Implement sound stopping logic here - Destroy(_movingSound); - Debug.Log("Stopping tree sound"); + if (_movingSound) Destroy(_movingSound); } public void Damage(Transform damager) { - if (isCollapsed) return; - if (--durability <= 0) - { - var direction = transform.position - damager.position; - direction.y = 0f; - direction.Normalize(); - Collapse(direction); - } + if (--durability > 0) return; + var direction = transform.position - damager.position; + direction.y = 0f; + direction.Normalize(); + Collapse(direction); } - - public void Collapse(Vector3 direction) + + private void Collapse(Vector3 direction) { const float initialAngularVelocity = 1f; var cutOffset = radius + 0.1f; - if (isCollapsed) return; var cutPoint = transform.position + Vector3.up * cutOffset; var cutTree = Cutter.Cut(treePrefab, cutPoint, Vector3.up); var cutCollider = cutTree.AddComponent(); @@ -170,15 +149,14 @@ public void Collapse(Vector3 direction) cutRigidbody.collisionDetectionMode = CollisionDetectionMode.Continuous; cutRigidbody.centerOfMass = Vector3.up * prefabHeight; - hinge.connectedBody = cutRigidbody; - hinge.anchor = Vector3.up * cutOffset; - hinge.axis = axis; + _hinge.connectedBody = cutRigidbody; + _hinge.anchor = Vector3.up * cutOffset; + _hinge.axis = axis; cutRigidbody.AddTorque(torque, ForceMode.VelocityChange); cutRigidbody.mass = 100; - isCollapsed = true; - capsuleCollider.enabled = false; + _capsuleCollider.enabled = false; GameManager.em.StopRipples(transform); GameManager.pm.UnregisterTarget(transform); PlayCollapseSound(); diff --git a/Assets/02.Scripts/Player/PlayerMovement.cs b/Assets/02.Scripts/Player/PlayerMovement.cs index 69bbfb48..7836b9c5 100644 --- a/Assets/02.Scripts/Player/PlayerMovement.cs +++ b/Assets/02.Scripts/Player/PlayerMovement.cs @@ -2,60 +2,68 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; +using UnityEngine.Serialization; public class PlayerInput { - public float moveX; - public float moveZ; - public bool jump; - public bool run; - public bool active = true; + public float MoveX; + public float MoveZ; + public bool Jump; + public bool Run; + public bool Active = true; public void Clear() { - moveX = 0f; - moveZ = 0f; - jump = false; - run = false; + MoveX = 0f; + MoveZ = 0f; + Jump = false; + Run = false; } } public class PlayerMovement : MonoBehaviour { + private static readonly int Moving = Animator.StringToHash("Moving"); + private static readonly int Grounded = Animator.StringToHash("Grounded"); + private static readonly int Jump = Animator.StringToHash("Jump"); + + [FormerlySerializedAs("_movementSpeed")] [Range(1f, 20f)] - [SerializeField] private float _movementSpeed; + [SerializeField] private float movementSpeed; + [FormerlySerializedAs("_runMultiplier")] [Tooltip("additional speed multiplier when running")] [Range(1f, 20f)] - [SerializeField] private float _runMultiplier; + [SerializeField] private float runMultiplier; + [FormerlySerializedAs("_smoothTime")] [Tooltip("time taken to rotate when the direction of movement is changed")] [Range(0f, 0.1f)] - [SerializeField] private float _smoothTime = 0.1f; + [SerializeField] private float smoothTime = 0.1f; - private Camera controllerCamera; - private SurfaceContactController playerController; - private Rigidbody playerRigidBody; - private Collider playerCollider; - private Transform playerTransform; - private Animator playerAnimator; - private Renderer playerMeshRenderer; + private Camera _controllerCamera; + private SurfaceContactController _playerController; + private Rigidbody _playerRigidBody; + private Collider _playerCollider; + private Transform _playerTransform; + private Animator _playerAnimator; + private Renderer _playerMeshRenderer; private Vector3 _controllerVelocity; private Vector3 _lastStablePosition; - private PlayerInput input; - - private bool immune = false; - private float respawnDelayTime = 0.5f; - private float respawnPositionRestoreTime = 1f; - private int respawnBlinkCount = 5; - private float respawnBlinkTime = 0.1f; + private PlayerInput _input; - private int runLayer = 1; - private float runLayerWeight = 0f; - private float runTransitionSpeed = 3f; + private const float RespawnDelayTime = 0.5f; + private const float RespawnPositionRestoreTime = 1f; + private const int RespawnBlinkCount = 5; + private const float RespawnBlinkTime = 0.1f; + private bool _immune = false; + + private const int RunLayer = 1; + private const float RunTransitionSpeed = 3f; + private float _runLayerWeight = 0f; - private Vector3 directionX, directionZ; + private Vector3 _directionX, _directionZ; // Start is called before the first frame update private void Awake() @@ -66,14 +74,14 @@ private void Awake() }; objectDetector.AddComponent(); - input = new PlayerInput(); - controllerCamera = Camera.main; - playerRigidBody = GetComponent(); - playerController = GetComponent(); - playerCollider = GetComponent(); - playerTransform = transform.Find("Player"); - playerAnimator = playerTransform.GetComponent(); - playerMeshRenderer = playerTransform.GetComponentInChildren(); + _input = new PlayerInput(); + _controllerCamera = Camera.main; + _playerRigidBody = GetComponent(); + _playerController = GetComponent(); + _playerCollider = GetComponent(); + _playerTransform = transform.Find("Player"); + _playerAnimator = _playerTransform.GetComponent(); + _playerMeshRenderer = _playerTransform.GetComponentInChildren(); _lastStablePosition = transform.position; } @@ -86,95 +94,95 @@ private void Update() public PlayerInput GetPlayerInput() { - return input; + return _input; } private void GetInputs() { - input.Clear(); - if(!input.active) return; + _input.Clear(); + if(!_input.Active) return; // get the movement input - input.moveX = Input.GetAxis("Horizontal"); - input.moveZ = Input.GetAxis("Vertical"); - input.jump = Input.GetButton("Jump"); - input.run = Input.GetKey(KeyCode.LeftShift); + _input.MoveX = Input.GetAxis("Horizontal"); + _input.MoveZ = Input.GetAxis("Vertical"); + _input.Jump = Input.GetButton("Jump"); + _input.Run = Input.GetKey(KeyCode.LeftShift); } private void ControlPlayer() { - if (immune) return; + if (_immune) return; CheckStable(); + CalculateDirection(); // moves the controller in the desired direction on the x- and z-axis - CalculateDirection(); - Vector3 movement = directionX * input.moveX + directionZ * input.moveZ; - movement *= _movementSpeed; + var moveDirection = _directionX * _input.MoveX + _directionZ * _input.MoveZ; + var movement = moveDirection * movementSpeed; HandleRunning(ref movement); HandleMovement(movement); - HandleGoundJump(); + HandleGroundJump(); } private void HandleRunning(ref Vector3 movement) { // the controller is able to run - if (input.run && playerController.Grounded) + if (_input.Run && _playerController.Grounded) { - movement *= _runMultiplier; + movement *= runMultiplier; - if(playerAnimator.GetBool("Grounded")) + if(_playerAnimator.GetBool(Grounded)) { - runLayerWeight = Mathf.MoveTowards(runLayerWeight, 1f, Time.deltaTime * runTransitionSpeed); + _runLayerWeight = Mathf.MoveTowards(_runLayerWeight, 1f, Time.deltaTime * RunTransitionSpeed); } } else { - runLayerWeight = Mathf.MoveTowards(runLayerWeight, 0f, Time.deltaTime * runTransitionSpeed); + _runLayerWeight = Mathf.MoveTowards(_runLayerWeight, 0f, Time.deltaTime * RunTransitionSpeed); } - playerAnimator.SetLayerWeight(runLayer, runLayerWeight); + _playerAnimator.SetLayerWeight(RunLayer, _runLayerWeight); } private void HandleMovement(Vector3 movement) { - playerController.Velocity = movement; + _playerController.Velocity = movement; var currentVelocity = movement.magnitude; - playerAnimator.SetBool("Moving", currentVelocity > 0); + _playerAnimator.SetBool(Moving, currentVelocity > 0); if (!(currentVelocity > 0)) return; // set player's forward same as moving direction var targetAngle = Mathf.Atan2(-movement.z, movement.x) * Mathf.Rad2Deg + 90; - var angle = Mathf.SmoothDampAngle(playerTransform.eulerAngles.y, targetAngle, ref currentVelocity, _smoothTime); - playerTransform.rotation = Quaternion.Euler(0, angle, 0); + var angle = Mathf.SmoothDampAngle(_playerTransform.eulerAngles.y, targetAngle, ref currentVelocity, smoothTime); + _playerTransform.rotation = Quaternion.Euler(0, angle, 0); } - private void HandleGoundJump() + private void HandleGroundJump() { // the controller is able to jump when on the ground - playerAnimator.SetBool("Grounded", playerController.Grounded); - if (input.jump && playerController.Grounded) + _playerAnimator.SetBool(Grounded, _playerController.Grounded); + if (_input.Jump && _playerController.Grounded) { - playerAnimator.SetBool("Jump", true); - playerAnimator.SetBool("Grounded", false); - playerController.Jump = true; + _playerAnimator.SetBool(Jump, true); + _playerAnimator.SetBool(Grounded, false); + _playerController.Jump = true; } else { - playerAnimator.SetBool("Jump", false); + _playerAnimator.SetBool(Jump, false); } } private void CalculateDirection() { - directionX = controllerCamera.transform.right; - directionZ = Vector3.Cross(directionX, Vector3.up); + _directionX = _controllerCamera.transform.right; + _directionZ = Vector3.Cross(_directionX, Vector3.up); } // Convert the direction of movement to avoid entering a impassible area private void CheckStable() { Debug.DrawRay(_lastStablePosition, Vector3.up, Color.blue); - if (!playerController.Grounded) return; + if (!_playerController.Grounded) return; // Restricted distance for impassable areas const float checkDistance = 2f; @@ -184,7 +192,7 @@ private void CheckStable() for (var i = 0; i < numStep; i++) { var checkAngle = 360f * i / numStep; - Vector3 checkDirection = Quaternion.AngleAxis(checkAngle, Vector3.up) * Vector3.forward; + var checkDirection = Quaternion.AngleAxis(checkAngle, Vector3.up) * Vector3.forward; if (!CheckPassable(transform.position + checkDirection * checkDistance)) return; } @@ -195,39 +203,39 @@ private void CheckStable() private bool CheckPassable(Vector3 position) { // Subject to modification based on development - Ray ray = new Ray(position + Vector3.up * 1.5f, Vector3.down); + var ray = new Ray(position + Vector3.up * 1.5f, Vector3.down); Debug.DrawRay(position + Vector3.up * 1.5f, Vector3.down * 1.5f, Color.red); - if (!Physics.Raycast(ray, out RaycastHit hit)) return false; + if (!Physics.Raycast(ray, out var hit)) return false; return !hit.transform.CompareTag("Water"); } public void Drown() { // 플레이어가 물에 빠지는 이펙트 발생 필요 - if (immune) return; - immune = true; + if (_immune) return; + _immune = true; StartCoroutine(RespawnPlayer()); } private IEnumerator RespawnPlayer() { - immune = true; - input.active = false; - playerMeshRenderer.enabled = false; - playerRigidBody.isKinematic = true; - playerRigidBody.velocity = Vector3.zero; - playerCollider.enabled = false; - yield return new WaitForSeconds(respawnDelayTime); - playerAnimator.SetBool("Grounded", true); - playerAnimator.SetBool("Moving", false); - yield return MoveSmooth(transform.position, _lastStablePosition, respawnPositionRestoreTime); - yield return BlinkPlayer(respawnBlinkCount, respawnBlinkTime); + _immune = true; + _input.Active = false; + _playerMeshRenderer.enabled = false; + _playerRigidBody.isKinematic = true; + _playerCollider.enabled = false; + _playerRigidBody.velocity = Vector3.zero; + yield return new WaitForSeconds(RespawnDelayTime); + _playerAnimator.SetBool(Grounded, true); + _playerAnimator.SetBool(Moving, false); + yield return MoveSmooth(transform.position, _lastStablePosition, RespawnPositionRestoreTime); + yield return BlinkPlayer(RespawnBlinkCount, RespawnBlinkTime); Input.ResetInputAxes(); - input.active = true; - playerMeshRenderer.enabled = true; - playerRigidBody.isKinematic = false; - playerCollider.enabled = true; - immune = false; + _immune = false; + _input.Active = true; + _playerMeshRenderer.enabled = true; + _playerRigidBody.isKinematic = false; + _playerCollider.enabled = true; } // Smoothly move from startPos to endPos over finishTime @@ -246,7 +254,7 @@ private IEnumerator MoveSmooth(Vector3 startPos, Vector3 endPos, float finishTim // Walk from startPos to endPos over finishTime public IEnumerator WalkToPoint(Vector3 targetPosition, float duration) { - input.active = false; + _input.Active = false; var currentPosition = transform.position; var movement = (targetPosition - currentPosition) / duration; movement.y = 0f; @@ -254,11 +262,11 @@ public IEnumerator WalkToPoint(Vector3 targetPosition, float duration) while (elapsedTime < duration) { HandleMovement(movement); - if (Vector3.Distance(playerTransform.position, targetPosition) < 0.5f) break; + if (Vector3.Distance(_playerTransform.position, targetPosition) < 0.5f) break; elapsedTime += Time.deltaTime; yield return null; } - input.active = true; + _input.Active = true; } // Repeat blinking for the specified time count times @@ -266,9 +274,9 @@ private IEnumerator BlinkPlayer(int count, float time) { for (var i=0; i Date: Sat, 21 Dec 2024 14:57:35 +0900 Subject: [PATCH 2/5] refactor: code convention --- .../02.Scripts/Objects/ResonatableObject.cs | 2 +- Assets/02.Scripts/Objects/RockController.cs | 14 +++---- Assets/02.Scripts/Player/IKFootPlacement.cs | 37 ++++++++++--------- 3 files changed, 28 insertions(+), 25 deletions(-) diff --git a/Assets/02.Scripts/Objects/ResonatableObject.cs b/Assets/02.Scripts/Objects/ResonatableObject.cs index 7890f1a7..9343b745 100644 --- a/Assets/02.Scripts/Objects/ResonatableObject.cs +++ b/Assets/02.Scripts/Objects/ResonatableObject.cs @@ -10,7 +10,7 @@ public class ResonatableObject : MonoBehaviour private int colliderNum = 0; public Vector3 ripplesPositionOffset = Vector3.zero; - [HideInInspector] public delegate void Resonate(PitchType pitch); + public delegate void Resonate(PitchType pitch); [HideInInspector] public Resonate resonate; public void OnEnterRadius() diff --git a/Assets/02.Scripts/Objects/RockController.cs b/Assets/02.Scripts/Objects/RockController.cs index 69a21323..e3a27994 100644 --- a/Assets/02.Scripts/Objects/RockController.cs +++ b/Assets/02.Scripts/Objects/RockController.cs @@ -23,12 +23,12 @@ public class RockController : Interactable private const string PlayerTag = "Player"; // Tag of the player to follow private GameObject _player; // Reference to the player object + private const float SpeedThreshold = 1.0f; // Speed threshold for playing sound private float _radius; // Radius of round rock (only used when isRolling=true) + private bool _isPlayingSound = false; private Vector3 _currentVelocity = Vector3.zero; - private SurfaceContactController _rockBody; private Vector3 _targetPosition; - private const float SpeedThreshold = 1.0f; // Speed threshold for playing sound - private bool isPlayingSound = false; + private SurfaceContactController _rockBody; private GameObject _movingSound; private void Awake() @@ -105,15 +105,15 @@ private void MoveAwayFromPlayer() private void HandleSound() { // Check speed and play/stop sound - if (_rockBody.Velocity.magnitude > SpeedThreshold && !isPlayingSound) + if (_rockBody.Velocity.magnitude > SpeedThreshold && !_isPlayingSound) { PlayMovingSound(); - isPlayingSound = true; + _isPlayingSound = true; } - else if (_rockBody.Velocity.magnitude <= SpeedThreshold && isPlayingSound) + else if (_rockBody.Velocity.magnitude <= SpeedThreshold && _isPlayingSound) { StopMovingSound(); - isPlayingSound = false; + _isPlayingSound = false; } } diff --git a/Assets/02.Scripts/Player/IKFootPlacement.cs b/Assets/02.Scripts/Player/IKFootPlacement.cs index 52edc271..e0f620df 100644 --- a/Assets/02.Scripts/Player/IKFootPlacement.cs +++ b/Assets/02.Scripts/Player/IKFootPlacement.cs @@ -2,19 +2,22 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; +using UnityEngine.Serialization; public class IKFootPlacement : MonoBehaviour { + private static readonly int Moving = Animator.StringToHash("Moving"); + private static readonly int Grounded = Animator.StringToHash("Grounded"); + // Distance from Foot (ankle) to floor - [Range(0f, 1f)] - [SerializeField] private float _distanceToGround = 0.1f; + [SerializeField, Range(0f, 1f)] private float distanceToGround = 0.1f; // Layers to cast IK to (including Walkables, but excluding the Player itself) - [SerializeField] private LayerMask _raycastLayerMask; + [SerializeField] private LayerMask raycastLayerMask; - [SerializeField] private AnimationCurve _leftFootWalkIKCurve; - [SerializeField] private AnimationCurve _rightFootWalkIKCurve; - [SerializeField] private AnimationCurve _leftFootRunIKCurve; - [SerializeField] private AnimationCurve _rightFootRunIKCurve; + [SerializeField] private AnimationCurve leftFootWalkIKCurve; + [SerializeField] private AnimationCurve rightFootWalkIKCurve; + [SerializeField] private AnimationCurve leftFootRunIKCurve; + [SerializeField] private AnimationCurve rightFootRunIKCurve; private Animator playerAnimator; private int runLayer = 1; @@ -29,13 +32,13 @@ private void OnAnimatorIK(int layerIndex) if (!playerAnimator) return; // IK only works when the foot touches the ground - bool moving = playerAnimator.GetBool("Moving"); - bool grounded = playerAnimator.GetBool("Grounded"); + bool moving = playerAnimator.GetBool(Moving); + bool grounded = playerAnimator.GetBool(Grounded); float nTime = playerAnimator.GetCurrentAnimatorStateInfo(layerIndex).normalizedTime; float runWeight = playerAnimator.GetLayerWeight(runLayer); - float leftMovingWeight = Mathf.Lerp(_leftFootWalkIKCurve.Evaluate(nTime), _leftFootRunIKCurve.Evaluate(nTime), runWeight); - float rightMovingWeight = Mathf.Lerp(_rightFootWalkIKCurve.Evaluate(nTime), _rightFootRunIKCurve.Evaluate(nTime), runWeight); + float leftMovingWeight = Mathf.Lerp(leftFootWalkIKCurve.Evaluate(nTime), leftFootRunIKCurve.Evaluate(nTime), runWeight); + float rightMovingWeight = Mathf.Lerp(rightFootWalkIKCurve.Evaluate(nTime), rightFootRunIKCurve.Evaluate(nTime), runWeight); float leftFootIKWeight = grounded ? (moving ? leftMovingWeight : 1f) : 0f; float rightFootIKWeight = grounded ? (moving ? rightMovingWeight : 1f) : 0f; @@ -50,10 +53,10 @@ private void OnAnimatorIK(int layerIndex) transform.localPosition = Vector3.zero; Ray leftRay = new Ray(playerAnimator.GetIKPosition(AvatarIKGoal.LeftFoot) + Vector3.up, Vector3.down); Ray rightRay = new Ray(playerAnimator.GetIKPosition(AvatarIKGoal.RightFoot) + Vector3.up, Vector3.down); - bool leftIntersected = Physics.Raycast(leftRay, out RaycastHit leftHit, _distanceToGround + detectDistance + 1f, - _raycastLayerMask); - bool rightIntersected = Physics.Raycast(rightRay, out RaycastHit rightHit, _distanceToGround + detectDistance + 1f, - _raycastLayerMask); + bool leftIntersected = Physics.Raycast(leftRay, out RaycastHit leftHit, distanceToGround + detectDistance + 1f, + raycastLayerMask); + bool rightIntersected = Physics.Raycast(rightRay, out RaycastHit rightHit, distanceToGround + detectDistance + 1f, + raycastLayerMask); if (leftIntersected && rightIntersected && grounded) { @@ -65,14 +68,14 @@ private void OnAnimatorIK(int layerIndex) // if (leftHit.transform.tag == "Walkable") Vector3 leftFootPosition = leftHit.point; - leftFootPosition.y += _distanceToGround; + leftFootPosition.y += distanceToGround; playerAnimator.SetIKPosition(AvatarIKGoal.LeftFoot, leftFootPosition); playerAnimator.SetIKRotation(AvatarIKGoal.LeftFoot, Quaternion.LookRotation(transform.forward, leftHit.normal)); Debug.DrawRay(leftFootPosition, leftHit.normal, Color.green); // if (rightHit.transform.tag == "Walkable") Vector3 rightFootPosition = rightHit.point; - rightFootPosition.y += _distanceToGround; + rightFootPosition.y += distanceToGround; playerAnimator.SetIKPosition(AvatarIKGoal.RightFoot, rightFootPosition); playerAnimator.SetIKRotation(AvatarIKGoal.RightFoot, Quaternion.LookRotation(transform.forward, rightHit.normal)); Debug.DrawRay(rightFootPosition, rightHit.normal, Color.green); From 8a84983170590c620e9aa0a373f6758e5074049c Mon Sep 17 00:00:00 2001 From: ygr4789 Date: Sat, 21 Dec 2024 15:14:44 +0900 Subject: [PATCH 3/5] chore: fix boundary --- Assets/01.Scenes/ReleaseStages/Stage8.unity | 795 +++++++++++++++++--- 1 file changed, 708 insertions(+), 87 deletions(-) diff --git a/Assets/01.Scenes/ReleaseStages/Stage8.unity b/Assets/01.Scenes/ReleaseStages/Stage8.unity index b1eedc8b..33f3d76a 100644 --- a/Assets/01.Scenes/ReleaseStages/Stage8.unity +++ b/Assets/01.Scenes/ReleaseStages/Stage8.unity @@ -505,6 +505,43 @@ BoxCollider: serializedVersion: 2 m_Size: {x: 10, y: 28.56165, z: 10} m_Center: {x: 0, y: 0, z: 0} +--- !u!1 &223011767 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 223011768} + m_Layer: 0 + m_Name: Scores + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &223011768 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 223011767} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 58.39306, y: 2.6838286, z: 31.89131} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1052650314} + - {fileID: 648523339} + - {fileID: 1730337439} + - {fileID: 437887990} + - {fileID: 1996240648} + - {fileID: 2088952165} + m_Father: {fileID: 0} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &233407885 GameObject: m_ObjectHideFlags: 0 @@ -748,6 +785,51 @@ Transform: m_CorrespondingSourceObject: {fileID: 4803671801775362094, guid: 98cf862fd6ec06341b813f74c54af10d, type: 3} m_PrefabInstance: {fileID: 1896419402} m_PrefabAsset: {fileID: 0} +--- !u!1 &388981441 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 388981442} + - component: {fileID: 388981443} + m_Layer: 0 + m_Name: Wall (3) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &388981442 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 388981441} + m_LocalRotation: {x: -0, y: 0.66532296, z: -0, w: 0.7465557} + m_LocalPosition: {x: 78.1, y: 2.9500003, z: 13.3} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 635329787} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 83.414, z: 0} +--- !u!65 &388981443 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 388981441} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 19.250366, y: 28.56165, z: 49.98923} + m_Center: {x: 13.214684, y: 4.039917, z: -3.899763} --- !u!1 &394140430 GameObject: m_ObjectHideFlags: 0 @@ -824,6 +906,124 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 394140430} m_CullTransparentMesh: 1 +--- !u!1001 &437887989 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 223011768} + m_Modifications: + - target: {fileID: 1392622848452239268, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: target + value: + objectReference: {fileID: 1730337438} + - target: {fileID: 1392622848452239268, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: offset.y + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 3189293820305238040, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_Name + value: FloatingTextOverScore (1) + objectReference: {fileID: 0} + - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_Pivot.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_Pivot.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_RootOrder + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_AnchorMax.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_AnchorMax.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_AnchorMin.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_AnchorMin.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_SizeDelta.x + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_SizeDelta.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_LocalScale.x + value: 0.66666675 + objectReference: {fileID: 0} + - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_LocalScale.z + value: 0.66666675 + objectReference: {fileID: 0} + - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_LocalPosition.z + value: -15 + objectReference: {fileID: 0} + - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_LocalRotation.w + value: -0.7071068 + objectReference: {fileID: 0} + - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_LocalRotation.y + value: 0.7071068 + objectReference: {fileID: 0} + - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_AnchoredPosition.x + value: -120.3 + objectReference: {fileID: 0} + - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_AnchoredPosition.y + value: 34.9 + objectReference: {fileID: 0} + - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 270 + objectReference: {fileID: 0} + - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} +--- !u!224 &437887990 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + m_PrefabInstance: {fileID: 437887989} + m_PrefabAsset: {fileID: 0} --- !u!1001 &444149554 PrefabInstance: m_ObjectHideFlags: 0 @@ -1266,31 +1466,31 @@ PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: - m_TransformParent: {fileID: 812419024} + m_TransformParent: {fileID: 1500943925} m_Modifications: - target: {fileID: 3501694543801626047, guid: dd5dfb71bf9329c45a9443de92982f92, type: 3} propertyPath: m_RootOrder - value: 1 + value: 12 objectReference: {fileID: 0} - target: {fileID: 3501694543801626047, guid: dd5dfb71bf9329c45a9443de92982f92, type: 3} propertyPath: m_LocalScale.x - value: 0.33333334 + value: 0.6666667 objectReference: {fileID: 0} - target: {fileID: 3501694543801626047, guid: dd5dfb71bf9329c45a9443de92982f92, type: 3} propertyPath: m_LocalScale.z - value: 0.33333334 + value: 0.6666667 objectReference: {fileID: 0} - target: {fileID: 3501694543801626047, guid: dd5dfb71bf9329c45a9443de92982f92, type: 3} propertyPath: m_LocalPosition.x - value: 0.49 + value: 0.97999954 objectReference: {fileID: 0} - target: {fileID: 3501694543801626047, guid: dd5dfb71bf9329c45a9443de92982f92, type: 3} propertyPath: m_LocalPosition.y - value: 0 + value: 8 objectReference: {fileID: 0} - target: {fileID: 3501694543801626047, guid: dd5dfb71bf9329c45a9443de92982f92, type: 3} propertyPath: m_LocalPosition.z - value: -1.65 + value: -3.2999992 objectReference: {fileID: 0} - target: {fileID: 3501694543801626047, guid: dd5dfb71bf9329c45a9443de92982f92, type: 3} propertyPath: m_LocalRotation.w @@ -1324,8 +1524,21 @@ PrefabInstance: propertyPath: m_Name value: LilyPad objectReference: {fileID: 0} + - target: {fileID: 9126626871729721879, guid: dd5dfb71bf9329c45a9443de92982f92, type: 3} + propertyPath: m_Materials.Array.size + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 9126626871729721879, guid: dd5dfb71bf9329c45a9443de92982f92, type: 3} + propertyPath: m_Materials.Array.data[1] + value: + objectReference: {fileID: 2100000, guid: 7ef09083d6b20db4c9e8e86e3be5f6c4, type: 2} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: dd5dfb71bf9329c45a9443de92982f92, type: 3} +--- !u!4 &547995135 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 3501694543801626047, guid: dd5dfb71bf9329c45a9443de92982f92, type: 3} + m_PrefabInstance: {fileID: 547995134} + m_PrefabAsset: {fileID: 0} --- !u!1 &577953294 GameObject: m_ObjectHideFlags: 0 @@ -1463,6 +1676,9 @@ Transform: - {fileID: 1897914167} - {fileID: 1741900270} - {fileID: 207105305} + - {fileID: 388981442} + - {fileID: 1722329788} + - {fileID: 1890173737} m_Father: {fileID: 19873441} m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -1476,7 +1692,7 @@ PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: - m_TransformParent: {fileID: 1619211198} + m_TransformParent: {fileID: 223011768} m_Modifications: - target: {fileID: 1392622848452239268, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} propertyPath: target @@ -1500,7 +1716,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} propertyPath: m_RootOrder - value: 3 + value: 1 objectReference: {fileID: 0} - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} propertyPath: m_AnchorMax.x @@ -1528,11 +1744,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} propertyPath: m_LocalScale.x - value: 1 + value: 0.66666675 objectReference: {fileID: 0} - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} propertyPath: m_LocalScale.z - value: 1 + value: 0.66666675 objectReference: {fileID: 0} - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} propertyPath: m_LocalPosition.x @@ -1544,7 +1760,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} propertyPath: m_LocalPosition.z - value: -10.26498 + value: 28.170351 objectReference: {fileID: 0} - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} propertyPath: m_LocalRotation.w @@ -1564,11 +1780,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} propertyPath: m_AnchoredPosition.x - value: -80.9866 + value: -139.37967 objectReference: {fileID: 0} - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} propertyPath: m_AnchoredPosition.y - value: 6.4700003 + value: 1.1861715 objectReference: {fileID: 0} - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} propertyPath: m_LocalEulerAnglesHint.x @@ -1584,6 +1800,11 @@ PrefabInstance: objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} +--- !u!224 &648523339 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + m_PrefabInstance: {fileID: 648523338} + m_PrefabAsset: {fileID: 0} --- !u!1 &653472691 GameObject: m_ObjectHideFlags: 0 @@ -1769,7 +1990,7 @@ Transform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 5 + m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &739456012 stripped MonoBehaviour: @@ -1825,11 +2046,6 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 100, y: 100} m_Pivot: {x: 0.5, y: 0.5} ---- !u!4 &812419024 stripped -Transform: - m_CorrespondingSourceObject: {fileID: 8621887889884086939, guid: aa403b6ac10fb83448f4a9b983165b09, type: 3} - m_PrefabInstance: {fileID: 2017438471} - m_PrefabAsset: {fileID: 0} --- !u!1001 &852461502 PrefabInstance: m_ObjectHideFlags: 0 @@ -1896,7 +2112,7 @@ PrefabInstance: m_Modifications: - target: {fileID: 1379455275906648392, guid: f41f72efa80301b4cab6c591effa3f2f, type: 3} propertyPath: m_RootOrder - value: 10 + value: 11 objectReference: {fileID: 0} - target: {fileID: 1379455275906648392, guid: f41f72efa80301b4cab6c591effa3f2f, type: 3} propertyPath: m_LocalPosition.x @@ -2052,7 +2268,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4553077937098872365, guid: ea6efa880efea42e89c0f3d47c3139f4, type: 3} propertyPath: m_LocalPosition.x - value: -1.2999992 + value: -3.88 objectReference: {fileID: 0} - target: {fileID: 4553077937098872365, guid: ea6efa880efea42e89c0f3d47c3139f4, type: 3} propertyPath: m_LocalPosition.y @@ -2060,7 +2276,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4553077937098872365, guid: ea6efa880efea42e89c0f3d47c3139f4, type: 3} propertyPath: m_LocalPosition.z - value: -39.22498 + value: -40.22 objectReference: {fileID: 0} - target: {fileID: 4553077937098872365, guid: ea6efa880efea42e89c0f3d47c3139f4, type: 3} propertyPath: m_LocalRotation.w @@ -2233,15 +2449,15 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4553077937098872365, guid: ea6efa880efea42e89c0f3d47c3139f4, type: 3} propertyPath: m_LocalScale.x - value: 0.11 + value: 0.1 objectReference: {fileID: 0} - target: {fileID: 4553077937098872365, guid: ea6efa880efea42e89c0f3d47c3139f4, type: 3} propertyPath: m_LocalScale.y - value: 0.11 + value: 0.1 objectReference: {fileID: 0} - target: {fileID: 4553077937098872365, guid: ea6efa880efea42e89c0f3d47c3139f4, type: 3} propertyPath: m_LocalScale.z - value: 0.11 + value: 0.1 objectReference: {fileID: 0} - target: {fileID: 4553077937098872365, guid: ea6efa880efea42e89c0f3d47c3139f4, type: 3} propertyPath: m_LocalPosition.x @@ -2552,15 +2768,15 @@ PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: - m_TransformParent: {fileID: 1619211198} + m_TransformParent: {fileID: 223011768} m_Modifications: - target: {fileID: 7697726511162938563, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} propertyPath: m_RootOrder - value: 2 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7697726511162938563, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} propertyPath: m_LocalScale.x - value: 1 + value: 0.6666667 objectReference: {fileID: 0} - target: {fileID: 7697726511162938563, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} propertyPath: m_LocalScale.y @@ -2568,19 +2784,19 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 7697726511162938563, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} propertyPath: m_LocalScale.z - value: 1 + value: 0.6666667 objectReference: {fileID: 0} - target: {fileID: 7697726511162938563, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} propertyPath: m_LocalPosition.x - value: 0 + value: -2.153057 objectReference: {fileID: 0} - target: {fileID: 7697726511162938563, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} propertyPath: m_LocalPosition.y - value: 1 + value: -4.2838287 objectReference: {fileID: 0} - target: {fileID: 7697726511162938563, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} propertyPath: m_LocalPosition.z - value: 0 + value: 35.01367 objectReference: {fileID: 0} - target: {fileID: 7697726511162938563, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} propertyPath: m_LocalRotation.w @@ -2620,6 +2836,11 @@ PrefabInstance: objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} +--- !u!4 &1052650314 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 7697726511162938563, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} + m_PrefabInstance: {fileID: 1052650313} + m_PrefabAsset: {fileID: 0} --- !u!1001 &1070159102 PrefabInstance: m_ObjectHideFlags: 0 @@ -3204,6 +3425,18 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 0} m_Modifications: + - target: {fileID: 3776817179778519635, guid: c64dd7ba057a82348b79469ce853620f, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3776817179778519635, guid: c64dd7ba057a82348b79469ce853620f, type: 3} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3776817179778519635, guid: c64dd7ba057a82348b79469ce853620f, type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} - target: {fileID: 8026379457506736219, guid: c64dd7ba057a82348b79469ce853620f, type: 3} propertyPath: doorWing value: @@ -3290,7 +3523,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 8026379457542019628, guid: c64dd7ba057a82348b79469ce853620f, type: 3} propertyPath: m_LocalPosition.y - value: 1.1 + value: 1.591 objectReference: {fileID: 0} - target: {fileID: 8026379457542019628, guid: c64dd7ba057a82348b79469ce853620f, type: 3} propertyPath: m_LocalPosition.z @@ -3599,31 +3832,31 @@ PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: - m_TransformParent: {fileID: 812419024} + m_TransformParent: {fileID: 1500943925} m_Modifications: - target: {fileID: 3501694543801626047, guid: dd5dfb71bf9329c45a9443de92982f92, type: 3} propertyPath: m_RootOrder - value: 0 + value: 11 objectReference: {fileID: 0} - target: {fileID: 3501694543801626047, guid: dd5dfb71bf9329c45a9443de92982f92, type: 3} propertyPath: m_LocalScale.x - value: 0.33333334 + value: 0.6666667 objectReference: {fileID: 0} - target: {fileID: 3501694543801626047, guid: dd5dfb71bf9329c45a9443de92982f92, type: 3} propertyPath: m_LocalScale.z - value: 0.33333334 + value: 0.6666667 objectReference: {fileID: 0} - target: {fileID: 3501694543801626047, guid: dd5dfb71bf9329c45a9443de92982f92, type: 3} propertyPath: m_LocalPosition.x - value: -0.23 + value: -0.45999908 objectReference: {fileID: 0} - target: {fileID: 3501694543801626047, guid: dd5dfb71bf9329c45a9443de92982f92, type: 3} propertyPath: m_LocalPosition.y - value: 0 + value: 8 objectReference: {fileID: 0} - target: {fileID: 3501694543801626047, guid: dd5dfb71bf9329c45a9443de92982f92, type: 3} propertyPath: m_LocalPosition.z - value: -0.01 + value: -0.019996643 objectReference: {fileID: 0} - target: {fileID: 3501694543801626047, guid: dd5dfb71bf9329c45a9443de92982f92, type: 3} propertyPath: m_LocalRotation.w @@ -3703,6 +3936,8 @@ Transform: - {fileID: 529679626} - {fileID: 444149555} - {fileID: 2017438472} + - {fileID: 1619211198} + - {fileID: 547995135} m_Father: {fileID: 0} m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -4047,7 +4282,7 @@ Transform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 4 + m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} --- !u!114 &1603234989 MonoBehaviour: @@ -4170,7 +4405,7 @@ RectTransform: - {fileID: 1752674893} - {fileID: 577953295} m_Father: {fileID: 0} - m_RootOrder: 6 + m_RootOrder: 7 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -4422,7 +4657,7 @@ Transform: m_CorrespondingSourceObject: {fileID: 1958802387448522672, guid: c2fa291ca1c8944109df4c9927fe4581, type: 3} m_PrefabInstance: {fileID: 1702097292} m_PrefabAsset: {fileID: 0} ---- !u!1 &1741900269 +--- !u!1 &1722329787 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -4430,66 +4665,194 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 1741900270} - - component: {fileID: 1741900271} + - component: {fileID: 1722329788} + - component: {fileID: 1722329789} m_Layer: 0 - m_Name: Wall (1) + m_Name: Wall (4) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &1741900270 +--- !u!4 &1722329788 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1741900269} - m_LocalRotation: {x: -0, y: -0.5887242, z: -0, w: 0.80833405} - m_LocalPosition: {x: 20.6, y: 2.95, z: 52.3} + m_GameObject: {fileID: 1722329787} + m_LocalRotation: {x: -0, y: 0.026327705, z: -0, w: 0.9996534} + m_LocalPosition: {x: 87.3, y: 2.9500003, z: 65.8} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 635329787} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: -72.133, z: 0} ---- !u!65 &1741900271 + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 3.017, z: 0} +--- !u!65 &1722329789 BoxCollider: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1741900269} + m_GameObject: {fileID: 1722329787} m_Material: {fileID: 0} m_IsTrigger: 0 m_Enabled: 1 serializedVersion: 2 - m_Size: {x: 47.996727, y: 28.56165, z: 32.828915} - m_Center: {x: 15.48153, y: 4.039917, z: -7.3456745} ---- !u!4 &1745320739 stripped -Transform: - m_CorrespondingSourceObject: {fileID: 8889593824445719745, guid: b14540b09a764c44681ab799bcae9776, type: 3} - m_PrefabInstance: {fileID: 2117410553} - m_PrefabAsset: {fileID: 0} ---- !u!1 &1752674892 -GameObject: + m_Size: {x: 19.250366, y: 28.56165, z: 47.990524} + m_Center: {x: 13.214653, y: 4.039917, z: -4.8991127} +--- !u!1001 &1730337437 +PrefabInstance: m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1752674893} - - component: {fileID: 1752674896} - - component: {fileID: 1752674895} - - component: {fileID: 1752674894} - m_Layer: 5 - m_Name: InventoryIcon - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 223011768} + m_Modifications: + - target: {fileID: 7697726511162938563, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} + propertyPath: m_RootOrder + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 7697726511162938563, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} + propertyPath: m_LocalScale.x + value: 0.6666667 + objectReference: {fileID: 0} + - target: {fileID: 7697726511162938563, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} + propertyPath: m_LocalScale.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7697726511162938563, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} + propertyPath: m_LocalScale.z + value: 0.6666667 + objectReference: {fileID: 0} + - target: {fileID: 7697726511162938563, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} + propertyPath: m_LocalPosition.x + value: 3.26 + objectReference: {fileID: 0} + - target: {fileID: 7697726511162938563, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} + propertyPath: m_LocalPosition.y + value: 3.68 + objectReference: {fileID: 0} + - target: {fileID: 7697726511162938563, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} + propertyPath: m_LocalPosition.z + value: -11.29 + objectReference: {fileID: 0} + - target: {fileID: 7697726511162938563, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} + propertyPath: m_LocalRotation.w + value: 0.6177125 + objectReference: {fileID: 0} + - target: {fileID: 7697726511162938563, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 7697726511162938563, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} + propertyPath: m_LocalRotation.y + value: 0.786404 + objectReference: {fileID: 0} + - target: {fileID: 7697726511162938563, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 7697726511162938563, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7697726511162938563, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 103.701 + objectReference: {fileID: 0} + - target: {fileID: 7697726511162938563, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7697726511162938563, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} + propertyPath: m_ConstrainProportionsScale + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7697726511163345597, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} + propertyPath: m_Name + value: ScorePrefab (1) + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} +--- !u!1 &1730337438 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 7697726511163345597, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} + m_PrefabInstance: {fileID: 1730337437} + m_PrefabAsset: {fileID: 0} +--- !u!4 &1730337439 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 7697726511162938563, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} + m_PrefabInstance: {fileID: 1730337437} + m_PrefabAsset: {fileID: 0} +--- !u!1 &1741900269 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1741900270} + - component: {fileID: 1741900271} + m_Layer: 0 + m_Name: Wall (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1741900270 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1741900269} + m_LocalRotation: {x: -0, y: -0.5887242, z: -0, w: 0.80833405} + m_LocalPosition: {x: 20.6, y: 2.95, z: 52.3} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 635329787} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: -72.133, z: 0} +--- !u!65 &1741900271 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1741900269} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 47.996727, y: 28.56165, z: 32.828915} + m_Center: {x: 15.48153, y: 4.039917, z: -7.3456745} +--- !u!4 &1745320739 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 8889593824445719745, guid: b14540b09a764c44681ab799bcae9776, type: 3} + m_PrefabInstance: {fileID: 2117410553} + m_PrefabAsset: {fileID: 0} +--- !u!1 &1752674892 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1752674893} + - component: {fileID: 1752674896} + - component: {fileID: 1752674895} + - component: {fileID: 1752674894} + m_Layer: 5 + m_Name: InventoryIcon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!224 &1752674893 RectTransform: @@ -4774,7 +5137,7 @@ Transform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 7 + m_RootOrder: 8 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1001 &1849003612 PrefabInstance: @@ -4838,6 +5201,51 @@ GameObject: m_CorrespondingSourceObject: {fileID: 7697726511163345597, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} m_PrefabInstance: {fileID: 1052650313} m_PrefabAsset: {fileID: 0} +--- !u!1 &1890173736 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1890173737} + - component: {fileID: 1890173738} + m_Layer: 0 + m_Name: Wall (5) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1890173737 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1890173736} + m_LocalRotation: {x: -0, y: -0.6447487, z: -0, w: 0.76439464} + m_LocalPosition: {x: 83.07, y: 2.9500003, z: 67.13} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 635329787} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: -80.294, z: 0} +--- !u!65 &1890173738 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1890173736} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 19.250366, y: 28.56165, z: 47.990524} + m_Center: {x: 13.214653, y: 4.039917, z: -4.8991127} --- !u!1001 &1890297140 PrefabInstance: m_ObjectHideFlags: 0 @@ -4976,14 +5384,14 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1897914166} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 78.63, y: 2.95, z: 36} + m_LocalRotation: {x: -0, y: 0.026327705, z: -0, w: 0.9996534} + m_LocalPosition: {x: 78.85359, y: 2.9500003, z: 36.690178} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 635329787} m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_LocalEulerAnglesHint: {x: 0, y: 3.017, z: 0} --- !u!65 &1897914168 BoxCollider: m_ObjectHideFlags: 0 @@ -4995,8 +5403,8 @@ BoxCollider: m_IsTrigger: 0 m_Enabled: 1 serializedVersion: 2 - m_Size: {x: 23.339867, y: 28.56165, z: 49.98923} - m_Center: {x: 11.169933, y: 4.039917, z: -3.899763} + m_Size: {x: 19.250366, y: 28.56165, z: 47.990524} + m_Center: {x: 13.214653, y: 4.039917, z: -4.8991127} --- !u!1001 &1956161527 PrefabInstance: m_ObjectHideFlags: 0 @@ -5161,6 +5569,89 @@ Transform: m_CorrespondingSourceObject: {fileID: 6575594153707666772, guid: 806886f5c38c715468ad365ca10ec29a, type: 3} m_PrefabInstance: {fileID: 1956161527} m_PrefabAsset: {fileID: 0} +--- !u!1001 &1996240646 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 223011768} + m_Modifications: + - target: {fileID: 7697726511162938563, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} + propertyPath: m_RootOrder + value: 4 + objectReference: {fileID: 0} + - target: {fileID: 7697726511162938563, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} + propertyPath: m_LocalScale.x + value: 0.6666667 + objectReference: {fileID: 0} + - target: {fileID: 7697726511162938563, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} + propertyPath: m_LocalScale.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7697726511162938563, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} + propertyPath: m_LocalScale.z + value: 0.6666667 + objectReference: {fileID: 0} + - target: {fileID: 7697726511162938563, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} + propertyPath: m_LocalPosition.x + value: 15.98 + objectReference: {fileID: 0} + - target: {fileID: 7697726511162938563, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} + propertyPath: m_LocalPosition.y + value: 2.69 + objectReference: {fileID: 0} + - target: {fileID: 7697726511162938563, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} + propertyPath: m_LocalPosition.z + value: 34.82 + objectReference: {fileID: 0} + - target: {fileID: 7697726511162938563, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} + propertyPath: m_LocalRotation.w + value: 0.6177125 + objectReference: {fileID: 0} + - target: {fileID: 7697726511162938563, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 7697726511162938563, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} + propertyPath: m_LocalRotation.y + value: 0.786404 + objectReference: {fileID: 0} + - target: {fileID: 7697726511162938563, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 7697726511162938563, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7697726511162938563, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 103.701 + objectReference: {fileID: 0} + - target: {fileID: 7697726511162938563, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7697726511162938563, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} + propertyPath: m_ConstrainProportionsScale + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7697726511163345597, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} + propertyPath: m_Name + value: ScorePrefab (2) + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} +--- !u!1 &1996240647 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 7697726511163345597, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} + m_PrefabInstance: {fileID: 1996240646} + m_PrefabAsset: {fileID: 0} +--- !u!4 &1996240648 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 7697726511162938563, guid: 7805d3ce186544023b0c4fccc2013bfc, type: 3} + m_PrefabInstance: {fileID: 1996240646} + m_PrefabAsset: {fileID: 0} --- !u!1001 &2017438471 PrefabInstance: m_ObjectHideFlags: 0 @@ -5192,6 +5683,18 @@ PrefabInstance: propertyPath: exposedSurfaceRatio value: 0.1 objectReference: {fileID: 0} + - target: {fileID: 8621887888605270576, guid: aa403b6ac10fb83448f4a9b983165b09, type: 3} + propertyPath: flotages.Array.size + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 8621887888605270576, guid: aa403b6ac10fb83448f4a9b983165b09, type: 3} + propertyPath: flotages.Array.data[0] + value: + objectReference: {fileID: 1619211198} + - target: {fileID: 8621887888605270576, guid: aa403b6ac10fb83448f4a9b983165b09, type: 3} + propertyPath: flotages.Array.data[1] + value: + objectReference: {fileID: 547995135} - target: {fileID: 8621887888605270577, guid: aa403b6ac10fb83448f4a9b983165b09, type: 3} propertyPath: m_Size.x value: 20 @@ -5323,7 +5826,7 @@ Transform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 9 + m_RootOrder: 10 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &2025657113 GameObject: @@ -5445,7 +5948,7 @@ Transform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 8 + m_RootOrder: 9 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &2064888409 GameObject: @@ -5523,6 +6026,124 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2064888409} m_CullTransparentMesh: 1 +--- !u!1001 &2088952164 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 223011768} + m_Modifications: + - target: {fileID: 1392622848452239268, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: target + value: + objectReference: {fileID: 1996240647} + - target: {fileID: 1392622848452239268, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: offset.y + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 3189293820305238040, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_Name + value: FloatingTextOverScore (2) + objectReference: {fileID: 0} + - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_Pivot.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_Pivot.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_RootOrder + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_AnchorMax.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_AnchorMax.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_AnchorMin.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_AnchorMin.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_SizeDelta.x + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_SizeDelta.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_LocalScale.x + value: 0.66666675 + objectReference: {fileID: 0} + - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_LocalScale.z + value: 0.66666675 + objectReference: {fileID: 0} + - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_LocalPosition.z + value: 28.170351 + objectReference: {fileID: 0} + - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_LocalRotation.w + value: -0.7071068 + objectReference: {fileID: 0} + - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_LocalRotation.y + value: 0.7071068 + objectReference: {fileID: 0} + - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_AnchoredPosition.x + value: -139.37967 + objectReference: {fileID: 0} + - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_AnchoredPosition.y + value: 1.1861715 + objectReference: {fileID: 0} + - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 270 + objectReference: {fileID: 0} + - target: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} +--- !u!224 &2088952165 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 6560230225549944079, guid: 589485ec7b4b546f3938579ede0e2a8e, type: 3} + m_PrefabInstance: {fileID: 2088952164} + m_PrefabAsset: {fileID: 0} --- !u!4 &2094903761 stripped Transform: m_CorrespondingSourceObject: {fileID: 3465548953573818056, guid: 6c87883a4e75b2642956923c1e6891f4, type: 3} From eb5c1f1ca65aa598a755b55893721c725f88153d Mon Sep 17 00:00:00 2001 From: ygr4789 Date: Sat, 21 Dec 2024 15:31:39 +0900 Subject: [PATCH 4/5] chore: fix tilted doors opening incorrectly --- Assets/02.Scripts/Objects/DoorController.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Assets/02.Scripts/Objects/DoorController.cs b/Assets/02.Scripts/Objects/DoorController.cs index 8f5782e7..c88cc328 100644 --- a/Assets/02.Scripts/Objects/DoorController.cs +++ b/Assets/02.Scripts/Objects/DoorController.cs @@ -218,18 +218,18 @@ private IEnumerator StageClearDirection() private IEnumerator OpenDoorAnimation(GameObject door) { float duration = 1f; // animation duration - float startRotation = door.transform.eulerAngles.y; + float startRotation = door.transform.localEulerAngles.y; float endRotation = startRotation + 90; float time = 0; while (time < duration) { float yRotation = Mathf.Lerp(startRotation, endRotation, time / duration); - door.transform.eulerAngles = new Vector3(door.transform.eulerAngles.x, yRotation, door.transform.eulerAngles.z); + door.transform.localEulerAngles = new Vector3(door.transform.localEulerAngles.x, yRotation, door.transform.localEulerAngles.z); time += Time.deltaTime; yield return null; } - door.transform.eulerAngles = new Vector3(door.transform.eulerAngles.x, endRotation, door.transform.eulerAngles.z); + door.transform.localEulerAngles = new Vector3(door.transform.localEulerAngles.x, endRotation, door.transform.localEulerAngles.z); } } From 3233eb7910c05a7e7e3ec290c1db284dc455d8a5 Mon Sep 17 00:00:00 2001 From: ygr4789 Date: Sat, 21 Dec 2024 15:32:08 +0900 Subject: [PATCH 5/5] chore: remove stone pulling limit distance --- Assets/02.Scripts/Objects/RockController.cs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Assets/02.Scripts/Objects/RockController.cs b/Assets/02.Scripts/Objects/RockController.cs index e3a27994..1c3d95a0 100644 --- a/Assets/02.Scripts/Objects/RockController.cs +++ b/Assets/02.Scripts/Objects/RockController.cs @@ -11,14 +11,11 @@ public class RockController : Interactable [Tooltip("The distance at which the object stops approaching the player")] [Range(0f, 0.1f)] - [SerializeField] - private float approachDistance = 3f; + [SerializeField] private float approachDistance = 3f; - [Range(0f, 10f)] - public float moveSpeed = 3f; + [Range(0f, 10f)] public float moveSpeed = 3f; - [SerializeField] - private Transform rockModel; + [SerializeField] private Transform rockModel; private const string PlayerTag = "Player"; // Tag of the player to follow private GameObject _player; // Reference to the player object @@ -91,7 +88,7 @@ private void RollRock(Vector3 velocity) private void MoveToPlayer() { - if (Vector3.Distance(_player.transform.position, transform.position) < approachDistance) return; + // if (Vector3.Distance(_player.transform.position, transform.position) < approachDistance) return; var directionToPlayer = (_player.transform.position - transform.position).normalized; _currentVelocity = directionToPlayer * moveSpeed; }