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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

System.SerializableAttribute conf Predefines.cs

Discussion in 'Windows' started by gear, Apr 10, 2014.

  1. gear

    gear

    Joined:
    May 11, 2009
    Posts:
    35
    Hello,
    I am using VS2012 and Windows SDK 8.0. Whenever I try to make a build I get following error

    I checked my code and don't have any SerializableAttribute class. I have unibill and prime32 plugin in project.

    Any solution for this. Its possible to tell compiler not use Predefines.cs?

    Thanks
    Sunil....
     
  2. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,672
    Ignore for now, this will be fixed in 4.5
     
  3. gear

    gear

    Joined:
    May 11, 2009
    Posts:
    35
    But it doesn't allow to make a build.

    Thanks
     
  4. gear

    gear

    Joined:
    May 11, 2009
    Posts:
    35
    Sorry, wrong info. Its failing because of something else.

    Thanks
     
  5. gear

    gear

    Joined:
    May 11, 2009
    Posts:
    35
    Hello,
    I was able to make a build but none of my scripts are running. In console it show error

    To test i created a scene with a cube and attach this script

    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4.  
    5. public class ObRotate : MonoBehaviour
    6. {
    7.      public Vector3 _Speed;
    8.    
    9.      // Update is called once per frame
    10.     void Update ()
    11.     {  
    12.         float dt = Time.deltaTime;
    13.         transform.Rotate (_Speed.x * dt, _Speed.y * dt, _Speed.z * dt);
    14.     }
    15. }
    16.  
    17.  
    I can see cube rotation in IDE, but on build cube is still. For this script Unity throw same serialization error. Unity also throw script name mismatch error

    Any help on this?

    Thanks
     
    Last edited: Apr 11, 2014
  6. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,642
    As for later error, your script file should be names ObRotate.cs
    The first one is probably because you have wrapper some member variable with #UNITY_EDITOR.
     
  7. gear

    gear

    Joined:
    May 11, 2009
    Posts:
    35
    As you can see the code there is nothing in #if UNITY_EDITOR. Script name is same as class. If i am not wrong it wont work in IDE too. Unity doenst allow to attach if file name and class name is not same.

    Thanks
     
  8. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,642
    Looks like something is messed up. Try to reimport project.
    You can also try to delete all folders with intermediate output and then open project with Unity editor again.
     
  9. gear

    gear

    Joined:
    May 11, 2009
    Posts:
    35
    Actually i did delete my Library folder for reimport but it didnt work. I dont know why i get Predefine.cs warning while making a build for this project. I setup a new project and it work fine without getting Predfined.cs warning.

    My current project is big and it has some third party plugins. Prime31 and Unibill. Not sure if that causing problem.

    Thanks
     
  10. gear

    gear

    Joined:
    May 11, 2009
    Posts:
    35
    Turn out problem with Unibill. Still need to dig more. Removing the references of Unibill/Src solve the serialization error. I still get Predefines.cs error. But game script work.

    Thanks