Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InfiniteScroll #547

Open
1 of 9 tasks
Kimighwan opened this issue Feb 11, 2025 · 1 comment
Open
1 of 9 tasks

InfiniteScroll #547

Kimighwan opened this issue Feb 11, 2025 · 1 comment
Assignees
Labels
question Issue type : Question

Comments

@Kimighwan
Copy link

Kimighwan commented Feb 11, 2025

Service

  • WebView
  • AssetManagement
  • Communicator
  • LogViewer
  • Manager
  • UI
  • Profiler
  • Adapter
  • DLST

Version

Game Package Manager 2.2.6 / UI 2.10.0

Summary

인피니티 스크롤을 사용하여 어떤 프리펩으로 스크롤을 만들었습니다.
스크롤의 각 오브젝트들은 클릭을 하면 체크표시로 된 이미지를 덮어 씌우고 싶습니다.
(현재는 리소스가 아직 완성되지 않아 초록색 + 알파값을 줄인 이미지로 대체)

근데 여기서 하나만 체크표시 이미지가 표시되도록 하고 싶은데
인스턴스화된 프리펩들을 접근하는 방법이 있는가요?

현재 프리펩의 코드에서 클릭이 된다면 이미지 GameObject가 활성화 되도록 버튼을 만들었습니다.
다른 오브젝트를 클릭하면 체크 표시가 되면서 이전에 체크 표시한 오브젝트의 체크를 없애고 싶어요

Infinite Scroll List를 드래그&드랍으로 할당했는데 여기로 접근할 수 있을 것 같지만 잘 모르겠어요.

Screenshots

Image


Image

@Kimighwan Kimighwan added the question Issue type : Question label Feb 11, 2025
@smflt-nhn smflt-nhn self-assigned this Feb 11, 2025
@smflt-nhn
Copy link
Contributor

@Kimighwan

안녕하세요.

Infinite 스크롤의 데이터는 InfiniteScrollData를 기반으로 InfiniteScrollItem을 상속한 게임오브젝트 에서 공유하여 사용합니다.

이미지 표시는 UpdateData 내부에 InfiniteScrollData 상테에 따라 원하는 이미지를 표시하면 됩니다.

public override void UpdateData(InfiniteScrollData scrollData)
{
    base.UpdateData(scrollData);

    // InfiniteScrollData 콘텐츠로 데이터 적용
}

InfiniteScrollItem 내에 있는 버튼 클릭 시 다른 InfiniteScrollItem전체에 영향을 가기를 원한다면 InfiniteScrollData 내부에 리스트를 관리하는 메니저 클래스를 변수를 추가하면 될것 같습니다.

해당 메니져 클래스에서 관련 데이터를 수정 후 UpdateData 또는 UpdateAllData를 호출하면 스크롤에 바로 적용됩니다.

감사합니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Issue type : Question
Projects
None yet
Development

No branches or pull requests

2 participants