コード例 #1
0
ファイル: OrientedBlock.cs プロジェクト: Hengle/Maze-1
    public GameObject Editor_RemoveFromBlockSet(BlockOrientation orientation, GameObject blockObject)
    {
        BlockSet targetSet = GetSetForOrientation(orientation, true);

        if (targetSet == null)
        {
            return(null);
        }

        GameObject returnObject = targetSet.Editor_RemoveFromBlockSet(blockObject);

        if (!targetSet.HasBlocks())
        {
            targetSet.SetIsDefault(false);

            BlockSet[] bs = GetBlockSetsAsArray();

            for (int i = 0; i < bs.Length; i++)
            {
                if (bs[i].HasBlocks())
                {
                    bs[i].SetIsDefault(true);
                    break;
                }
            }
        }

        return(returnObject);
    }