예제 #1
0
    // creates Cube, requires cube's position and type
    public void CreateCube(CubeEditor cubeEditor, Vector3 cubePos, CubeType cubeType)
    {
        CubeEditor currentCubeEditor = Instantiate(basicCubePrefab, cubePos, Quaternion.identity, transform);

        currentCubeEditor.UpdateName();
        currentCubeEditor.SetCubeParent(this);
        currentCubeEditor.SetCubeType(cubeType);

        if (!cubeEditorTable.ContainsKey(currentCubeEditor.transform.position))
        {
            cubeEditorTable.Add(currentCubeEditor.transform.position, currentCubeEditor);
        }
    }