Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. We are looking for feedback on the experimental Unity Safe Mode which is aiming to help you resolve compilation errors faster during project startup.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Used before declaration.

Discussion in 'Project Tiny' started by brokole, Jan 10, 2019.

  1. brokole

    brokole

    Joined:
    Mar 21, 2018
    Posts:
    11
    Screenshot_3.jpg Screenshot_4.jpg Screenshot_2.jpg So i have the following problem.

    TypeScriptError: Class 'PlayerInputSystem' used before its declaration.
    Scripting error (at Assets/Basketball/Scripts/Player/PlayerMovementSystem.ts:3)
    UnityEngine.Debug:LogException(Exception, Object)
    Unity.Tiny.TinyScriptUtility:LogDiagnostics(ScriptMetadata) (at Library/PackageCache/com.unity.tiny@0.13.4-preview/Editor/Scripting/TinyScriptUtility.cs:323)
    Unity.Tiny.TinyBuildUtilities:CompileTypeScript(FileInfo, FileInfo) (at Library/PackageCache/com.unity.tiny@0.13.4-preview/Editor/Export/TinyBuildUtilities.cs:410)
    Unity.Tiny.TinyScriptingManager:CompileScripts(TinyBuildOptions) (at Library/PackageCache/com.unity.tiny@0.13.4-preview/Editor/Context/TinyScriptingManager.cs:58)
    Unity.Tiny.TinyBuildUtilities:CompileScripts(TinyBuildOptions) (at Library/PackageCache/com.unity.tiny@0.13.4-preview/Editor/Export/TinyBuildUtilities.cs:430)
    Unity.Tiny.TinyBuildUtilities:CompileScripts() (at Library/PackageCache/com.unity.tiny@0.13.4-preview/Editor/Export/TinyBuildUtilities.cs:423)
    Unity.Tiny.PostProcessor:OnPostprocessAllAssets(String[], String[], String[], String[]) (at Library/PackageCache/com.unity.tiny@0.13.4-preview/Editor/Scripting/TinyScriptUtility.cs:226)
    UnityEditor.AssetPostprocessingInternal:postprocessAllAssets(String[], String[], String[], String[], String[])

    But iam doing the following.

    //<reference path="PLayerInputSystem.ts" />
    namespace game {
    @ut.executeAfter(game.PlayerInputSystem)

    ///<reference path="PlayerMovementSystem.ts" />
    namespace game {
    @ut.executeBefore(game.PlayerMovementSystem)

    Idon't understand what iam doing wrong. If there is somebody that can explain it that would be great becuase iam lost. Thank you in advance. Screenshot_2.jpg View attachment 356350 View attachment 356353
     
    Last edited: Jan 10, 2019
  2. etienne_unity

    etienne_unity

    Unity Technologies

    Joined:
    Aug 31, 2017
    Posts:
    59
    You have a cyclic reference. Remove the executeBefore scheduling constraint, as it mirrors the executeAfter constraint on the PlayerMovementSystem (redundant), and it should solve this.
     
  3. brokole

    brokole

    Joined:
    Mar 21, 2018
    Posts:
    11
    thank you
     
unityunity