A newby plugin question

Hi There,

I want to write a very simple plugin in C# .
I started with creating a C# Class Library and wrote this :

using System;

public class Foo
{

	float FooPluginFunction(){ return 5.0F}

}

and after compiling, I have used the same script as in the manual. But it says :
entrypointnotfoundexception : FooPluginFunction

What should I do?

Thanks in advance

The plug-in system is to allow Unity to call code written in C/C++ from an external library - you don’t need to use it to add code in C#. The example you found is actually supposed to be written in C rather than C# - it is slightly confusing because the code is exactly the same in both languages! If you’ve added the DllImport attribute to the function, then this will cause the “entry point not found” exception.

You could either remove the DllImport attribute and just write your code in C# or else follow the instructions for building a C library and add that to your project.

Thank you for reply, But I want to use System.Diagnostics.GetProcessByName(“foo”) and it doesn’t work in unity c# script. Can i use that in unity script?