mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 13:01:52 +00:00
Added Mono for C# scripting
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace GlitchyEngine
|
||||
{
|
||||
public class CSharpTesting
|
||||
{
|
||||
public float MyPublicFloatVar = 5.0f;
|
||||
|
||||
public CSharpTesting()
|
||||
{
|
||||
Console.WriteLine("Hallo von C#!");
|
||||
DoSomething();
|
||||
Console.WriteLine(Sample());
|
||||
}
|
||||
|
||||
[DllImport ("__Internal", EntryPoint="DoSomething")]
|
||||
static extern void DoSomething();
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
static extern string Sample();
|
||||
|
||||
public void PrintFloatVar()
|
||||
{
|
||||
Console.WriteLine("MyPublicFloatVar = {0:F}", MyPublicFloatVar);
|
||||
}
|
||||
|
||||
private float IncrementFloatVar(float value)
|
||||
{
|
||||
MyPublicFloatVar += value;
|
||||
|
||||
return MyPublicFloatVar;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user