Skip to content

Commit

Permalink
Anomaly27 start time delayed
Browse files Browse the repository at this point in the history
# PR Title [Descriptive title summarizing the change]
## Related Issue(s)
Link or reference any related issues or tickets.
## PR Description
[Provide a brief summary of the changes made.]
### Changes Included
- [ ] Added new feature(s)
- [ ] Fixed identified bug(s)
- [ ] Updated relevant documentation
### Screenshots (if UI changes were made)
Attach screenshots or GIFs of any visual changes. (Only for frontend-related changes)
### Notes for Reviewer
Any specific instructions or points to be considered by the reviewer.
---
## Reviewer Checklist
- [ ] Code is written in clean, maintainable, and idiomatic form.
- [ ] Automated test coverage is adequate.
- [ ] All existing tests pass.
- [ ] Manual testing has been performed to ensure the PR works as expected.
- [ ] Code review comments have been addressed or clarified.
---
## Additional Comments
Add any other comments or information that might be useful for the review process.
  • Loading branch information
psy020529 committed Nov 28, 2024
1 parent 89501d6 commit c66b5a3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 4ff09b028cdd2394e82a6885f68c804d, type: 3}
m_Name:
m_EditorClassIdentifier:
scaleIncreaseRate: -10
scaleIncreaseRate: -100
scaleStartDelay: 5
--- !u!65 &-88205578807635617
BoxCollider:
m_ObjectHideFlags: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
public class Anomaly27_magnifyingclock : MonoBehaviour
{
[SerializeField] private float scaleIncreaseRate = 0.1f; // 초당 증가할 스케일 크기
[SerializeField] private float scaleStartDelay = 5f; // 스케일 증가 시작 딜레이
private bool isScaling = false; // 스케일 증가 여부
private bool isStageClear = true;
private Collider objectCollider;

Expand All @@ -13,13 +15,25 @@ void Start()
isStageClear = true;
objectCollider = GetComponent<Collider>();
objectCollider.isTrigger = false; // Trigger 대신 물리 충돌로 처리

// 5초 후 스케일 증가 시작
Invoke(nameof(StartScaling), scaleStartDelay);
}

void Update()
{
// 시간에 따라 점점 오브젝트와 콜라이더의 스케일을 증가
float scaleIncrease = scaleIncreaseRate * Time.deltaTime;
transform.localScale += new Vector3(scaleIncrease, scaleIncrease, scaleIncrease);
if (isScaling)
{
// 시간에 따라 점점 오브젝트와 콜라이더의 스케일을 증가
float scaleIncrease = scaleIncreaseRate * Time.deltaTime;
transform.localScale += new Vector3(scaleIncrease, scaleIncrease, scaleIncrease);
}
}

private void StartScaling()
{
isScaling = true;
Debug.Log("MagnifyingClock: Scaling has started after delay.");
}

private void OnCollisionEnter(Collision collision)
Expand Down

0 comments on commit c66b5a3

Please sign in to comment.