Exemplo n.º 1
0
        static void Main(string[] args)
        {
            string textToDisplay = "text to display";

            Console.WriteLine($"Displaying from managed code: {textToDisplay}");

            NativeCaller nativeCaller = new NativeCaller(textToDisplay);

            nativeCaller.CallNativeCode();

            Console.ReadLine();
        }
Exemplo n.º 2
0
 public Model()
 {
     _modelModel = new NativeCaller();
 }
Exemplo n.º 3
0
    void OnGUI()
    {
        string MemoryUsage = (NativeCaller.MemoryUsage() / 1024f / 1024f).ToString("0.00");
        string debugInfo   = string.Format("FPS:{0}\nMemoryUsage:{1}\n", lastFPS, MemoryUsage);

        //Debug.Log(debugInfo);
        GUI.Label(new Rect(400, 300, 250, 200), debugInfo, textStyle);

        //		if (GUI.Button(new Rect(100, 500, 150, 50), "Log Texture Use")){
        //			log = true;
        //		}
#if ASSETS
        if (GUI.Button(new Rect(100, 200, 150, 50), "Log Bundle memory"))
        {
            string snapShot = AssetsMgr.Instance.GetBundleMemSnapshot();
            //Debug.Log("======GetBundleMemSnapshot: " + snapShot);
        }
#endif
//
////		if (GUI.Button(new Rect(250, 500, 150, 50), "Unload res")){
////			Resources.UnloadUnusedAssets();
////		}
//
        if (GUI.Button(new Rect(250, 400, 150, 50), "Test file"))
        {
            TestFileHandle();
            Resources.UnloadUnusedAssets();
        }
//
//		if (GUI.Button(new Rect(400, 500, 150, 50), "LoadPrefab")){
//			if(go != null)
//				Destroy(go);
////			AssetsMgr.Instance.LoadAsset<Texture2D>("t_UI_Atlas1", (obj, result)=>{
//////				go = GameObject.Instantiate<GameObject>( obj as GameObject);
////
////			}, this);
//			tex = Resources.Load<Texture2D>("t_UI_Atlas1");
//		}
//
//		if (GUI.Button(new Rect(550, 500, 150, 50), "UnLoadPrefab")){
//			if(go != null)
//				Destroy(go);
////			AssetsMgr.Instance.UnloadAsset("t_UI_Atlas1");
//			Resources.UnloadAsset(tex);
//			tex = null;
//			Resources.UnloadUnusedAssets();
//			GC.Collect();
//		}
        //		if (GUI.Button(new Rect(550, 500, 150, 50), "LoadMaterial")){
//
//			AssetsMgr.Instance.LoadAsset<GameObject>("tm1", (obj, result)=>{
//			}, this);
//		}

//		if (GUI.Button(new Rect(550, 100, 150, 50), "UnLoadMaterial")){
//		//	AssetsMgr.Instance.UnloadAsset("tm1");
//		}

//		if (GUI.Button(new Rect(250, 100, 150, 50), "LoadUI")){
//			if(ui != null)
//				Destroy(ui);
//			AssetsMgr.Instance.LoadAsset<GameObject>("UI_Resource", (obj, result)=>{
////				AssetsMgr.Instance.UnloadAsset("UI_Technology");
//				ui = GameObject.Instantiate<GameObject>( obj as GameObject);
//
//			}, this);
//		}
//
//		if (GUI.Button(new Rect(400, 100, 150, 50), "UnLoadUI")){
//			if(ui != null)
//				Destroy(ui);
////			DestroyImmediate(obj, true);
//			AssetsMgr.Instance.UnloadAsset("UI_Resource");
//		}


        /*		GUI.Label( new Rect( 100,300, 100,100), "quality: "+ QualitySettings.GetQualityLevel());
         * GUI.Label( new Rect( 100,400, 100,100), "AA: "+ QualitySettings.antiAliasing);
         *
         * if( GUI.Button(new Rect(100, 500, 100, 100), "+") )
         * {
         *      QualitySettings.SetQualityLevel( QualitySettings.GetQualityLevel() + 1 );
         * }
         *
         * if( GUI.Button(new Rect(200, 500, 100, 100), "-") )
         * {
         *      QualitySettings.SetQualityLevel( QualitySettings.GetQualityLevel() - 1 );
         * }*/
//
//		if( GUI.Button(new Rect(200, 500, 100, 100), "Switch ui") )
//		{
//			MainContainer.Instance.gameObject.SetActive(!MainContainer.Instance.gameObject.activeSelf);
//		}
    }