Показать сообщение отдельно
Старый 28.01.2013, 23:08   #116
mepihin
ПроЭктировщик
 
Регистрация: 31.12.2012
Сообщений: 165
Написано 5 полезных сообщений
(для 7 пользователей)
Ответ: Вотпросы от mepihin!

попробую, вот у меня новый косяк, почему при компиляции игры, вот на 1 строку выдает такую ошибку и что делать дальше?
No attribute with the name 'MenuItem' or 'MenuItemAttribute' was found (attribute names are case insensitive).
@MenuItem ("Terrain/Apply Splatmap")

static function 
ApplySplatmap () {
    var 
splatmap Texture2D Selection.activeObject as Texture2D;
    if (
splatmap == null) { 
        
EditorUtility.DisplayDialog("No texture selected""Please select a texture""Cancel"); 
        return; 
    }
    if (
splatmap.format != TextureFormat.ARGB32) {
        
EditorUtility.DisplayDialog("Wrong format""Splatmap must be in RGBA 32 bit format""Cancel"); 
        return;
    }

    var 
splatmap.width;
    if (
splatmap.height != w) {
        
EditorUtility.DisplayDialog("Wrong size""Splatmap width and height must be the same""Cancel"); 
        return;
    }
    if (
Mathf.ClosestPowerOfTwo(w) != w) {
        
EditorUtility.DisplayDialog("Wrong size""Splatmap width and height must be a power of two""Cancel"); 
        return;    
    }

    var 
terrain Terrain.activeTerrain.terrainData;
    
terrain.alphamapResolution w;
    var 
splatmapData terrain.GetAlphamaps(00ww);
    var 
mapColors splatmap.GetPixels();
    if (
splatmapData.Length mapColors.Length*4) {
        
EditorUtility.DisplayDialog("Add textures""The terrain must have at least four textures""Cancel"); 
        return;    
    }
    
    for (
04z++) {
        for (
0wy++) {
            for (
0wx++) {
                
splatmapData[x,y,z] = mapColors[((w-1)-x)*y][z];
            }
        }
    }
    
terrain.SetAlphamaps(00splatmapData);

(Offline)
 
Ответить с цитированием