feat : Instantiate add actived param.
实例化对象方法增加激活参数。
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.TextCore.Text;
|
||||
|
||||
namespace YooAsset
|
||||
{
|
||||
@@ -17,6 +18,7 @@ namespace YooAsset
|
||||
private readonly Quaternion _rotation;
|
||||
private readonly Transform _parent;
|
||||
private readonly bool _worldPositionStays;
|
||||
private readonly bool _actived;
|
||||
private ESteps _steps = ESteps.None;
|
||||
|
||||
/// <summary>
|
||||
@@ -25,7 +27,8 @@ namespace YooAsset
|
||||
public GameObject Result = null;
|
||||
|
||||
|
||||
internal InstantiateOperation(AssetHandle handle, bool setPositionAndRotation, Vector3 position, Quaternion rotation, Transform parent, bool worldPositionStays)
|
||||
internal InstantiateOperation(AssetHandle handle, bool setPositionAndRotation, Vector3 position, Quaternion rotation,
|
||||
Transform parent, bool worldPositionStays, bool actived)
|
||||
{
|
||||
_handle = handle;
|
||||
_setPositionAndRotation = setPositionAndRotation;
|
||||
@@ -33,6 +36,7 @@ namespace YooAsset
|
||||
_rotation = rotation;
|
||||
_parent = parent;
|
||||
_worldPositionStays = worldPositionStays;
|
||||
_actived = actived;
|
||||
}
|
||||
internal override void InternalOnStart()
|
||||
{
|
||||
@@ -66,6 +70,8 @@ namespace YooAsset
|
||||
|
||||
// 实例化游戏对象
|
||||
Result = InstantiateInternal(_handle.AssetObject, _setPositionAndRotation, _position, _rotation, _parent, _worldPositionStays);
|
||||
if (_actived == false)
|
||||
Result.SetActive(false);
|
||||
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Succeed;
|
||||
|
||||
Reference in New Issue
Block a user