25 lines
678 B
C#
25 lines
678 B
C#
using AibisDream.Framework;
|
|
using UnityEngine;
|
|
|
|
namespace AibisDream
|
|
{
|
|
public class PrefabMobileObject : AbsMobileObject
|
|
{
|
|
private GameObject _childObject;
|
|
|
|
public override void Init()
|
|
{
|
|
base.Init();
|
|
var spriteAsset = ResourceKit.LoadAssetSync<GameObject>(RandomSelectAddress());
|
|
|
|
_childObject = Instantiate(spriteAsset, transform);
|
|
_childObject.transform.localScale = mobileObjectData.isFlip ? new Vector3(-1, 1, 1) : Vector3.one;
|
|
}
|
|
|
|
protected override void Dispose()
|
|
{
|
|
Destroy(_childObject);
|
|
base.Dispose();
|
|
}
|
|
}
|
|
} |