Game_CodeMM/Assets/00_scripts/Backup/CreateBuildManager.cs

26 lines
698 B
C#
Raw Permalink Normal View History

2025-10-03 02:18:28 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CreateBuildManager : MonoBehaviour
{
[Tooltip("一个格子的预制体")] public GameObject oneCellPrefab; // 预制体: 一个格子
[Tooltip("世界中心位置坐标")] public GameObject startPositionObject;
private void create_a_cell(Vector3 m_create_position)
{
GameObject cell = Instantiate(oneCellPrefab, m_create_position, Quaternion.identity);
cell.name = $"cell_{cell.transform.position}";
}
void Start()
{
create_a_cell(startPositionObject.transform.position);
}
// Update is called once per frame
void Update()
{
}
}