Example #1
0
    public void SetPlaceable(Placeable prefab)
    {
        if (placeableInstance != null)
        {
            placeableInstance.Remove();
        }
        placeableInstance = Instantiate(prefab, Vector3.zero, prefab.transform.rotation);
        var center = SelectionManager.GetInstance().GetFirstSelected().GetComponent <CentralNode>();
        var grid   = placeableInstance.GetComponent <SnapToCircleGrid>();

        if (grid != null && center != null)
        {
            grid.SetCenter(center.MinNumber, center.transform.position);
        }

        SelectionManager.GetInstance().Disable();
        Update();
    }