示例#1
0
    public void DeleteModelFromTerrain(GameObject gameObject)
    {
        var toDelete = ModelsOnTerrain.First(x => x.GameObject == gameObject);

        GameObject.Destroy(toDelete.GameObject);
        ModelsOnTerrain.Remove(toDelete);
    }
示例#2
0
    public void DeleteModel(Guid modelGuid)
    {
        var objToDelete = ModelsOnTerrain.Where(x => x.ModelGuid == modelGuid).ToList();

        foreach (var obj in objToDelete)
        {
            GameObject.Destroy(obj.GameObject);
            ModelsOnTerrain.Remove(obj);
        }

        GameObject.Destroy(Models[modelGuid].GameObject);
        Models.Remove(modelGuid);
    }