Thursday, April 23, 2015

Realtime Obj Importer Build to windows app store issue

now it works perfectly :D
i just get the real url from this function , then i use it inside my OBJ script 


public  async void ttt()
        {
            var uri = new System.Uri("ms-appx:///Assets/MaleLow.obj");
 
            var file = await Windows.Storage.StorageFile.GetFileFromApplicationUriAsync(uri);
            textBox.Text = file.Path;
        }
if (UnityPlayer.AppCallbacks.Instance.IsInitialized())
                        {
                                UnityPlayer.AppCallbacks.Instance.InvokeOnAppThread(new UnityPlayer.AppCallbackItem(() =>
                                {
                    Communications.SetCubeMaterialColor(r, g, b);
                    
                                }
                                ), false);
                        }
public sealed class Communications
        {
       
        
        
                public static void SetCubeMaterialColor(byte r, byte g, byte b)
                {
                        UnityEngine.GameObject go = UnityEngine.GameObject.Find("Cube");
                        UnityEngine.Material mat = go.GetComponent<XAMLConnection>().material;
                        mat.color = new UnityEngine.Color32(r, g, b, 255);
            UnityEngine.GameObject o = UnityEngine.GameObject.Find("GameObject");
            go.AddComponent<OBJ>().objPath = file.Path;
            
 
                }

No comments:

Post a Comment