Quantcast
Channel: Questions in topic: "error message"
Viewing all articles
Browse latest Browse all 2891

cant add script component, because the script class cannot be found

$
0
0
my unity script is crashing when trying to run. im trying to access .dll files since i use c++ code and the script is suppossed to call these. the code does not give any errors but when running i get this message "cant add script component, because the script class cannot be found" this is my code, can anyone see why it refuses to run using UnityEngine; using System.Collections; using System.Runtime.InteropServices; using System.IO; public class UseDll : MonoBehaviour { // Straight From the c++ Dll (unmanaged) [DllImport("SpheroDefender15338", EntryPoint = "TestDivide")] public static extern float StraightFromDllTestDivide(float a, float b); // Use this for initialization void Start() { /* */ // Call the C# DLL SharpMultiply function float multiplyResult = TestCSharpLibrary.TestCSharpLibrary.SharpMultiply(3, 5); // Call the C# DLL TestDivide function which relies on the C++ DLL for this functionality float divideResult = TestCSharpLibrary.TestCSharpLibrary.TestDivide(15, 3); float straightFromDllDivideResult = StraightFromDllTestDivide(20, 5); // Print it out to the console Debug.Log(multiplyResult); Debug.Log(divideResult); Debug.Log(straightFromDllDivideResult); // Write the result into a file, so we can even see it working in a build using (StreamWriter writer = new StreamWriter("debug.txt", true)) { writer.WriteLine(multiplyResult); writer.WriteLine(divideResult); writer.WriteLine(straightFromDllDivideResult); } /* */ } // Update is called once per frame void Update() { } }

Viewing all articles
Browse latest Browse all 2891

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>