2

I have this in c# (Gameobject is from unity3d)

namespace DLLTest
{
    public class buttong : MonoBehaviour
    {

        public GameObject BButtn([ParamDictionary] IDictionary kwargs)

This in the python init:

engine.Runtime.LoadAssembly(System.Reflection.Assembly.GetAssembly(typeof(DLLTest.buttong)));

And this in Python:

from DLLTest.buttong import BButtn
def BButton(**kwargs):
    BButtn(kwargs)

And i keep getting

TypeError: expected buttong, got dict

When i call it from c# it only wants the dictionary (i think), but from python it demands 2 Arguments a buttong type extra, i wonder why and how to supply a buttong type.

2
  • I'm not sure... but could it be you need to add self ? Commented Sep 18, 2015 at 13:18
  • May you add a line of code where you think i should try it. I am not so well with c# since i only use it as interface. Commented Sep 18, 2015 at 13:20

1 Answer 1

1

you method BButtn is not static. so you need to call it with an instance of buttong (or make it static)

try doing

from DLLTest import buttong
def BButton(**kwargs):
    b= buttong()
    b.BButtn(kwargs)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.