Search Unity

Spawn Entity Code. (MonoBehaviour)

Discussion in 'Project Tiny' started by gtk2k, Apr 26, 2021.

  1. gtk2k

    gtk2k

    Joined:
    Aug 13, 2014
    Posts:
    178
    Create a project by referring to the "Getting Started Guide"
    I wrote the code to spawn with reference to TinyKichen, but I get error CS0246: not found'MonoBehaviour'. How can I refer to MonoBehaviour?
     
  2. djsell

    djsell

    Joined:
    Aug 29, 2013
    Posts:
    77
    You can't at runtime. MonoBehaviour is only for use with conversion at build time. Create an asmdef for conversion code that is not referenced by your runtime asmdef.
     
  3. gtk2k

    gtk2k

    Joined:
    Aug 13, 2014
    Posts:
    178
    Thanx @djsell

    Yes, I get this error at compile time.
    asmdef has been defined.
     
  4. djsell

    djsell

    Joined:
    Aug 29, 2013
    Posts:
    77
    Maybe you are referencing the assembly from a runtime assembly, so it will still fail at compile time.
     
  5. GilCat

    GilCat

    Joined:
    Sep 21, 2013
    Posts:
    666
unityunity