45 lines
1.1 KiB
C#
45 lines
1.1 KiB
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using HK;
|
|||
|
using UnityEngine;
|
|||
|
using UnityEngine.UI;
|
|||
|
|
|||
|
namespace FUJIFILM
|
|||
|
{
|
|||
|
public class Product_Photo : MonoBehaviour
|
|||
|
{
|
|||
|
public Transform btnParent;
|
|||
|
public Transform stickerParent;
|
|||
|
|
|||
|
public List<Button> buttons = new List<Button>();
|
|||
|
public List<GenSticker> btn_Stickers = new List<GenSticker>();
|
|||
|
|
|||
|
private void Awake()
|
|||
|
{
|
|||
|
buttons = btnParent.TryFindChildDeeps<Button>();
|
|||
|
btn_Stickers = stickerParent.TryFindChildDeeps<GenSticker>();
|
|||
|
|
|||
|
|
|||
|
foreach (var button in buttons)
|
|||
|
{
|
|||
|
button.onClick.AddListener(() => { StartDesign(button); });
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
private void OnEnable()
|
|||
|
{
|
|||
|
foreach (var sticker in btn_Stickers)
|
|||
|
{
|
|||
|
sticker.parent = null;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
private void StartDesign(Button button)
|
|||
|
{
|
|||
|
foreach (var sticker in btn_Stickers)
|
|||
|
{
|
|||
|
sticker.parent = button.transform.parent.GetChild(0);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|