projectEli/Assets/NeoFPS/Core/NeoSaveGames/Serialization/NeoSerializedSceneObjectContainer.cs

43 lines
1.0 KiB
C#
Raw Normal View History

2022-11-07 01:28:33 +00:00
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
namespace NeoSaveGames.Serialization
{
[Serializable]
public class NeoSerializedSceneObjectContainer : NeoSerializedGameObjectContainerBase
{
[SerializeField]
private NeoSerializedScene m_Scene = null;
public override Transform rootTransform
{
get { return null; }
}
public override bool isValid
{
get { return m_Scene != null; }
}
public NeoSerializedScene serializedScene
{
get { return m_Scene; }
}
public NeoSerializedSceneObjectContainer(NeoSerializedScene scene)
{
m_Scene = scene;
}
public override void RegisterObject(NeoSerializedGameObject nsgo)
{
base.RegisterObject(nsgo);
if (isBuildingHierarchy)
SceneManager.MoveGameObjectToScene(nsgo.gameObject, m_Scene.scene);
}
}
}