{"id":316370,"date":"2024-05-21T17:20:29","date_gmt":"2024-05-21T09:20:29","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/316370.html"},"modified":"2024-05-21T17:21:05","modified_gmt":"2024-05-21T09:21:05","slug":"visual-%e9%87%8c%e6%97%a0%e6%b3%95%e5%bc%95%e7%94%a8-using-poton-pun-%e7%9a%84%e5%8e%9f%e5%9b%a0%e6%9c%89%e5%93%aa%e4%ba%9b","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/316370.html","title":{"rendered":"visual \u91cc\u65e0\u6cd5\u5f15\u7528 using poton.pun \u7684\u539f\u56e0\u6709\u54ea\u4e9b"},"content":{"rendered":"<p style=\"text-align:center\"><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/26075642\/4fbea6c1-04bf-44c1-8590-e285fc896090.webp\" alt=\"visual \u91cc\u65e0\u6cd5\u5f15\u7528 using poton.pun \u7684\u539f\u56e0\u6709\u54ea\u4e9b\" \/><\/p>\n<p><p><strong>Visual Studio\u65e0\u6cd5\u5f15\u7528using Photon.PUN\u7684\u4e3b\u8981\u539f\u56e0\u53ef\u80fd\u5305\u62ec\u73af\u5883\u914d\u7f6e\u9519\u8bef\u3001Photon PUN SDK\u672a\u6b63\u786e\u5b89\u88c5\u3001\u547d\u540d\u7a7a\u95f4\u9519\u8bef\u6216\u6587\u4ef6\u635f\u574f\u3002<\/strong> \u5176\u4e2d\uff0c\u73af\u5883\u914d\u7f6e\u9519\u8bef\u662f\u6700\u5e38\u89c1\u7684\u95ee\u9898\u3002Visual Studio\u662f\u5f00\u53d1\u8005\u5e7f\u6cdb\u4f7f\u7528\u7684\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\uff0c\u63d0\u4f9b\u4e86\u7ba1\u7406\u9879\u76ee\u3001\u7f16\u7801\u3001\u8c03\u8bd5\u548c\u90e8\u7f72\u5e94\u7528\u7684\u5168\u5957\u5de5\u5177\u3002\u7136\u800c\uff0c\u5982\u679cIDE\u6ca1\u6709\u6b63\u786e\u914d\u7f6e\uff0c\u6216\u4e0eUnity\u7f16\u8f91\u5668\u7684\u96c6\u6210\u51fa\u73b0\u95ee\u9898\uff0c\u5c31\u53ef\u80fd\u51fa\u73b0\u65e0\u6cd5\u5f15\u7528\u7279\u5b9a\u547d\u540d\u7a7a\u95f4\u7684\u60c5\u51b5\u3002\u6b64\u5916\uff0c\u5982\u679cPhoton PUN\u7684\u8f6f\u4ef6\u5f00\u53d1\u5305\uff08SDK\uff09\u6ca1\u6709\u88ab\u6b63\u786e\u5bfc\u5165\u5230Unity\u9879\u76ee\u4e2d\uff0cVisual Studio\u4e5f\u4f1a\u65e0\u6cd5\u8bc6\u522b\u5230Photon\u547d\u540d\u7a7a\u95f4\u3002<\/p>\n<\/p>\n<p><p>\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u8be6\u7ec6\u63a2\u8ba8\u6bcf\u4e2a\u53ef\u80fd\u7684\u539f\u56e0\uff0c\u5e76\u63d0\u4f9b\u76f8\u5e94\u7684\u89e3\u51b3\u65b9\u6848\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u73af\u5883\u914d\u7f6e\u9519\u8bef<\/h3>\n<\/p>\n<p><p>\u5f53Visual Studio\u65e0\u6cd5\u5f15\u7528Photon.PUN\u65f6\uff0c\u9996\u5148\u5e94\u786e\u8ba4\u7684\u662f\u73af\u5883\u662f\u5426\u914d\u7f6e\u6b63\u786e\u3002<\/p>\n<\/p>\n<p><p><strong>1. \u68c0\u67e5Unity\u4e0eVisual Studio\u7684\u96c6\u6210<\/strong><\/p>\n<p>\u786e\u4fdd\u5728Unity\u7684Preferences\uff08\u6216Edit &gt; Preferences\uff09\u4e2d\uff0cVisual Studio\u88ab\u8bbe\u4e3a\u9ed8\u8ba4\u7684\u811a\u672c\u7f16\u8f91\u5668\u3002\u786e\u8ba4External Tools\u4e2dVisual Studio\u7684\u7248\u672c\u6b63\u786e\u65e0\u8bef\uff0c\u5e76\u4e14\u6709\u5b89\u88c5\u76f8\u5e94\u7684Unity\u5de5\u5177\u6269\u5c55\u3002<\/p>\n<\/p>\n<p><p><strong>2. \u786e\u4fdd\u9879\u76ee\u89e3\u51b3\u65b9\u6848\u540c\u6b65<\/strong><\/p>\n<p>\u6709\u65f6\uff0cUnity\u9879\u76ee\u7684\u811a\u672c\u66f4\u6539\u53ef\u80fd\u6ca1\u6709\u540c\u6b65\u5230Visual Studio\u9879\u76ee\u89e3\u51b3\u65b9\u6848\u4e2d\u3002\u8fd9\u53ef\u4ee5\u901a\u8fc7\u5728Unity\u7684Assets\u83dc\u5355\u9009\u62e9 &quot;Open C# Project&quot; \u6765\u5f3a\u5236\u540c\u6b65\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001Photon PUN SDK\u672a\u6b63\u786e\u5b89\u88c5<\/h3>\n<\/p>\n<p><p><strong>1. \u6b63\u786e\u5bfc\u5165Photon PUN<\/strong><\/p>\n<p>\u5982\u679cPhoton PUN\u7684SDK\u672a\u6b63\u786e\u5b89\u88c5\u5728Unity\u9879\u76ee\u4e2d\uff0c\u5c31\u65e0\u6cd5\u5728Visual Studio\u4e2d\u4f7f\u7528\u76f8\u5173\u7684\u547d\u540d\u7a7a\u95f4\u3002<strong>\u5b89\u88c5\u6b65\u9aa4\u901a\u5e38\u5305\u62ec\u4eceUnity Asset Store\u4e0b\u8f7d\u5e76\u5bfc\u5165Photon PUN\u5305\u5230\u9879\u76ee<\/strong> \u4e2d\u3002\u786e\u8ba4\u5bfc\u5165\u8fc7\u7a0b\u4e2d\u65e0\u9519\u8bef\u53d1\u751f\u3002<\/p>\n<\/p>\n<p><p><strong>2. \u68c0\u67e5Photon PUN\u5305\u7684\u5b8c\u6574\u6027<\/strong><\/p>\n<p>\u6709\u53ef\u80fd\u5728\u4e0b\u8f7d\u6216\u5bfc\u5165\u8fc7\u7a0b\u4e2d\uff0c\u90e8\u5206\u6587\u4ef6\u53ef\u80fd\u635f\u574f\u6216\u9057\u5931\u3002\u786e\u4fddPhoton PUN\u7684\u6587\u4ef6\u5939\u5305\u542b\u6240\u6709\u5fc5\u8981\u7684\u811a\u672c\u548c\u8d44\u6e90\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u547d\u540d\u7a7a\u95f4\u9519\u8bef<\/h3>\n<\/p>\n<p><p><strong>1. \u68c0\u67e5\u811a\u672c\u547d\u540d\u7a7a\u95f4<\/strong><\/p>\n<p>\u6709\u65f6\u5019\u95ee\u9898\u51fa\u5728\u811a\u672c\u6587\u4ef6\u672c\u8eab\u3002<strong>\u786e\u4fdd\u4f60\u5c1d\u8bd5\u4f7f\u7528\u7684\u811a\u672c\u5b58\u5728\u5e76\u4f4d\u4e8e\u6b63\u786e\u7684\u76ee\u5f55\u4e0b\uff0c\u540c\u65f6\u811a\u672c\u7684\u547d\u540d\u7a7a\u95f4\u58f0\u660e<\/strong> \u4f7f\u7528 <code>using Photon.PUN;<\/code> \u4e0d\u542b\u6709\u62fc\u5199\u9519\u8bef\u3002<\/p>\n<\/p>\n<p><p><strong>2. \u68c0\u67e5\u547d\u540d\u7a7a\u95f4\u7684\u5f15\u7528<\/strong><\/p>\n<p>\u5728\u811a\u672c\u4e2d\u6b63\u786e\u5f15\u7528\u547d\u540d\u7a7a\u95f4\u662f\u4f7f\u7528\u5b83\u7684\u524d\u63d0\u3002\u5982\u679c\u5220\u9664\u6216\u66f4\u6539\u4e86\u4efb\u4f55\u9ed8\u8ba4\u5f15\u7528\uff0c\u5305\u62ecPhoton.PUN\u547d\u540d\u7a7a\u95f4\uff0c\u5c31\u9700\u8981\u624b\u52a8\u5c06\u5176\u6dfb\u52a0\u56de\u6765\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u6587\u4ef6\u635f\u574f\u6216\u7f3a\u5931<\/h3>\n<\/p>\n<p><p><strong>1. \u68c0\u6d4b\u6587\u4ef6\u5b8c\u6574\u6027<\/strong><\/p>\n<p>\u5982\u679cPhoton PUN\u76f8\u5173\u6587\u4ef6\u635f\u574f\uff0c\u53ef\u80fd\u5c31\u4f1a\u5f71\u54cd\u5230Visual Studio\u4e2d\u7684\u5f15\u7528\u3002\u901a\u8fc7Unity\u7684Asset Store\u91cd\u65b0\u4e0b\u8f7d\u548c\u5bfc\u5165PUN\u5305\u53ef\u4ee5\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u3002<\/p>\n<\/p>\n<p><p><strong>2. \u6e05\u7406\u548c\u91cd\u5efa\u9879\u76ee<\/strong><\/p>\n<p>\u6709\u65f6\u5019\uff0c\u6e05\u7406\u9879\u76ee\u6587\u4ef6\u5e76\u4eceUnity\u91cd\u65b0\u751f\u6210Visual Studio\u9879\u76ee\u662f\u89e3\u51b3\u95ee\u9898\u7684\u6700\u4f73\u65b9\u6cd5\u3002\u5728Unity\u4e2d\u5220\u9664\u65e7\u7684PUN\u5305\uff0c\u91cd\u542fUnity\u5e76\u91cd\u65b0\u5bfc\u5165PUN\u5305\u53ef\u80fd\u6709\u52a9\u4e8e\u4fee\u590d\u6587\u4ef6\u7684\u5f15\u7528\u95ee\u9898\u3002<\/p>\n<\/p>\n<p><p><strong>\u603b\u4e4b\uff0c\u89e3\u51b3Visual Studio\u65e0\u6cd5\u5f15\u7528Photon.PUN\u7684\u95ee\u9898\u901a\u5e38\u6d89\u53ca\u5230\u68c0\u67e5\u5f00\u53d1\u73af\u5883\u7684\u914d\u7f6e\u3001\u786e\u4fddPhoton PUN\u5305\u88ab\u6b63\u786e\u5730\u5b89\u88c5\u548c\u5f15\u7528\u3001\u4ee5\u53ca\u786e\u8ba4\u6587\u4ef6\u7684\u5b8c\u6574\u6027\u548c\u6b63\u786e\u6027\u3002<\/strong> \u5982\u679c\u8fd9\u4e9b\u65b9\u6cd5\u4ecd\u7136\u65e0\u6cd5\u89e3\u51b3\u95ee\u9898\uff0c\u8003\u8651\u68c0\u67e5\u5f00\u53d1\u8005\u793e\u533a\u4e2d\u662f\u5426\u6709\u7c7b\u4f3c\u7684\u95ee\u9898\u88ab\u62a5\u544a\uff0c\u6216\u8005\u76f4\u63a5\u83b7\u53d6Photon\u7684\u5b98\u65b9\u6280\u672f\u652f\u6301\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p><strong>\u4e3a\u4ec0\u4e48\u5728Visual Studio\u4e2d\u65e0\u6cd5\u4f7f\u7528using Photon.Pun\u5f15\u7528\u7684\u539f\u56e0\u662f\u4ec0\u4e48\uff1f<\/strong><\/p>\n<ol>\n<li>\n<p><strong>\u7f3a\u5c11Photon\u5e93\u7684\u5f15\u7528<\/strong>\uff1a\u9996\u5148\uff0c\u8bf7\u786e\u4fdd\u5df2\u7ecf\u6b63\u786e\u5b89\u88c5Photon\u5f15\u64ce\uff0c\u5e76\u5728\u9879\u76ee\u4e2d\u6dfb\u52a0\u4e86\u6b63\u786e\u7684\u5f15\u7528\u3002\u5982\u679c\u7f3a\u5c11\u5f15\u7528\uff0c\u7f16\u8bd1\u5668\u5c06\u65e0\u6cd5\u627e\u5230Photon.Pun\u547d\u540d\u7a7a\u95f4\u4e2d\u5b9a\u4e49\u7684\u7c7b\u548c\u65b9\u6cd5\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u9879\u76ee\u914d\u7f6e\u95ee\u9898<\/strong>\uff1a\u6709\u65f6\u5019\uff0c\u9879\u76ee\u7684\u914d\u7f6e\u53ef\u80fd\u4f1a\u5bfc\u81f4\u65e0\u6cd5\u5f15\u7528Photon.Pun\u3002\u68c0\u67e5\u4e00\u4e0b\u9879\u76ee\u7684\u76ee\u6807\u6846\u67b6\u548c\u5e73\u53f0\u914d\u7f6e\u662f\u5426\u4e0ePhoton\u5f15\u64ce\u7684\u8981\u6c42\u76f8\u5339\u914d\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u547d\u540d\u7a7a\u95f4\u51b2\u7a81<\/strong>\uff1a\u5728\u4e00\u4e9b\u60c5\u51b5\u4e0b\uff0c\u53ef\u80fd\u5b58\u5728\u547d\u540d\u7a7a\u95f4\u51b2\u7a81\uff0c\u5bfc\u81f4\u7f16\u8bd1\u5668\u65e0\u6cd5\u6b63\u786e\u89e3\u6790\u4f7f\u7528Photon.Pun\u7684\u4ee3\u7801\u3002\u53ef\u4ee5\u5c1d\u8bd5\u4f7f\u7528\u5b8c\u5168\u9650\u5b9a\u540d\u6765\u5f15\u7528Photon.Pun\u4e2d\u7684\u7c7b\uff0c\u6216\u8005\u5728\u4ee3\u7801\u4e2d\u4f7f\u7528\u522b\u540d\u6765\u907f\u514d\u51b2\u7a81\u3002<\/p>\n<\/li>\n<\/ol>\n<p>\u603b\u4e4b\uff0c\u8981\u89e3\u51b3\u5728Visual Studio\u4e2d\u65e0\u6cd5\u5f15\u7528using Photon.Pun\u7684\u95ee\u9898\uff0c\u9700\u8981\u786e\u4fdd\u6b63\u786e\u914d\u7f6e\u9879\u76ee\u3001\u6dfb\u52a0\u6b63\u786e\u7684\u5f15\u7528\uff0c\u5e76\u907f\u514d\u547d\u540d\u7a7a\u95f4\u51b2\u7a81\u3002\u5982\u679c\u95ee\u9898\u4ecd\u7136\u5b58\u5728\uff0c\u8bf7\u53c2\u8003Photon\u5b98\u65b9\u6587\u6863\u6216\u793e\u533a\u5bfb\u6c42\u5e2e\u52a9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Visual Studio\u65e0\u6cd5\u5f15\u7528using Photon.PUN\u7684\u4e3b\u8981\u539f\u56e0\u53ef\u80fd\u5305\u62ec\u73af\u5883\u914d\u7f6e\u9519\u8bef\u3001Photon [&hellip;]","protected":false},"author":3,"featured_media":316411,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/316370"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=316370"}],"version-history":[{"count":0,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/316370\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/316411"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=316370"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=316370"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=316370"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}