Initial commit
This commit is contained in:
34
Assets/Scripting/Khac/SceneSetup.cs
Normal file
34
Assets/Scripting/Khac/SceneSetup.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class SceneSetup : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private Transform groundPlanePrefab; // Transform của Prefab Plane
|
||||
[SerializeField] private Transform amrPrefab; // Transform của Prefab AMR
|
||||
|
||||
void Start()
|
||||
{
|
||||
// Khởi tạo Plane
|
||||
if (groundPlanePrefab != null)
|
||||
{
|
||||
GameObject plane = Instantiate(groundPlanePrefab.gameObject, groundPlanePrefab.position, groundPlanePrefab.rotation);
|
||||
plane.name = "GroundPlane";
|
||||
Debug.Log($"Đã khởi tạo GroundPlane Prefab tại position: {groundPlanePrefab.position}, rotation: {groundPlanePrefab.rotation.eulerAngles}");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError("GroundPlane Prefab (Transform) chưa được gán trong Inspector!");
|
||||
}
|
||||
|
||||
// Khởi tạo AMR
|
||||
if (amrPrefab != null)
|
||||
{
|
||||
GameObject amr = Instantiate(amrPrefab.gameObject, amrPrefab.position, amrPrefab.rotation);
|
||||
amr.name = "AMR";
|
||||
Debug.Log($"Đã khởi tạo AMR Prefab tại position: {amrPrefab.position}, rotation: {amrPrefab.rotation.eulerAngles}");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError("AMR Prefab (Transform) chưa được gán trong Inspector!");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user