public static bool QuitClientAndLauncher()
 {
     XLog.GetLog <WindowsPluginToolImpl>().Error("Lybns was not run from Launcher");
     if (!WindowsPluginToolImpl.LauncherFileInfo.Exists)
     {
         XLog.GetLog <WindowsPluginToolImpl>().Error("could not find Launcher");
         return(false);
     }
     try
     {
         new Process
         {
             StartInfo =
             {
                 UseShellExecute = false,
                 FileName        = WindowsPluginToolImpl.LauncherFileInfo.FullName,
                 Arguments       = string.Empty
             },
             EnableRaisingEvents = true
         }.Start();
         XLog.GetLog <WindowsPluginToolImpl>().Debug("Launcher is running!");
         PluginTool.Singleton.HasAssuredToQuit = true;
         Application.Quit();
     }
     catch (Exception ex)
     {
         XLog.GetLog <WindowsPluginToolImpl>().Fatal(ex.ToString());
     }
     return(true);
 }
示例#2
0
 public void AddSystemInfo(string strText)
 {
     if (base.Prepared)
     {
         if (this.m_dicFlyTextManager.ContainsKey(enumFlyTextType.eFlyTextType_SystemInfo))
         {
             this.m_dicFlyTextManager[enumFlyTextType.eFlyTextType_SystemInfo].Add(strText, 0, 0);
         }
         XLog.GetLog <DlgFlyTextSysInfo>().Debug("AddSystemInfo:" + strText);
     }
 }
示例#3
0
 public override void Update()
 {
     base.Update();
     foreach (var current in this.m_dicFlyTextManager)
     {
         try
         {
             current.Value.Update();
         }
         catch (Exception e)
         {
             XLog.GetLog <DlgFlyTextSysInfo>().Fatal(e);
         }
     }
 }
示例#4
0
 /// <summary>
 /// 开始该动作
 /// </summary>
 public void Start()
 {
     if (!this.m_bStarted)
     {
         this.m_fStartTime = Time.time;
         this.m_bStarted   = true;
         try
         {
             this.Trigger();
         }
         catch (Exception ex)
         {
             XLog.GetLog <ActEvent>().Fatal(ex.ToString());
         }
     }
 }
示例#5
0
 static XLog()
 {
     XLog.s_logger = null;
     XLog.s_logger = XLog.GetLog <XLog>();
 }
示例#6
0
    /// <summary>
    /// 合并模型
    /// </summary>
    /// <param name="root"></param>
    /// <returns></returns>
    public static Transform CombineModel(Transform root)
    {
        float realtimeSinceStartup   = Time.realtimeSinceStartup;
        List <CombineInstance> list  = new List <CombineInstance>();
        List <Material>        list2 = new List <Material>();
        Material         material    = null;
        List <Transform> list3       = new List <Transform>();

        Transform[]      componentsInChildren = root.GetComponentsInChildren <Transform>();
        List <Texture2D> list4 = new List <Texture2D>();
        int num  = 0;
        int num2 = 0;
        int num3 = 0;
        List <Vector2[]> list5 = new List <Vector2[]>();

        SkinnedMeshRenderer[] componentsInChildren2 = root.GetComponentsInChildren <SkinnedMeshRenderer>();
        for (int i = 0; i < componentsInChildren2.Length; i++)
        {
            SkinnedMeshRenderer skinnedMeshRenderer = componentsInChildren2[i];
            if (material == null)
            {
                material = (UnityEngine.Object.Instantiate(skinnedMeshRenderer.sharedMaterial) as Material);
            }
            for (int j = 0; j < skinnedMeshRenderer.sharedMesh.subMeshCount; j++)
            {
                list.Add(new CombineInstance
                {
                    mesh         = skinnedMeshRenderer.sharedMesh,
                    subMeshIndex = j
                });
            }
            list5.Add(skinnedMeshRenderer.sharedMesh.uv);
            num3 += skinnedMeshRenderer.sharedMesh.uv.Length;
            if (skinnedMeshRenderer.material.mainTexture != null)
            {
                list4.Add(skinnedMeshRenderer.renderer.material.mainTexture as Texture2D);
                num  += skinnedMeshRenderer.renderer.material.mainTexture.width;
                num2 += skinnedMeshRenderer.renderer.material.mainTexture.height;
            }
            Transform[] bones = skinnedMeshRenderer.bones;
            for (int k = 0; k < bones.Length; k++)
            {
                Transform   transform = bones[k];
                Transform[] array     = componentsInChildren;
                for (int l = 0; l < array.Length; l++)
                {
                    Transform transform2 = array[l];
                    if (!(transform2.name != transform.name))
                    {
                        list3.Add(transform2);
                        break;
                    }
                }
            }
            UnityEngine.Object.Destroy(skinnedMeshRenderer.gameObject);
        }
        SkinnedMeshRenderer skinnedMeshRenderer2 = root.gameObject.GetComponent <SkinnedMeshRenderer>();

        if (!skinnedMeshRenderer2)
        {
            skinnedMeshRenderer2 = root.gameObject.AddComponent <SkinnedMeshRenderer>();
        }
        skinnedMeshRenderer2.sharedMesh = new Mesh();
        skinnedMeshRenderer2.sharedMesh.CombineMeshes(list.ToArray(), true, false);
        skinnedMeshRenderer2.bones    = list3.ToArray();
        skinnedMeshRenderer2.material = material;
        Texture2D texture2D;

        if (Application.isMobilePlatform)
        {
            texture2D = new Texture2D(1024, 1024, TextureFormat.PVRTC_RGBA4, false);
        }
        else
        {
            texture2D = new Texture2D(1024, 512, TextureFormat.DXT5, false);
        }
        Rect[]    array2 = texture2D.PackTextures(list4.ToArray(), 0);
        Vector2[] array3 = new Vector2[num3];
        int       num4   = 0;

        for (int m = 0; m < list5.Count; m++)
        {
            Vector2[] array4 = list5[m];
            for (int i = 0; i < array4.Length; i++)
            {
                Vector2 vector = array4[i];
                array3[num4].x = Mathf.Lerp(array2[m].xMin, array2[m].xMax, vector.x);
                array3[num4].y = Mathf.Lerp(array2[m].yMin, array2[m].yMax, vector.y);
                num4++;
            }
        }
        skinnedMeshRenderer2.material.mainTexture = texture2D;
        skinnedMeshRenderer2.sharedMesh.uv        = array3;
        XLog.GetLog <AvatarTool>().Debug(string.Concat(new object[]
        {
            root.name,
            "CombineModel takes : ",
            (Time.realtimeSinceStartup - realtimeSinceStartup) * 1000f,
            " ms"
        }));
        return(root);
    }