26 lines
698 B
C#
26 lines
698 B
C#
|
|
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()
|
||
|
|
{
|
||
|
|
}
|
||
|
|
}
|