• This project
    • Loading...
  • Sign in

范川铭 / UnityFrameWork

Go to a project
Toggle navigation
  • Projects
  • Groups
  • Snippets
  • Help
Toggle navigation pinning
  • Project
  • Activity
  • Repository
  • Pipelines
  • Graphs
  • Issues 0
  • Merge Requests 0
  • Wiki
  • Network
  • Create a new issue
  • Builds
  • Commits
  • Files
  • Commits
  • Network
  • Compare
  • Branches
  • Tags
Switch branch/tag
  • UnityFrameWork
  • Assets
  • Scripts
  • ScrollView
  • ItemUI.cs
  • 1.暂时性的增加一个简单计时器延迟播放小恐龙动画 · a7f49867
    a7f49867 Browse Files
    范川铭 authored 2025-05-15 14:35:54 +0800
ItemUI.cs 463 Bytes
Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
using UnityEngine;
using UnityEngine.UI;

public class ItemUI : MonoBehaviour
{
    [SerializeField] private Text nameText;
    [SerializeField] private Image iconImage;
    
    public void SetData(CustomListComponent.ItemData data)
    {
        if (nameText != null)
        {
            nameText.text = data.name;
        }
        
        if (iconImage != null && data.icon != null)
        {
            iconImage.sprite = data.icon;
        }
    }
}