Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Why I'm getting this error ?

Discussion in 'Editor & General Support' started by ksam2, Sep 22, 2014.

  1. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,069
    Hi there, I've imported my project into a new version of unity but when I want to play the game I get below error massage

    How can I fix this?
    Thanks
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,398
    There is no Mesh.SetTriangleStrip function so you'll need to remove the script. You can use Mesh.CombineMeshes instead.

    --Eric
     
    ksam2 likes this.
  3. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,069
    But this package works fine in the previous version on unity and after I import it in new version everything destroyed
    I've delete that script and three more others to run the game but everything changed and lots of my materials doesn't work anymore

    Why is that?
     
  4. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,398
    They removed some functions, so the script no longer works, but it's no longer needed anyway. Because you can just use Mesh.CombineMeshes now.

    --Eric
     
    ksam2 likes this.
  5. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,069
    So why they doing that? I have lots of assets and scripts and ... that doesn't work anymore because some functions removed

    Two of my most beloved materials and three of my images effect doesn't wok anymore.
    How can I fix them when I'm very new to coding?
     
  6. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,398
    Unity isn't a static thing; it changes over time as they improve it and find better ways of doing things. They get rid of old functions that are no longer needed.

    --Eric
     
    ksam2 likes this.
  7. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,069
    Thanks a lot for reply
    Just one more question about one of my shader, It become pink in the new version and I really love to know why?

    It's the shader code
    Code (CSharp):
    1. Shader "Elementals/Reflection Blur Fresnel"
    2. {
    3.     Properties
    4.     {
    5.         _MainTint ("Main Tint", Color) = (0.5,0.5,0.5,0.5)
    6.         _MainTex ("Texture", 2D) = "white" {}
    7.         _NormalMap ("Normal Map", 2D) = "bump" {}
    8.         _SpecularMap("Specular Map", 2D) = "white" {}
    9.         _Cube ("Cubemap", CUBE) = "" {}
    10.         _ReflectionMap ("Reflection Map", 2D) = "white" {}
    11.         _Blur ("Blur", Float) = 0.5
    12.        
    13.         _SpecColor ("Specular Color", Color) = (0.5,0.5,0.5,1)
    14.         _Shininess ("Shininess", Range (0.01, 1)) = 0.078125
    15.  
    16.         _RimColor("Rim Color", Color) = (1,0,0,1)
    17.         _RimPower("Rim Power", Float) = 100
    18.  
    19.         _FresIn("Fresnel Mid", Range(0.001, 1.0)) = 0.25
    20.         _FresOut("Fresnel Zovniwn", Range(0.001, 1.0)) = 0.25
    21.     }
    22.    
    23.     SubShader
    24.     {
    25.         Tags { "RenderType" = "Opaque" }
    26.         CGPROGRAM
    27.         #pragma surface surf  Sram
    28.         #pragma glsl
    29.         #pragma target 3.0
    30.        
    31.         float _Blur;
    32.         float _BlurType;
    33.         float _BlurRange;
    34.         fixed _ReflPower;
    35.        
    36.         float _Shininess;
    37.         float _SpecPower;
    38.        
    39.         float4 _FresColor;
    40.         fixed _FresPowerIn;
    41.         fixed _FresPowerOut;
    42.         fixed _FresIn;
    43.         fixed _FresOut;
    44.                
    45.         fixed4 _MainTint;
    46.         float4 _RimColor;
    47.         float _RimPower;
    48.        
    49.         struct Input
    50.         {
    51.             float2 uv_MainTex;
    52.             float2 uv_NormalMap;
    53.             float2 uv_SpecularMap;
    54.             float2 uv_ReflectionMap;
    55.             float3 worldRefl;
    56.             float3 viewDir;
    57.             INTERNAL_DATA
    58.         };
    59.        
    60.         sampler2D _MainTex;
    61.         sampler2D _NormalMap;
    62.         sampler2D _SpecularMap;
    63.         sampler2D _ReflectionMap;
    64.         samplerCUBE _Cube;
    65.         float4 refl;
    66.        
    67.         inline fixed4 LightingSram(SurfaceOutput s, fixed3 lightDir, fixed3 viewDir, fixed atten)
    68.         {
    69.             fixed3 halfVector = normalize(lightDir + viewDir);
    70.        
    71.             fixed NdotL = max(0, dot(s.Normal, lightDir));
    72.            
    73.             fixed EdotH = max(0, dot(viewDir, halfVector));
    74.             fixed NdotH = max(0, dot(s.Normal, halfVector));
    75.             fixed NdotE = max(0, dot(s.Normal, viewDir));
    76.            
    77.             //Rim light
    78.             fixed rimLight = 0;
    79.             rimLight = pow(rimLight, _RimPower) * NdotH;
    80.            
    81.             float spec = pow (NdotH, s.Specular*128.0) * s.Gloss;
    82.            
    83.             fixed4 finalColor;
    84.             finalColor.rgb = (s.Albedo * _LightColor0.rgb * NdotL +  _LightColor0.rgb * spec * _SpecColor + rimLight) * (NdotE * atten * 2);
    85.             return finalColor;
    86.         }
    87.        
    88.         float4 ReflectionBlurCube(samplerCUBE CubeTex, float3 refVector, float _Blur)
    89.         {
    90.             _BlurRange = _Blur/10;
    91.                 refl += texCUBE (CubeTex, refVector - float3(4*_BlurRange,0,0))*0.05;
    92.                 refl += texCUBE (CubeTex, refVector - float3(3*_BlurRange,0,0))*0.09;
    93.                 refl += texCUBE (CubeTex, refVector -float3(2*_BlurRange,0,0))*0.12;
    94.                 refl += texCUBE (CubeTex, refVector -float3(1*_BlurRange,0,0))*0.15;
    95.                 refl += texCUBE (CubeTex, refVector ) * 0.16;
    96.                 refl += texCUBE (CubeTex, refVector + float3(1*_BlurRange,0,0))*0.15;
    97.                 refl += texCUBE (CubeTex, refVector + float3(2*_BlurRange,0,0))*0.12;
    98.                 refl += texCUBE (CubeTex, refVector + float3(3*_BlurRange,0,0))*0.09;
    99.                 refl += texCUBE (CubeTex, refVector + float3(4*_BlurRange,0,0))*0.05;
    100.    
    101. //                refl += texCUBE (CubeTex, refVector -float3(0,4*_BlurRange,0))*0.05;
    102. //                refl += texCUBE (CubeTex, refVector -float3(0,3*_BlurRange,0))*0.09;
    103. //                refl += texCUBE (CubeTex, refVector -float3(0,2*_BlurRange,0))*0.12;
    104. //                refl += texCUBE (CubeTex, refVector -float3(0,1*_BlurRange,0))*0.15;
    105. //                refl += texCUBE (CubeTex, refVector ) * 0.16;
    106. //                refl += texCUBE (CubeTex, refVector +float3(0,1*_BlurRange,0))*0.15;
    107. //                refl += texCUBE (CubeTex, refVector +float3(0,2*_BlurRange,0))*0.12;
    108. //                refl += texCUBE (CubeTex, refVector +float3(0,3*_BlurRange,0))*0.09;
    109. //                refl += texCUBE (CubeTex, refVector +float3(0,4*_BlurRange,0))*0.05;
    110. //  
    111. //                refl += texCUBE (CubeTex, refVector - float3(0,0,4*_BlurRange))*0.05;
    112. //                refl += texCUBE (CubeTex, refVector - float3(0,0,3*_BlurRange))*0.09;
    113. //                refl += texCUBE (CubeTex, refVector - float3(0,0,2*_BlurRange))*0.12;
    114. //                refl += texCUBE (CubeTex, refVector - float3(0,0,1*_BlurRange))*0.15;
    115. //                refl += texCUBE (CubeTex, refVector ) * 0.16;
    116. //                refl += texCUBE (CubeTex, refVector + float3(0,0,1*_BlurRange))*0.15;
    117. //                refl += texCUBE (CubeTex, refVector + float3(0,0,2*_BlurRange))*0.12;
    118. //                refl += texCUBE (CubeTex, refVector + float3(0,0,3*_BlurRange))*0.09;
    119. //                refl += texCUBE (CubeTex, refVector + float3(0,0,4*_BlurRange))*0.05;
    120.    
    121. //                refl += texCUBElod (CubeTex, float4(refVector - float3(4*_BlurRange,0,0), _Blur))*0.05;
    122. //                refl += texCUBElod (CubeTex, float4(refVector - float3(3*_BlurRange,0,0), _Blur))*0.09;
    123. //                refl += texCUBElod (CubeTex, float4(refVector - float3(2*_BlurRange,0,0), _Blur))*0.12;
    124. //                refl += texCUBElod (CubeTex, float4(refVector - float3(1*_BlurRange,0,0), _Blur))*0.15;
    125. //                refl += texCUBElod (CubeTex, float4(refVector , _Blur)) * 0.16;
    126. //                refl += texCUBElod (CubeTex, float4(refVector + float3(1*_BlurRange,0,0), _Blur))*0.15;
    127. //                refl += texCUBElod (CubeTex, float4(refVector + float3(2*_BlurRange,0,0), _Blur))*0.12;
    128. //                refl += texCUBElod (CubeTex, float4(refVector + float3(3*_BlurRange,0,0), _Blur))*0.09;
    129. //                refl += texCUBElod (CubeTex, float4(refVector + float3(4*_BlurRange,0,0), _Blur))*0.05;
    130. //  
    131. //                refl += texCUBElod (CubeTex, float4(refVector - float3(0,4*_BlurRange,0), _Blur))*0.05;
    132. //                refl += texCUBElod (CubeTex, float4(refVector - float3(0,3*_BlurRange,0), _Blur))*0.09;
    133. //                refl += texCUBElod (CubeTex, float4(refVector - float3(0,2*_BlurRange,0), _Blur))*0.12;
    134. //                refl += texCUBElod (CubeTex, float4(refVector - float3(0,1*_BlurRange,0), _Blur))*0.15;
    135. //                refl += texCUBElod (CubeTex, float4(refVector , _Blur)) * 0.16;
    136. //                refl += texCUBElod (CubeTex, float4(refVector + float3(0,1*_BlurRange,0), _Blur))*0.15;
    137. //                refl += texCUBElod (CubeTex, float4(refVector + float3(0,2*_BlurRange,0), _Blur))*0.12;
    138. //                refl += texCUBElod (CubeTex, float4(refVector + float3(0,3*_BlurRange,0), _Blur))*0.09;
    139. //                refl += texCUBElod (CubeTex, float4(refVector + float3(0,4*_BlurRange,0), _Blur))*0.05;
    140. //  
    141. //                refl += texCUBElod (CubeTex, float4(refVector - float3(0,0,4*_BlurRange), _Blur))*0.05;
    142. //                refl += texCUBElod (CubeTex, float4(refVector - float3(0,0,3*_BlurRange), _Blur))*0.09;
    143. //                refl += texCUBElod (CubeTex, float4(refVector - float3(0,0,2*_BlurRange), _Blur))*0.12;
    144. //                refl += texCUBElod (CubeTex, float4(refVector - float3(0,0,1*_BlurRange), _Blur))*0.15;
    145. //                refl += texCUBElod (CubeTex, float4(refVector , _Blur)) * 0.16;
    146. //                refl += texCUBElod (CubeTex, float4(refVector + float3(0,0,1*_BlurRange), _Blur))*0.15;
    147. //                refl += texCUBElod (CubeTex, float4(refVector + float3(0,0,2*_BlurRange), _Blur))*0.12;
    148. //                refl += texCUBElod (CubeTex, float4(refVector + float3(0,0,3*_BlurRange), _Blur))*0.09;
    149. //                refl += texCUBElod (CubeTex, float4(refVector + float3(0,0,4*_BlurRange), _Blur))*0.05;
    150.            
    151.                 //return refl/3 ;//* _ReflPower;
    152.                 //refl = texCUBE (CubeTex, refVector);
    153.                 return refl ;//* _ReflPower;
    154.         }
    155.        
    156.         void surf (Input IN, inout SurfaceOutput o)
    157.         {
    158.             half4 c = tex2D (_MainTex, IN.uv_MainTex);
    159.             o.Albedo = c.rgb * _MainTint * c.a + c.rgb *(1- c.a);
    160.             half4 g = tex2D (_SpecularMap, IN.uv_SpecularMap);
    161.             o.Gloss = g.r;
    162.             o.Specular = _Shininess;
    163.             o.Normal = UnpackNormal (tex2D (_NormalMap, IN.uv_NormalMap));
    164.            
    165.             _ReflPower = tex2D (_ReflectionMap, IN.uv_ReflectionMap).r;
    166.                                    
    167.              half rim = 1 - saturate(dot(normalize(IN.viewDir), o.Normal));
    168.              half fr1 = 1 - saturate(dot(normalize(IN.viewDir), o.Normal));
    169.              half fr2 = saturate(dot(normalize(IN.viewDir), o.Normal));
    170.  
    171.             float4 bluredReflection = ReflectionBlurCube(_Cube,WorldReflectionVector (IN, o.Normal),_Blur);
    172.             o.Emission = bluredReflection * _ReflPower *_FresOut * pow(fr1, 1) +
    173.                          bluredReflection * _ReflPower *_FresIn * pow(fr2, 1) +
    174.                          _RimColor.rgb * pow(rim, _RimPower)*_RimColor.a;
    175.         }
    176.         ENDCG
    177.     }
    178.     Fallback "Diffuse"
    179. }
    What changes in the new version of Unity that makes this shader useless?
    Thanks
     
  8. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,398
    No idea; you should post that as a separate topic in the Shaderlab category.

    --Eric
     
    ksam2 likes this.