Quantcast
Channel: Questions in topic: "dll"
Viewing all articles
Browse latest Browse all 706

Reference class in normal c# script from within a (soon to be) dll script?

$
0
0
I'm about to compile my first dll script, but I have one line of code with a problem: It references a class that I want to maintain outside of the dll, as a dependency (if possible). I don't want to make that class a part of the dll because it's just a `FixedFrameCount` class that uses the community's `Singleton` class ([here][1]) as basis, and can (and should) be common to other scripts, to avoid duplicate code to users who may already have either `FixedFrameCount` or the community's `Singleton` in their project(s). I want to distribute those (`FixedFrameCount` and `Singleton`) as part of the asset (as dependencies), but not as part of the dll. But still be able to reference it inside the dll (currently giving me a `"does not exist in the current context"` error)... How can I do this? ---------- I am unsure if this will be useful in any way, but here is the relevant code: The line of code I'm referencing `FixedFrameCount` at looks like this: case FrameDelayMode.FixedUpdate: FixedFrameCount.Instance.count + delay.frameDelay; break; And here is the `FixedFrameCount.cs`'s code: public class FixedFrameCount : Singleton { protected FixedFrameCount() { }//Prevent non-singleton instantiation public int count { get; private set; } void Start() { count = 0; } void FixedUpdate() { count ++; } } [1]: http://wiki.unity3d.com/index.php/Singleton

Viewing all articles
Browse latest Browse all 706

Trending Articles