void TestScriptFunc1() { try { int nV2 = FCLibHelper.fc_get_version(); print_error("fc_get_version() is " + nV2); bool bDebugMode = FCLibHelper.fc_is_debug_mode(); print_error("fc_is_debug_mode() is " + bDebugMode); } catch (Exception e) { print_error(e.ToString()); } try { Vector3 v = new Vector3(1, 2, 3); FCDll.PushCallParam(v); FCLibHelper.fc_call(0, "csharp2fc_set_vector3"); Vector4 v2 = new Vector4(22, 33, 44, 55); FCDll.PushCallParam(v2); FCLibHelper.fc_call(0, "csharp2fc_set_vector4"); string szTest = "测试字符串传参"; FCDll.PushCallParam(szTest); FCLibHelper.fc_call(0, "csharp2fc_set_string"); } catch (Exception e) { print_error(e.ToString()); } }
protected override void OnAfterLoadScriptData() { // 在加载完脚本字码码后,才执行脚本函数吧 Transform tfChild = transform.Find("Text"); UnityEngine.UI.Text text = tfChild.GetComponent <UnityEngine.UI.Text>(); FCDll.PushCallParam(text); //FCDll.PushCallObjectParam(text); FCLibHelper.fc_call(0, "HelloWord.SetText"); }
public void OnButtonClicked(string szName) { CreateScript(); // 延迟执行吧 if (m_nScriptInsPtr != 0) { FCDll.PushCallParam(szName); // 传点击的按钮的参数 FCLibHelper.fc_call(m_nScriptInsPtr, "OnButtonClicked"); } }
public void CallFunc(int arg0) { try { FCDll.PushCallParam(arg0); FCLibHelper.fc_call(m_nThisPtr, m_szFuncName); } catch (Exception e) { Debug.LogException(e); } }
public void CallFunc(int arg0, string arg1, Vector2 arg2) { try { FCDll.PushCallParam(arg0); FCDll.PushCallParam(arg1); FCDll.PushCallParam(ref arg2); FCLibHelper.fc_call(m_nThisPtr, m_szFuncName); } catch (Exception e) { Debug.LogException(e); } }
void Test() { TestExport ret = this; long v = FCGetObj.PushObj(TestExport.onPostRender); FCDll.PushCallParam(v); int[] buffer = new int[10]; unsafe { fixed(void *p = buffer) { } } //this.GetRefList(ref arg0); }