33 lines
1.1 KiB
C#
33 lines
1.1 KiB
C#
|
using HK;
|
|||
|
using HK.FUJIFILM;
|
|||
|
using UnityEngine;
|
|||
|
using UnityEngine.UI;
|
|||
|
using ZGame;
|
|||
|
|
|||
|
public class PetIDCard_Fixed : Model_Fixed
|
|||
|
{
|
|||
|
public RectTransform designParent;
|
|||
|
public ProductScriptableObject productScriptableObject;
|
|||
|
|
|||
|
private void OnEnable()
|
|||
|
{
|
|||
|
EventManager.Instance.Subscribe(MugActualModel_Fixed_GenPhotoEventArgs.EventId,
|
|||
|
MugActualModel_Fixed_GenPhotoEvent);
|
|||
|
}
|
|||
|
|
|||
|
private void OnDisable()
|
|||
|
{
|
|||
|
EventManager.Instance.Unsubscribe(MugActualModel_Fixed_GenPhotoEventArgs.EventId,
|
|||
|
MugActualModel_Fixed_GenPhotoEvent);
|
|||
|
}
|
|||
|
|
|||
|
private void MugActualModel_Fixed_GenPhotoEvent(object sender, GameEventArgs e)
|
|||
|
{
|
|||
|
var args = e as MugActualModel_Fixed_GenPhotoEventArgs;
|
|||
|
var loadGameObject = GameObject.Instantiate(args.go, designParent);
|
|||
|
loadGameObject.transform.localPosition = args.go.transform.localPosition;
|
|||
|
var image = loadGameObject.GetComponent<Image>();
|
|||
|
loadGameObject.AddComponent<HK.UpdateTransform>().SetData(args.go.transform);
|
|||
|
loadGameObject.SetActive(true);
|
|||
|
}
|
|||
|
}
|