Have you added the DLL to the “Plugins” folder?
If so, is it a .NET library? What version of .NET was it compiled with?
To answer your second question: yes, it will probably work on mobile if it’s not platform specific.
If you can give some more details about the plugin/library and how the documentation says it should be used I can offer more help.
Hi Eric,
I have created a “Plugins” folder and I added the DLLs there (for the sake of good file management, I am told). Unity recognizes the DLL, which is written in .NET version 2, I believe. The Inspector seems to recognize the library, and shows a screen displaying the platform options.
There is no documentation for what I want to do with it, but I do have a snipit of code explaining how to access the library in C# per say. I will include that below.
The library is for an old product called CLIPS (C Language Integrated Production System)
CLIPS requires files to feed it information to run.
I need help figuring out how to get Unity to route these files into Unity/C# so I can feed them to CLIPS…
Here is the code I was shown that works with C# stand-alone. As you can see, it uses the disk structure to feed the data file into C#. I need a different way to do this fr the Unity project:
using System;
namespace GetMarriedOrStaySingle_AsCSharpApp
{
class Program
{
static void Main(string[] args)
{
CLIPSNet.Environment theEnv = new CLIPSNet.Environment();
theEnv.Load(@"..\..\..\SocratesKnowledgeBase.clp");
theEnv.Reset();
theEnv.Run(-1);
}
}
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Can you help me?
-Chief_Ed
Open it up in your C# IDE and you’ll see a Start() and an Update() method.
Start() will run once when the GameObject the script is attached to is loaded in the scene, so that’s where you want to put your code.
You may need to add a reference to the CLIPS library by adding a using statement at the top.
Now add a new empty GameObject to the scene and drag the script on top of it (or select the GameObject and add it in the Inspector as a component).
Now run the scene and the code will be executed.
Be sure to check out our tutorials to find your away around the editor.
I do not think I was clear in my original message. I apologize for the confusion.
Here is the actual code in my C# script:
For illustration purposes, my C# script is as follows:
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using CLIPSNet;
namespace TakeAByteSolutions.LISP.Unity
{
public class GetCLIPS : MonoBehaviour
{
// Use this for initialization
void Start () {
// Debug.Log("Getting Started");
}
// Try to open CLIPS from Unity
void OnDisable()
{
Debug.Log ("Disabled toolbox..."); //OK, you got here.
CLIPSNet.Environment theEnv = new CLIPSNet.Environment();
// theEnv.Load("basics01POC.clp");
// theEnv.Reset();
// theEnv.Run(-1);
Debug.Log("Step by step, row by row...");
}
void OnEnable()
{
Debug.Log ("Enabled toolbox...");
//
}
}
}
As you know, since this is in Unity, there isd no “Main” class. Also, for testing purposes,
I have this code attached to the “Disable” event of an object in the project called “Toolbox”.
What I now need is someone who has access to the CLIPS source code and can re-compile an asset that I need; the CLIPSLib.dll file.
Is this something you can do? If not my search continues!
Thank you for your attempts to help me. The effort is appreciated!