{"id":92583,"date":"2026-08-10T17:24:50","date_gmt":"2026-08-10T09:24:50","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/92583.html"},"modified":"2026-08-10T17:24:50","modified_gmt":"2026-08-10T09:24:50","slug":"02-unity%e6%b8%b8%e6%88%8f%e5%bc%80%e5%8f%91%e5%88%9d%e5%ad%a6%e8%80%85%e7%9a%84%e7%ac%ac%e4%b8%80%e4%b8%aa%e7%bb%83%e6%89%8bdemo-%e5%9b%9b%e5%a4%a7%e6%95%8c%e4%ba%ba%e7%b3%bb","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/92583.html","title":{"rendered":"02.Unity\u6e38\u620f\u5f00\u53d1\u521d\u5b66\u8005\u7684\u7b2c\u4e00\u4e2a\u7ec3\u624bDemo\u2014\u2014\u56db\u5927\u654c\u4eba\u7cfb\u7edf\u8bbe\u8ba1"},"content":{"rendered":"<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\"><span style=\"color:#0d0016\">\u654c\u4eba\u7cfb\u7edf&#xff1a;\u5de1\u903b\u8005\u3001\u51b2\u649e\u91ce\u732a\u4e0e\u8ffd\u51fb\u9ec4\u8702<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\"><span style=\"color:#0d0016\">Echo Orb 2D \u4fef\u89c6\u89d2\u52a8\u4f5c\u89e3\u8c1c\u6e38\u620f \u5f00\u53d1\u65e5\u5fd7\u7b2c 2 \u7bc7<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\"><span style=\"color:#0d0016\">\u4f5c\u8005&#xff1a;\u9752\u7af9\u4e39\u67ab | \u5357\u4eac\u90ae\u7535\u5927\u5b66 \u6570\u5b57\u5a92\u4f53\u6280\u672f | 2026\u5e748\u6708<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\">\n<p style=\"text-align:justify\"><span style=\"color:#0d0016\">Tips&#xff1a;\u8fd9\u662f\u672c\u7cfb\u5217\u7684\u7b2c\u4e8c\u7bc7\u6b63\u5f0f\u6280\u672f\u65e5\u5fd7\u5566&#xff0c;\u8fd9\u4e00\u6b21\u4e3b\u8981\u7684\u5185\u5bb9\u6d89\u53ca\u56db\u79cd\u654c\u4eba\u7684\u8bbe\u8ba1\u4e0e\u5b9e\u73b0\u3002\u540c\u6837\u7684&#xff0c;\u672c\u7cfb\u5217\u4ecb\u7ecd\u7684\u662f\u535a\u4e3b\u4e2a\u4eba\u7684\u5b66\u4e60\u8def\u5f84\u4ee5\u53ca\u6280\u672f\u8bb0\u5f55&#xff0c;\u5305\u62ec\u4e86\u535a\u4e3b\u5bf9\u4e00\u4e9b\u95ee\u9898\u7684\u89e3\u51b3\u65b9\u6cd5&#xff0c;\u5e0c\u671b\u5bf9\u521d\u5b66\u8005\u6709\u4e00\u5b9a\u7684\u5e2e\u52a9\u3002\u672c\u4eba\u53ea\u662f\u4e00\u4e2a\u76ee\u524d\u5728\u505a\u4e00\u4e9b\u81ea\u8ba4\u4e3a\u6709\u610f\u4e49\u7684\u5b66\u4e60\u7684\u5c0f\u767d&#xff0c;\u6b64\u7bc7\u53ea\u662f\u6211\u4e2a\u4eba\u5728\u5b66\u4e60\u7b2c\u4e00\u4e2a\u7ec3\u624b\u9879\u76eeEcho Orb&#xff08;\u6b64\u4e3a\u535a\u4e3b\u7684\u9879\u76ee\u540d&#xff0c;\u5927\u5bb6\u9879\u76ee\u547d\u540d\u65f6\u81ea\u5df1\u53d6\u540d\u5373\u53ef&#xff09;\u65f6\u7684\u4e00\u4e9b\u5f00\u53d1\u8fc7\u7a0b\u548c\u89c2\u70b9&#xff0c;\u82e5\u6709\u4e0d\u5bf9\u6216\u4e0d\u8db3\u4e4b\u5904\u6073\u8bf7\u5404\u4f4d\u5927\u4f6c\u6307\u70b9\u8ff7\u6d25&#xff01;<\/span><br \/>\n\u00a0<\/p>\n<hr \/>\n<h2><span style=\"color:#0d0016\">\u4e00\u3001\u8def\u7ebf&#xff1a;\u5148\u4ece\u9776\u5b50\u518d\u5230\u5404\u7c7b\u654c\u4eba<\/span><\/h2>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u770b\u4e86\u535a\u4e3b\u4e4b\u524d\u4e24\u7bc7\u7684\u65e5\u5fd7\u7684\u8bfb\u8005\u670b\u53cb\u4eec\u90fd\u77e5\u9053&#xff0c;\u6ca1\u6709\u7f8e\u672f\u8d44\u6e90\u7684\u5730\u65b9\u5148\u7528\u7b80\u5355\u66ff\u6362\u6cd5&#xff1a;\u5148\u5c06\u5176\u57fa\u672c\u529f\u80fd\u505a\u597d&#xff0c;\u4e4b\u540e\u518d\u53e6\u627e\u5fc3\u4eea\u7684\u7f8e\u672f\u8d44\u6e90\u3002\u4f46\u5728\u8bbe\u8ba1\u5236\u4f5c\u57fa\u672c\u529f\u80fd\u65f6&#xff0c;\u5f3a\u70c8\u5efa\u8bae\u5927\u5bb6\u5728\u4e00\u4e2a\u6d4b\u8bd5\u573a\u5730\u8fdb\u884c&#xff08;\u6d4b\u8bd5\u573a\u5730\u662f\u5728Scene\u4e2d\u65b0\u5efa\u7684\u4e00\u4e2a\u4e13\u95e8\u7528\u4e8e\u8bbe\u8ba1\u4e0e\u6d4b\u8bd5\u67d0\u4e00\u6a21\u5757\u7684\u573a\u666f&#xff09;&#xff0c;\u8fd9\u6837\u53ef\u4ee5\u5207\u65ad\u4e0e\u7279\u5b9a\u573a\u666f\u7684\u8054\u7cfb&#xff0c;\u4ece\u800c\u4f7f\u505a\u597d\u540e\u9002\u7528\u4e8e\u6240\u6709\u573a\u666f\u3002<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u535a\u4e3b\u5728\u505a\u5b8c\u5b50\u5f39\u5f39\u5c04\u7cfb\u7edf\u540e&#xff0c;\u76ee\u524d\u6d4b\u8bd5\u623f\u95f4\u6709\u7684\u53ea\u662f\u4e00\u4e2a\u6807\u5fd7\u4e86\u65b9\u5411\u7684\u767d\u5706\u70b9\u3001\u4e00\u9897\u5f39\u6765\u5f39\u53bb\u7684\u9752\u8272\u5149\u73e0\u3001\u56db\u5835\u7070\u5899\u3002\u8fd9\u65f6\u5019\u6211\u5c31\u5f00\u59cb\u4e86\u654c\u4eba\u6a21\u5757\u7684\u5236\u4f5c&#xff1a;<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u6700\u521d\u505a\u4e86\u4e00\u4e2a\u84dd\u8272\u65b9\u5757&#xff0c;\u4f5c\u4e3a\u6700\u57fa\u7840\u7684\u6d4b\u8bd5\u654c\u4ebaTarget\u3002\u5b83\u53ea\u662f\u5de6\u53f3\u6765\u56de\u8d70&#xff0c;\u78b0\u5230\u5b50\u5f39\u5c31\u6d88\u5931\u3002\u540e\u6765\u8fd9\u4e2a\u9776\u5b50\u6539\u540d\u53eb\u201c\u5de1\u903b\u8005\u201d&#xff08;Patrol&#xff09;&#xff0c;\u6210\u4e86 Echo Orb \u7684\u7b2c\u4e00\u79cd\u6b63\u5f0f\u654c\u4eba\u3002\u5728\u201c\u5de1\u903b\u8005\u201d\u7684\u5e95\u5c42\u4ee3\u7801\u90fd\u8bbe\u8ba1\u597d\u4e86\u540e&#xff0c;\u6211\u7528\u9009\u597d\u7684\u7f8e\u672f\u8d44\u6e90\u66ff\u6362\u4e86\u539f\u672c\u7684\u51e0\u4f55\u65b9\u5757&#xff0c;\u53ea\u8c03\u8282\u4e86\u4e00\u4e0b\u78b0\u649e\u4f53\u79ef\u540e&#xff0c;\u8fd9\u4e2a\u539f\u672c\u53ea\u662f\u4e00\u4e2a\u51e0\u4f55\u4f53\u7684\u201c\u5de1\u903b\u8005\u201d\u6447\u8eab\u4e00\u53d8&#xff0c;\u53d8\u6210\u4e86\u4e00\u4e2a\u53ef\u7231\u7684\u53f2\u83b1\u59c6\u602a\u7269&#xff08;\u867d\u7136\u73b0\u5728\u53ea\u662f\u4e2a\u9759\u6b62\u7684\u56fe\u7247\u2026\u2026&#xff0c;\u4e4b\u540e\u535a\u4e3b\u4f1a\u4ecb\u7ecd\u52a8\u753b\u7684\u63d2\u5165\u54d2&#xff09; \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u5927\u5bb6\u5728\u8bbe\u8ba1\u654c\u4eba\u7684\u8fc7\u7a0b\u4e2d&#xff0c;\u654c\u4eba\u7684\u8fed\u4ee3\u8fc7\u7a0b\u6070\u662f\u7406\u89e3 Unity \u7269\u7406\u7cfb\u7edf\u6700\u5408\u9002\u7684\u4e00\u6bb5\u65f6\u95f4&#xff01;\u53ef\u4ee5\u5728\u8bbe\u8ba1\u7684\u8fc7\u7a0b\u4e2d\u9010\u6e10\u4f53\u4f1a\u5982Kinematic \u548c Dynamic \u7684\u533a\u522b\u3001\u5c04\u7ebf\u68c0\u6d4b\u7684\u504f\u79fb\u3001\u78b0\u649e\u4f53\u4e0e Trigger \u7684\u914d\u5408\u7b49\u3002\u63a5\u4e0b\u6765\u535a\u4e3b\u4e5f\u4f1a\u5728\u4e0b\u6587\u5bf9\u8fd9\u4e9b\u8fc7\u7a0b\u8fdb\u884c\u4ecb\u7ecd&#xff0c;\u5e0c\u671b\u8fd9\u7bc7\u8bb0\u5f55\u80fd\u5e2e\u4f60\u5728\u81ea\u5df1\u7684\u9879\u76ee\u91cc\u5c11\u8d70\u4e00\u4e9b\u5f2f\u8def\u5440\u3002<\/span><\/p>\n<hr \/>\n<h2><span style=\"color:#0d0016\">\u4e8c\u3001\u5de1\u903b\u8005&#xff1a;\u6700\u7b80\u5355\u7684\u654c\u4eba&#xff0c;\u6700\u6298\u817e\u7684\u79fb\u52a8\u65b9\u5f0f<\/span><\/h2>\n<h3><span style=\"color:#0d0016\">2.1 \u57fa\u672c\u903b\u8f91<\/span><\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u5de1\u903b\u8005 &#061; \u5728\u4e24\u4e2a\u7aef\u70b9\u4e4b\u95f4\u6765\u56de\u8d70\u52a8\u3002\u4ee3\u7801\u975e\u5e38\u7b80\u5355&#xff0c;\u6838\u5fc3\u5c31\u51e0\u884c&#xff1a;<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">void FixedUpdate()<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">{<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0Vector2 newPos &#061; Vector2.MoveTowards(rb.position, target, speed * Time.fixedDeltaTime);<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0rb.MovePosition(newPos);<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0if (Vector2.Distance(rb.position, target) &lt; 0.15f)<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0target &#061; (target &#061;&#061; pointA) ? pointB : pointA;<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">}<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u4e24\u4e2a\u5173\u952e\u70b9\u7684\u7406\u89e3&#xff1a;<\/span><\/p>\n<ul>\n<li><span style=\"color:#0d0016\">MovePosition \u800c\u975e\u76f4\u63a5\u6539 transform.position\u2014\u2014\u524d\u8005\u901a\u77e5\u7269\u7406\u5f15\u64ce&#034;\u6211\u8981\u52a8\u4e86&#xff0c;\u5e2e\u6211\u5904\u7406\u78b0\u649e&#034;&#xff0c;\u540e\u8005\u662f\u751f\u62c9\u786c\u62fd&#xff0c;\u78b0\u649e\u68c0\u6d4b\u53ef\u80fd\u4f1a\u6f0f<\/span><\/li>\n<li><span style=\"color:#0d0016\">FixedUpdate \u800c\u975e Update\u2014\u2014\u7269\u7406\u79fb\u52a8\u653e\u5728\u7269\u7406\u5e27\u91cc\u6267\u884c&#xff0c;\u4fdd\u6301\u901f\u5ea6\u5747\u5300\u7a33\u5b9a&#xff0c;\u548c\u5e27\u7387\u8131\u94a9<\/span><\/li>\n<\/ul>\n<h3><span style=\"color:#0d0016\">2.2 \u8e29\u5751&#xff1a;Kinematic \u548c Dynamic&#xff0c;\u5230\u5e95\u9009\u54ea\u4e2a&#xff1f;<\/span><\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u7b2c\u4e00\u6b21\u8dd1\u5de1\u903b\u8005\u7684\u65f6\u5019&#xff0c;\u5b83\u76f4\u76f4\u5730\u5f80\u53f3\u8d70&#xff0c;\u78b0\u5230\u5899\u58c1\u76f4\u63a5\u5361\u4f4f&#xff0c;\u4e0d\u56de\u5934\u4e86\u3002<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u539f\u56e0\u662f\u7528\u4e86 Kinematic \u521a\u4f53\u3002Kinematic \u649e\u4e0a Static \u7269\u4f53&#xff08;\u5899\u58c1&#xff09;\u4e0d\u4f1a\u89e6\u53d1\u78b0\u649e\u56de\u8c03\u2014\u2014\u8fd9\u662f Unity \u7684\u9ed8\u8ba4\u8bbe\u8ba1&#xff1a;Kinematic \u5c31\u662f&#034;\u4ee3\u7801\u8bf4\u4e86\u7b97&#xff0c;\u7269\u7406\u522b\u7ba1\u6211&#034;\u3002\u4ee3\u7801\u8ba9\u5b83\u53bb X&#061;8&#xff0c;\u5b83\u5c31\u95f7\u5934\u53bb&#xff0c;\u5899\u6321\u4e0d\u4f4f&#xff0c;\u4f46\u4e5f\u4e0d\u4f1a\u6709\u56de\u8c03\u544a\u8bc9\u4f60\u5b83\u649e\u5899\u4e86\u3002<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u535a\u4e3b\u6362\u6210Dynamic\u540e&#xff0c;\u5de1\u903b\u8005\u88ab\u73a9\u5bb6\u78b0\u4e00\u4e0b\u5c31\u98de\u51fa\u53bb&#xff0c;\u5b50\u5f39\u6253\u5230\u4e5f\u8ddf\u7740\u5f39\u5f00&#xff0c;\u573a\u9762\u4e00\u5ea6\u5f88\u6df7\u4e71&#xff0c;\u56e0\u4e3a\u5b83\u8d28\u91cf\u592a\u5c0f\u4e86\u3002<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u6700\u7ec8\u8bbe\u8ba1\u4e3aDynamic &#043; \u5927\u8d28\u91cf&#xff08;mass&#061;100&#xff09;&#043; \u51bb\u7ed3\u65cb\u8f6c&#xff08;Freeze Z&#xff09;\u00a0&#043; \u91cd\u529b\u5173\u6389&#xff08;Gravity&#061;0&#xff09;\u00a0&#043; \u7528 MovePosition \u79fb\u52a8\u3002<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">rb.bodyType &#061; RigidbodyType2D.Dynamic;<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">rb.gravityScale &#061; 0f;<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">rb.constraints &#061; RigidbodyConstraints2D.FreezeRotation;<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">rb.mass &#061; 100f;<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">rb.linearDamping &#061; 0f;<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u8fd9\u6837\u4e00\u4e3e\u591a\u5f97&#xff1a;<\/span><\/p>\n<ul>\n<li><span style=\"color:#0d0016\">\u7269\u7406\u4e0a\u80fd\u6321\u4f4f\u73a9\u5bb6&#xff08;Dynamic \u548c Dynamic \u4e4b\u95f4\u4f1a\u78b0\u649e&#xff09;<\/span><\/li>\n<li><span style=\"color:#0d0016\">\u4e0d\u4f1a\u88ab\u63a8\u98de&#xff08;mass&#061;100&#xff0c;\u76f8\u5f53\u4e8e\u73a9\u5bb6\u5728\u63a8\u4e00\u5835\u5899&#xff09;<\/span><\/li>\n<li><span style=\"color:#0d0016\">\u78b0\u5899\u6709\u56de\u8c03&#xff08;Dynamic \u78b0 Static \u89e6\u53d1 OnCollisionEnter2D&#xff09;<\/span><\/li>\n<li><span style=\"color:#0d0016\">\u5b50\u5f39\u80fd\u6b63\u5e38\u547d\u4e2d&#xff08;Dynamic \u78b0 Dynamic \u4e5f\u6709\u56de\u8c03&#xff09;<\/span><\/li>\n<\/ul>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u5927\u5bb6\u5982\u679c\u60f3\u8ba9\u7269\u4f53\u81ea\u5df1\u8d70\u6765\u8d70\u53bb\u4f46\u8fd8\u8981\u80fd\u8ddf\u522b\u7684\u4e1c\u897f\u78b0\u649e\u2014\u2014Dynamic &#043; \u5927\u8d28\u91cf &#043; MovePosition \u662f\u6700\u7701\u5fc3\u7684\u7ec4\u5408\u3002\u5927\u5bb6\u53ef\u4ee5\u53bb\u8bd5\u4e00\u8bd5\u5440\u3002<\/span><\/p>\n<h3><span style=\"color:#0d0016\">2.3 \u53d7\u51fb\u53cd\u9988&#xff1a;\u6253\u4e2d\u4e86\u5c31\u8981\u6709\u53cd\u5e94<\/span><\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u540e\u6765\u52a0\u4e86\u8840\u91cf\u7cfb\u7edf&#xff0c;\u5de1\u903b\u8005\u78b0\u5230\u5b50\u5f39\u4e0d\u662f\u76f4\u63a5\u6d88\u5931&#xff0c;\u800c\u662f\u8d70 TakeDamage\u3002\u6263\u8840\u7684\u540c\u65f6\u95ea\u7ea2 0.1 \u79d2\u518d\u6062\u590d&#xff1a;<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">IEnumerator FlashRed()<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">{<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0if (sr &#061;&#061; null) yield break;<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0sr.color &#061; Color.red;<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0yield return new WaitForSeconds(0.1f);<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0sr.color &#061; originalColor;<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">}<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u88ab\u6253\u4e86\u95ea\u4e00\u4e0b\u7ea2&#xff0c;\u73a9\u5bb6\u7acb\u523b\u77e5\u9053&#034;\u6253\u4e2d\u4e86&#034;\u3002\u8fd9\u4e2a\u4e1c\u897f\u867d\u7136\u5c0f&#xff0c;\u5bf9\u4f53\u9a8c\u975e\u5e38\u91cd\u8981&#xff0c;\u867d\u8bf4\u6709\u70b9\u7b80\u964b&#xff0c;\u4f46\u53ef\u4ee5\u4f53\u73b0\u51fa\u6253\u51fb\u611f\u4e86\u3002<\/span><\/p>\n<h3><span style=\"color:#0d0016\">2.4 \u5c0f\u5751&#xff1a;\u654c\u4eba\u628a\u73a9\u5bb6\u6324\u6b7b\u5728\u5899\u89d2\u4e86<\/span><\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u5de1\u903b\u8005\u7528 Dynamic \u6321\u4eba\u662f\u597d\u7684&#xff0c;\u4f46\u51fa\u4e86\u65b0\u95ee\u9898&#xff1a;\u73a9\u5bb6\u88ab\u654c\u4eba\u63a8\u5230\u5899\u89d2\u65f6&#xff0c;\u5361\u5728\u654c\u4eba\u548c\u5899\u58c1\u4e4b\u95f4\u52a8\u4e0d\u4e86&#xff0c;\u53ea\u80fd\u7b49\u6b7b\u3002\u5f88\u618b\u5c48\u3002<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u4fee\u6cd5&#xff1a;\u654c\u4eba\u78b0\u5230\u73a9\u5bb6\u65f6&#xff0c;\u7528 RaycastAll \u68c0\u6d4b\u73a9\u5bb6\u80cc\u540e\u6709\u6ca1\u6709\u5899\u3002\u6709\u2192\u654c\u4eba\u56de\u5934&#xff0c;\u4e0d\u518d\u5f80\u524d\u6324\u3002<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">void OnCollisionEnter2D(Collision2D other)<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">{<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0if (other.CompareTag(&#034;Player&#034;))<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0{<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Vector2 pushDir &#061; (player.transform.position &#8211; rb.position).normalized;<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0RaycastHit2D[] hits &#061; Physics2D.RaycastAll(player.transform.position, pushDir, 1.5f);<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0foreach (var h in hits)<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if (!h.collider.CompareTag(&#034;Player&#034;) &amp;&amp; !h.collider.CompareTag(&#034;Enemy&#034;))<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0target &#061; (target &#061;&#061; pointA) ? pointB : pointA; \/\/ \u56de\u5934&#xff01;<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0break;<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0}<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">}<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u4e3a\u4ec0\u4e48\u7528 RaycastAll \u800c\u4e0d\u662f Raycast&#xff1f;\u56e0\u4e3a\u666e\u901a Raycast \u6253\u5230\u7b2c\u4e00\u4e2a\u4e1c\u897f\u5c31\u505c\u4e86\u2014\u2014\u5927\u6982\u7387\u662f\u73a9\u5bb6\u81ea\u5df1\u3002RaycastAll \u80fd\u7a7f\u900f\u591a\u5c42&#xff0c;\u80fd&#034;\u770b\u7a7f&#034;\u73a9\u5bb6\u627e\u5230\u80cc\u540e\u7684\u5899\u3002<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u8fd9\u65b9\u9762\u7684\u95ee\u9898\u662f\u5f88\u591a\u65b0\u624b\u90fd\u4f1a\u78b0\u5230\u7684&#xff01;\u4e0d\u4ec5\u4ec5\u662f\u535a\u4e3b\u7684\u8fd9\u4e2a\u6e38\u620f\u6d89\u53ca\u5230&#xff0c;\u5f88\u591a\u6e38\u620f\u5982\u201c\u662f\u5144\u5f1f\u5c31\u4e0b325\u5c42\u201d\u4e2d&#xff0c;\u90fd\u9762\u4e34\u7740\u5982\u679c\u73a9\u5bb6\u88ab\u5939\u4f4f\u4e86\u8be5\u53bb\u600e\u4e48\u8bbe\u8ba1\u3002\u5728\u8fd9\u4e00\u95ee\u9898\u4e0a&#xff0c;\u9700\u8981&#034;\u770b\u7a7f&#034;\u67d0\u4e2a\u7269\u4f53\u68c0\u67e5\u540e\u9762\u8fd8\u6709\u6ca1\u6709\u4e1c\u897f\u7684\u65f6\u5019&#xff0c;\u76f4\u63a5\u7528 RaycastAll&#xff0c;\u68c0\u6d4b\u5230\u4e86\u4e4b\u540e\u518d\u6839\u636e\u9700\u6c42\u53bb\u8bbe\u8ba1\u5bf9\u5e94\u7684\u63aa\u65bd&#xff0c;\u6bd4\u5982\u865a\u5316&#xff0c;\u5f3a\u5236\u9063\u8fd4\u4e4b\u7c7b\u7684\u3002<\/span><\/p>\n<hr \/>\n<h2><span style=\"color:#0d0016\">\u4e09\u3001\u6c34\u6f6d\u5730\u5f62&#xff1a;\u548c\u654c\u4eba\u7cfb\u7edf\u8054\u52a8\u7684\u7b2c\u4e00\u5757\u5730\u5f62<\/span><\/h2>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u5728\u8bb2\u91ce\u732a\u4e4b\u524d&#xff0c;\u5fc5\u987b\u5148\u628a\u6c34\u6f6d\u8bf4\u6e05\u695a\u3002\u8fd9\u662f Echo Orb \u4e2d\u7b2c\u4e00\u4e2a\u8981\u6c42&#034;\u5916\u90e8\u5730\u5f62\u5f71\u54cd\u654c\u4eba\u884c\u4e3a&#034;\u7684\u8bbe\u8ba1\u2014\u2014\u4e0d\u662f\u5355\u7eaf\u4e00\u5835\u5899&#xff0c;\u800c\u662f\u5bf9\u4e0d\u540c\u7684\u89d2\u8272\u6709\u4e0d\u540c\u7684\u89c4\u5219\u3002\u8fd9\u4e00\u70b9\u7684\u8bbe\u8ba1\u4e5f\u662f\u7b26\u5408\u535a\u4e3b\u7b2c0\u7bc7\u4e2dGDD\u6240\u63cf\u8ff0\u7684&#xff1a;\u65b0\u7684\u654c\u4eba\u8981\u6709\u7279\u8272&#xff0c;\u8981\u8ba9\u73a9\u5bb6\u627e\u5230\u5bf9\u5e94\u7684\u5e94\u5bf9\u63aa\u65bd&#xff0c;\u8ba9\u73a9\u5bb6\u611f\u53d7\u5230\u89c1\u62db\u62c6\u62db\u7684\u5feb\u4e50&#xff0c;\u800c\u975e\u7b80\u5355\u7684\u6740\u6740\u6740\u3002\u56e0\u6b64&#xff0c;\u535a\u4e3b\u5c31\u8bbe\u8ba1\u4e86\u91ce\u732a\u654c\u4eba\u548c\u6c34\u6f6d\u673a\u5236&#xff0c;\u4e3a\u6e38\u620f\u589e\u6dfb\u4e86\u4e00\u70b9\u4e50\u8da3\u3002<\/span><\/p>\n<h3><span style=\"color:#0d0016\">3.1 \u9700\u6c42<\/span><\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u8981\u4fdd\u8bc1\u201c\u6c34\u6f6d\u8981\u80fd\u5e2e\u52a9\u73a9\u5bb6\u5e94\u5bf9\u91ce\u732a\u201d&#xff0c;\u90a3\u5c31\u5f97\u5148\u660e\u786e\u6c34\u6f6d\u9762\u5bf9\u4e0d\u540c\u5bf9\u8c61\u6240\u4f53\u73b0\u51fa\u7684\u4e0d\u540c\u6548\u679c&#xff1a;<\/span><\/p>\n<table border=\"1\" cellspacing=\"0\" style=\"margin-left:4.9000pt\">\n<tbody>\n<tr>\n<td style=\"background-color:#d5e8f0;width:234.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\"><span style=\"color:#0d0016\">\u89d2\u8272<\/span><\/p>\n<\/td>\n<td style=\"background-color:#d5e8f0;width:234.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\"><span style=\"color:#0d0016\">\u78b0\u5230\u6c34\u6f6d<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align:top;width:234.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u73a9\u5bb6<\/span><\/p>\n<\/td>\n<td style=\"vertical-align:top;width:234.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u8fdb\u4e0d\u53bb&#xff0c;\u6c34\u6f6d\u76f8\u5f53\u4e8e\u5899<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align:top;width:234.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u5de1\u903b\u8005 \/ \u53f2\u83b1\u59c6<\/span><\/p>\n<\/td>\n<td style=\"vertical-align:top;width:234.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u8fdb\u4e0d\u53bb&#xff0c;\u6c34\u6f6d\u76f8\u5f53\u4e8e\u5899<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align:top;width:234.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u5b50\u5f39<\/span><\/p>\n<\/td>\n<td style=\"vertical-align:top;width:234.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u7a7f\u900f&#xff0c;\u8be5\u98de\u7ee7\u7eed\u98de<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align:top;width:234.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u91ce\u732a&#xff08;\u5de1\u903b\u6001&#xff09;<\/span><\/p>\n<\/td>\n<td style=\"vertical-align:top;width:234.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u8fdb\u4e0d\u53bb&#xff0c;\u6c34\u6f6d\u76f8\u5f53\u4e8e\u5899<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align:top;width:234.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u91ce\u732a&#xff08;\u51b2\u649e\u6001&#xff09;<\/span><\/p>\n<\/td>\n<td style=\"vertical-align:top;width:234.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u7a7f\u900f&#xff01;\u51b2\u8fdb\u53bb\u53d7\u4f24&#xff0c;\u901f\u5ea6\u51cf\u7f13&#xff0c;\u627e\u6700\u77ed\u8def\u5f84\u4e0a\u5cb8<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3><span style=\"color:#0d0016\">3.2 \u5b9e\u73b0&#xff1a;Layer Collision Matrix &#043; \u4ee3\u7801\u52a8\u6001\u7ed5\u884c<\/span><\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u6c34\u6f6d\u7528\u4e86 Unity \u5185\u7f6e\u7684 Water Layer\u3002\u5728 Physics 2D \u7684\u78b0\u649e\u77e9\u9635\u91cc&#xff08;Edit \u2192 Project Settings \u2192 Physics 2D \u2192 \u6700\u5e95\u90e8\u90a3\u4e2a\u5927\u5927\u7684\u6253\u52fe\u8868&#xff09;&#xff0c;Water \u884c\u53ea\u52fe Default \u5217\u2014\u2014\u8fd9\u6837 Default \u5c42\u4e0a\u7684\u73a9\u5bb6\u548c\u5de1\u903b\u8005\u81ea\u52a8\u88ab\u6c34\u6321\u4f4f\u3002<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u800c\u5b50\u5f39\u548c\u51b2\u649e\u72b6\u6001\u7684\u91ce\u732a&#xff0c;\u7528\u4ee3\u7801\u904d\u5386\u6240\u6709\u6c34\u78b0\u649e\u4f53&#xff0c;\u9010\u4e2a\u8bbe\u7f6e\u5ffd\u7565&#xff1a;<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">int waterLayer &#061; LayerMask.NameToLayer(&#034;Water&#034;);<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">Collider2D[] all &#061; FindObjectsByType&lt;Collider2D&gt;();<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">foreach (Collider2D c in all)<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">{<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0if (c.gameObject.layer &#061;&#061; waterLayer)<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Physics2D.IgnoreCollision(myCollider, c);<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">}<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u8fd9\u4e2a\u65b9\u6cd5\u867d\u7136\u9700\u8981\u6bcf\u9897\u5b50\u5f39\u904d\u5386\u6240\u6709\u78b0\u649e\u4f53&#xff08;\u6027\u80fd\u4e0a\u5bf9\u5c0f\u578b\u9879\u76ee\u53ef\u4ee5\u5ffd\u7565&#xff09;&#xff0c;\u4f46\u903b\u8f91\u7b80\u5355\u660e\u4e86&#xff0c;\u4e0d\u9700\u8981\u989d\u5916\u7ef4\u62a4\u53e6\u4e00\u5957 Layer \u914d\u7f6e\u3002<\/span><\/p>\n<h3><span style=\"color:#0d0016\">3.3 \u77e9\u9635\u8e29\u5751<\/span><\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u8e29\u5751\u63d0\u9192&#xff1a;Physics 2D \u7684\u90a3\u4e2a\u78b0\u649e\u77e9\u9635\u662f\u4e00\u5f20\u4e8c\u7ef4\u6253\u52fe\u8868\u3002\u884c\u548c\u5217\u4ea4\u53c9\u7684\u52fe\u51b3\u5b9a\u4e86\u5bf9\u5e94\u4e24\u4e2a\u5c42\u4e4b\u95f4\u7684\u7269\u4f53\u4f1a\u4e0d\u4f1a\u78b0\u649e\u3002\u535a\u4e3b\u66fe\u7ecf\u5728\u8fd9\u5f20\u8868\u4e0a\u6d6a\u8d39\u4e86\u6574\u6574\u4e00\u4e0b\u5348\u2014\u2014\u6700\u540e\u53d1\u73b0\u662f Water \u884c\u7684\u52fe\u53cd\u4e86&#xff0c;Water \u884c\u9664\u4e86 Default \u90fd\u52fe\u4e0a\u4e86&#xff0c;\u7ed3\u679c\u6c34\u548c\u4e07\u7269\u7a7f\u3002\u5982\u679c\u4f60\u6709\u4e24\u4e2a\u4e1c\u897f\u5c31\u662f\u649e\u4e0d\u5230\u4e00\u8d77\u53bb&#xff0c;\u5148\u53bb\u77e9\u9635\u91cc\u5bf9\u4e00\u4e0b\u884c\u548c\u5217&#xff01;<\/span><\/p>\n<hr \/>\n<h2><span style=\"color:#0d0016\">\u56db\u3001\u91ce\u732a\u51b2\u649e\u8005&#xff1a;\u7b2c\u4e00\u4e2a\u5145\u6ee1\u8bbe\u8ba1\u611f\u7684\u654c\u4eba&#xff0c;\u4e5f\u662f\u7b2c\u4e00\u4e2a\u5b8c\u6574\u7684\u72b6\u6001\u673a<\/span><\/h2>\n<h3><span style=\"color:#0d0016\">4.1 \u8bbe\u8ba1<\/span><\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u91ce\u732a\u672c\u8d28\u4e0a\u5148\u662f\u4e00\u4e2a\u654c\u4eba&#xff0c;\u5148\u5f97\u5bf9\u5176\u672c\u8eab\u57fa\u7840\u903b\u8f91\u8fdb\u884c\u8bbe\u8ba1&#xff0c;\u518d\u8003\u8651\u548c\u6c34\u6f6d\u7684\u4ea4\u4e92&#xff1a;<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u91ce\u732a\u7684\u672c\u8eab\u903b\u8f91\u662f Echo Orb \u4e2d\u654c\u4eba\u884c\u4e3a\u6700\u590d\u6742\u7684\u3002\u5b83\u6709\u56db\u4e2a\u72b6\u6001&#xff1a;\u5de1\u903b\u3001\u51b2\u649e\u3001\u4f11\u606f\u3001\u6e38\u5411\u5cb8\u8fb9\u3002<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u5de1\u903b \u2190\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u2502 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u2502<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u2502 (\u770b\u89c1\u73a9\u5bb6) \u00a0\u00a0\u00a0\u2502 (\u4f11\u606f 2s \u7ed3\u675f)<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u2193 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u2502<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u51b2\u649e (2s) \u2500\u2500\u2500\u2500\u2500\u2500\u2192\u4f11\u606f<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u2502 \u00a0\u00a0\u00a0\u2191<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u2502 \u00a0\u00a0\u00a0\u2502<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u251c\u2500\u2500\u2192\u78b0\u5899\u2192\u2500\u2500\u2500\u2500\u2500\u2500\u2518<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u251c\u2500\u2500\u2192\u78b0\u73a9\u5bb6\u2192\u6263 2 \u8840 &#043; \u51fb\u9000&#xff0c;\u7ee7\u7eed\u51b2<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u2514\u2500\u2500\u2192\u78b0\u6c34\u2192\u6263 2 \u8840 &#043; \u53d8\u7ea2 &#043; \u7ee7\u7eed\u51b2\u2192\u5230\u7ec8\u70b9\u21920.5 \u500d\u901f\u6e38\u4e0a\u5cb8<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u4ee3\u7801\u5c42\u9762\u5c31\u662f\u4e00\u4e2a enum \u52a0\u4e00\u4e2a switch&#xff0c;\u6bcf\u79cd\u72b6\u6001\u4e00\u4e2a Update \u65b9\u6cd5\u3002\u522b\u628a\u6240\u6709\u903b\u8f91\u5168\u585e\u5728\u4e00\u4e2a Update \u91cc&#xff0c;\u5426\u5219\u4e09\u4e2a\u6708\u540e\u81ea\u5df1\u56de\u6765\u90fd\u770b\u4e0d\u61c2&#xff08;\u662f\u7684\u535a\u4e3b\u521a\u56de\u5934\u770b\u5df2\u7ecf\u770b\u4e0d\u61c2\u4e86\u2026\u2026&#xff09;<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">public enum BoarState { Patrol, Charge, Rest, SwimToShore }<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">void FixedUpdate()<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">{<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0switch (state)<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0{<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0case BoarState.Patrol: \u00a0PatrolUpdate(); \u00a0break;<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0case BoarState.Charge: \u00a0ChargeUpdate(); \u00a0break;<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0case BoarState.Rest: \u00a0\u00a0\u00a0RestUpdate(); \u00a0\u00a0\u00a0break;<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0case BoarState.SwimToShore: SwimUpdate(); break;<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0}<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">}<\/span><\/p>\n<h3><span style=\"color:#0d0016\">4.2 \u8e29\u5751&#xff1a;\u91ce\u732a&#034;\u770b\u4e0d\u89c1&#034;\u73a9\u5bb6<\/span><\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u51b2\u649e\u6761\u4ef6\u662f&#034;\u8ddd\u79bb\u5728 6 \u5355\u4f4d\u5185 &#043; \u89c6\u7ebf\u65e0\u906e\u6321&#034;\u3002\u89c6\u7ebf\u68c0\u6d4b\u7528\u4e00\u6761\u4ece\u91ce\u732a\u5230\u73a9\u5bb6\u7684 Raycast&#xff1a;<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">bool CanSeePlayer()<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">{<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0float dist &#061; Vector2.Distance(transform.position, player.transform.position);<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0if (dist &gt; sightRange) return false;<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0Vector2 dir &#061; player.position &#8211; transform.position;<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0RaycastHit2D hit &#061; Physics2D.Raycast(transform.position, dir, dist);<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0return hit.collider.CompareTag(&#034;Player&#034;);<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">}<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u5199\u597d\u4e4b\u540e&#xff0c;\u6362\u4e86\u66f4\u5927\u7684\u7f8e\u672f\u7d20\u6750&#xff0c;\u6b64\u65f6\u53c8\u6709\u65b0\u95ee\u9898\u51fa\u73b0\u4e86&#xff1a;\u91ce\u732a\u7acb\u523b&#034;\u778e\u4e86&#034;&#xff0c;\u6c38\u8fdc\u770b\u4e0d\u5230\u73a9\u5bb6\u3002<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u4ec5\u4ec5\u662f\u6539\u52a8\u4e86\u5927\u5c0f&#xff0c;\u600e\u4e48\u539f\u672c\u7684\u529f\u80fd\u5c31\u5931\u6548\u4e86&#xff1f;&#xff01;\u535a\u4e3b\u5728\u4e0a\u4e00\u7bc7\u4e3b\u89d2\u7684\u8bbe\u8ba1\u4e2d\u4e5f\u9047\u5230\u4e86\u76f8\u4f3c\u7684\u95ee\u9898&#xff0c;\u5927\u5bb6\u80af\u5b9a\u4e5f\u53cd\u5e94\u8fc7\u6765\u5566&#xff0c;\u539f\u56e0\u975e\u5e38\u7b80\u5355&#xff1a;\u5c04\u7ebf\u4ece transform.position&#xff08;\u91ce\u732a\u8eab\u4f53\u7684\u6b63\u4e2d\u5fc3&#xff09;\u53d1\u51fa&#xff0c;\u7b2c\u4e00\u4e2a\u547d\u4e2d\u7684\u4e1c\u897f\u5c31\u662f\u91ce\u732a\u81ea\u5df1\u7684\u78b0\u649e\u4f53\u3002\u539f\u6765\u7d20\u6750\u5c0f\u65f6\u5c04\u7ebf\u52c9\u5f3a\u80fd\u4ece\u4f53\u5185\u7a7f\u51fa\u53bb&#xff0c;\u7d20\u6750\u6362\u6210\u5927\u7684\u4e4b\u540e\u78b0\u649e\u4f53\u4e5f\u8ddf\u7740\u53d8\u5927\u4e86&#xff0c;\u5c04\u7ebf\u6c38\u8fdc\u6253\u5728\u81ea\u5df1\u8eab\u4e0a\u3002<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u6240\u4ee5\u5927\u5bb6\u8bb0\u4f4f\u4e0d\u8981\u786c\u7f16\u7801\u504f\u79fb\u6570\u5b57\u3002\u7528 myCollider.bounds.extents.magnitude \u52a8\u6001\u8ba1\u7b97\u78b0\u649e\u4f53\u534a\u5f84&#xff0c;\u5c04\u7ebf\u4ece\u4f53\u5916\u4fa7\u53d1\u51fa&#xff1a;<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">float r &#061; myCollider.bounds.extents.magnitude &#043; 0.1f;<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">Vector2 rayOrigin &#061; rb.position &#043; dir * r;<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">RaycastHit2D hit &#061; Physics2D.Raycast(rayOrigin, dir, dist &#8211; r);<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u4e0d\u7ba1\u7d20\u6750\u600e\u4e48\u6362\u3001\u78b0\u649e\u4f53\u600e\u4e48\u53d8&#xff0c;\u5c04\u7ebf\u6c38\u8fdc\u81ea\u9002\u5e94\u5730\u4ece\u8eab\u4f53\u8fb9\u7f18\u5f80\u5916\u53d1&#xff0c;\u522b\u5199\u6b7b\u6570\u5b57\u3002\u8fd9\u4e2a\u6559\u8bad\u9002\u7528\u4e8e\u4efb\u4f55\u9700\u8981\u5728\u7269\u4f53\u5185\u90e8\u53d1\u5c04\u7ebf\u7684\u60c5\u51b5\u3002<\/span><\/p>\n<h3><span style=\"color:#0d0016\">4.3 \u51b2\u649e\u5165\u6c34\u4e0e\u6e38\u6cf3\u4e0a\u5cb8<\/span><\/h3>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u51b2\u649e\u72b6\u6001\u4e0b\u52a8\u6001\u5173\u95ed\u6c34\u78b0\u649e&#xff1a;StartCharge \u5173&#xff0c;\u51b2\u5230\u5e95\u6216\u78b0\u5899\u540e EndCharge\u3002\u5982\u679c\u51b2\u649e\u7ed3\u675f\u65f6\u5728\u6c34\u91cc&#xff0c;\u8fdb\u5165 SwimToShore \u72b6\u6001&#xff0c;\u5f80\u51b2\u8fdb\u6765\u7684\u53cd\u65b9\u5411\u6e38&#xff08;\u964d\u901f&#xff09;&#xff0c;\u76f4\u5230\u79bb\u6c34\u4e0a\u5cb8\u518d\u6062\u590d\u6c34\u78b0\u649e\u3001\u8fdb\u4f11\u606f\u3002<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u8fd9\u91cc\u8fd8\u6709\u4e2a\u5c0f\u5751&#xff1a;\u51b2\u649e\u7ed3\u675f\u540e\u7acb\u523b\u6062\u590d\u6c34\u78b0\u649e\u2192\u91ce\u732a\u88ab\u7269\u7406\u5f15\u64ce\u5f39\u51fa\u53bb\u3002\u8981\u7b49\u5230 IsInWater() \u8fd4\u56de false \u4e86\u624d\u6062\u590d\u2014\u2014\u65f6\u5e8f\u5f88\u91cd\u8981\u3002<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<hr \/>\n<h2><span style=\"color:#0d0016\">\u4e94\u3001\u9ec4\u8702&#xff1a;\u5b9a\u65f6\u751f\u5d3d &#043; \u73a9\u5bb6\u9760\u8fd1\u5c31\u8ffd<\/span><\/h2>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u9ec4\u8702\u548c\u5de1\u903b\u8005\u5927\u90e8\u5206\u903b\u8f91\u662f\u590d\u7528\u7684\u2014\u2014\u5de6\u53f3\u5de1\u903b\u3001\u9760\u8fd1\u73a9\u5bb6\u6263\u8840\u3002\u591a\u4e86\u4e24\u4e2a\u7279\u6027&#xff1a;<\/span><\/p>\n<ul>\n<li><span style=\"color:#0d0016\">\u8ffd\u51fb&#xff1a;\u73a9\u5bb6\u8fdb\u5165 chaseRange \u8303\u56f4\u65f6&#xff0c;\u79fb\u52a8\u76ee\u6807\u4ece\u5de1\u903b\u7aef\u70b9\u5207\u6362\u5230\u73a9\u5bb6\u4f4d\u7f6e&#xff0c;\u8ffd\u8fc7\u53bb<\/span><\/li>\n<li><span style=\"color:#0d0016\">\u751f\u5d3d&#xff1a;\u6bcf 5 \u79d2 spawnCount \u53ea\u5c0f\u9ec4\u8702&#xff0c;\u5728\u5468\u56f4 spawnRadius \u5185\u968f\u673a\u6563\u5f00\u51fa\u751f<\/span><\/li>\n<\/ul>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u5c0f\u9ec4\u8702\u548c\u672c\u4f53\u4f7f\u7528\u5b8c\u5168\u76f8\u540c\u7684\u811a\u672c\u3002\u533a\u522b\u53ea\u5728 Inspector \u91cc\u7684\u51e0\u4e2a\u53c2\u6570&#xff1a;<\/span><\/p>\n<table border=\"1\" cellspacing=\"0\" style=\"margin-left:4.9000pt\">\n<tbody>\n<tr>\n<td style=\"background-color:#d5e8f0;width:117.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\"><span style=\"color:#0d0016\">\u5c5e\u6027<\/span><\/p>\n<\/td>\n<td style=\"background-color:#d5e8f0;width:117.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\"><span style=\"color:#0d0016\">\u5927\u9ec4\u8702<\/span><\/p>\n<\/td>\n<td style=\"background-color:#d5e8f0;width:234.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\"><span style=\"color:#0d0016\">\u5c0f\u9ec4\u8702<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align:top;width:117.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">Scale<\/span><\/p>\n<\/td>\n<td style=\"vertical-align:top;width:117.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">1<\/span><\/p>\n<\/td>\n<td style=\"vertical-align:top;width:234.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">0.5<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align:top;width:117.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">maxHP<\/span><\/p>\n<\/td>\n<td style=\"vertical-align:top;width:117.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">3<\/span><\/p>\n<\/td>\n<td style=\"vertical-align:top;width:234.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">1<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align:top;width:117.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">babyPrefab<\/span><\/p>\n<\/td>\n<td style=\"vertical-align:top;width:117.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u62d6\u5165\u5c0f\u8702\u9884\u5236\u4f53<\/span><\/p>\n<\/td>\n<td style=\"vertical-align:top;width:234.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u7559\u7a7a&#xff08;\u4e0d\u751f&#xff09;<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u505a&#034;\u5f31\u5316\u7248&#034;\u654c\u4eba\u65f6\u4f18\u5148\u8003\u8651\u590d\u7528\u811a\u672c\u3002Inspector \u91cc\u6539\u51e0\u4e2a\u53c2\u6570\u5c31\u80fd\u51fa\u4e00\u4e2a\u65b0\u654c\u4eba&#xff0c;\u4ee3\u7801\u51e0\u4e4e\u4e0d\u9700\u8981\u52a8&#xff0c;\u65b9\u4fbf\u5f97\u5f88\u561e\u3002***\u4f46\u4e0d\u8981\u6ee5\u7528&#xff0c;\u4e0d\u7136\u91cd\u590d\u5ea6\u592a\u9ad8\u4f1a\u6d88\u78e8\u73a9\u5bb6\u7684\u5174\u8da3&#xff01;&#xff01;&#xff01;\u535a\u4e3b\u60f3\u5230\u81ea\u5df1\u539f\u4ef7\u4e70\u7684\u751f\u5316\u5371\u673a\u5b89\u9b42\u66f2\u5c31\u6765\u6c14&#xff0c;\u5927\u5bb6\u61c2\u7684\u90fd\u61c2\u2026\u2026<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<hr \/>\n<h2><span style=\"color:#0d0016\">\u516d\u3001Boss \u7684\u8bbe\u8ba1\u53ea\u662f\u5c5e\u6027\u4e0d\u540c\u7684\u540c\u6b3e\u654c\u4eba<\/span><\/h2>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">Boss \u7684\u8bbe\u8ba1\u53ea\u662f\u5c5e\u6027\u4e0d\u540c\u7684\u540c\u6b3e\u654c\u4eba\u3002\u91ce\u732a Boss \u548c\u666e\u901a\u91ce\u732a\u7528\u7684\u662f\u5b8c\u5168\u4e00\u6837\u7684 Enemy_Boar \u811a\u672c\u3002\u4ece\u5934\u5230\u5c3e\u53ea\u6539\u4e86\u4e09\u6837&#xff1a;HP \u6539\u6210 50\u3001\u6362\u4e86 Boss \u4e13\u5c5e\u7684\u7f8e\u672f\u7d20\u6750\u548c\u52a8\u753b\u3001\u52a0\u4e86\u4e00\u4e2a\u6b7b\u4ea1\u52a8\u753b\u3002<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u52a0\u6b7b\u4ea1\u52a8\u753b\u5c31\u662f\u5728\u539f\u6765&#034;\u76f4\u63a5 Destroy&#034;\u7684\u57fa\u7840\u4e0a&#xff0c;\u5148\u64ad\u4e00\u6bb5\u65f6\u957f 0.8 \u79d2\u7684\u6b7b\u4ea1 clip&#xff08;\u7528 Animator \u7684 Trigger \u53c2\u6570\u9a71\u52a8&#xff09;&#xff0c;\u64ad\u5b8c\u518d\u9500\u6bc1&#xff1a;<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">void Die()<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">{<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0isDead &#061; true;<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0rb.linearVelocity &#061; Vector2.zero;<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0GetComponent&lt;Collider2D&gt;().enabled &#061; false;<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0if (anim !&#061; null) anim.SetTrigger(&#034;die&#034;);<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0StartCoroutine(DeathDelay());<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">}<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">IEnumerator DeathDelay()<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">{<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0yield return new WaitForSeconds(0.8f);<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u00a0\u00a0\u00a0\u00a0Destroy(gameObject);<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">}<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">Animator \u91cc\u7528 Trigger \u800c\u4e0d\u662f Bool \u6765\u63a7\u5236\u6b7b\u4ea1\u3002Trigger \u662f\u4e00\u6b21\u6027\u7684\u2014\u2014\u64ad\u5b8c\u81ea\u52a8\u5931\u6548&#xff0c;\u4e0d\u9700\u8981\u5728\u4ee3\u7801\u91cc\u624b\u52a8\u91cd\u7f6e\u3002Bool \u9700\u8981\u4e24\u8fb9&#xff08;true \u548c false&#xff09;\u90fd\u7ba1&#xff0c;\u591a\u4e00\u4e2a\u72b6\u6001\u5c31\u591a\u4e00\u4e2a\u5fd8\u6389\u7684\u6982\u7387\u3002<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u4e00\u53e5\u8bdd\u603b\u7ed3&#xff1a;Boss \u4e0d\u4e00\u5b9a\u975e\u8981\u5355\u72ec\u5199\u4e00\u5957\u811a\u672c\u3002\u5f88\u591a\u65f6\u5019\u5b83\u53ea\u662f&#034;\u5c5e\u6027\u4e0d\u540c\u7684\u540c\u6b3e\u654c\u4eba&#034;\u3002\u8111\u5b50\u91cc\u7684\u7b2c\u4e00\u53cd\u5e94\u5e94\u8be5\u662f&#034;\u73b0\u6709\u811a\u672c\u80fd\u4e0d\u80fd\u590d\u7528&#034;&#xff0c;\u5b9e\u5728\u4e0d\u80fd\u4e86\u518d\u8003\u8651\u5199\u65b0\u7684\u3002<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<hr \/>\n<h2><span style=\"color:#0d0016\">\u4e03\u3001\u56db\u79cd\u654c\u4eba\u6559\u4f1a\u6211\u7684\u516d\u4ef6\u4e8b<\/span><\/h2>\n<table border=\"1\" cellspacing=\"0\" style=\"margin-left:4.9000pt\">\n<tbody>\n<tr>\n<td style=\"background-color:#d5e8f0;width:200.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\"><span style=\"color:#0d0016\">\u7ecf\u9a8c<\/span><\/p>\n<\/td>\n<td style=\"background-color:#d5e8f0;width:268.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:center\"><span style=\"color:#0d0016\">\u4e3a\u4ec0\u4e48\u91cd\u8981<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align:top;width:200.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">Dynamic &#043; \u5927\u8d28\u91cf &#043; MovePosition<\/span><\/p>\n<\/td>\n<td style=\"vertical-align:top;width:268.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u9700\u8981\u78b0\u649e\u53c8\u4e0d\u60f3\u88ab\u63a8\u98de\u65f6\u7684\u7a33\u5b9a\u7ec4\u5408&#xff0c;\u4f18\u5148\u7ea7\u6700\u9ad8<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align:top;width:200.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u5c04\u7ebf\u4ece\u78b0\u649e\u4f53\u5916\u4fa7\u53d1\u51fa<\/span><\/p>\n<\/td>\n<td style=\"vertical-align:top;width:268.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u7528 bounds.extents \u81ea\u9002\u5e94&#xff0c;\u6362\u7d20\u6750\u540e\u4e0d\u4f1a\u5d29<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align:top;width:200.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u72b6\u6001\u673a\u7528 enum &#043; switch<\/span><\/p>\n<\/td>\n<td style=\"vertical-align:top;width:268.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u6bcf\u79cd\u72b6\u6001\u4e00\u4e2a\u65b9\u6cd5&#xff0c;\u903b\u8f91\u6e05\u6670\u4e0d\u7ea0\u7f20<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align:top;width:200.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">RaycastAll \u7a7f\u900f\u591a\u5c42\u7269\u4f53<\/span><\/p>\n<\/td>\n<td style=\"vertical-align:top;width:268.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u9700\u8981&#034;\u770b\u7a7f&#034;\u81ea\u8eab\u6216\u67d0\u7269\u65f6\u7528&#xff0c;\u627e\u80cc\u540e\u7684\u5899\u975e\u5e38\u65b9\u4fbf<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align:top;width:200.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">Trigger \u7ba1\u7406\u4e00\u6b21\u6027\u4e8b\u4ef6<\/span><\/p>\n<\/td>\n<td style=\"vertical-align:top;width:268.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u6b7b\u4ea1\u3001\u4ea4\u4e92\u7b49\u64ad\u5b8c\u5373\u6d88&#xff0c;\u4e0d\u7528\u624b\u52a8\u91cd\u7f6e<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align:top;width:200.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u5c0f\u654c\u4eba\u590d\u7528\u811a\u672c &#043; Inspector \u5dee\u5f02\u5316<\/span><\/p>\n<\/td>\n<td style=\"vertical-align:top;width:268.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u6700\u5212\u7b97\u7684\u5f00\u53d1\u65b9\u5f0f&#xff0c;\u4e0d\u8981\u590d\u5236\u7c98\u8d34\u4ee3\u7801<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"text-align:justify\">\n<p style=\"text-align:justify\"><span style=\"color:#0d0016\">\u518d\u6b21\u5f3a\u8c03&#xff01;&#xff01;&#xff01;<\/span><\/p>\n<p style=\"text-align:justify\"><span style=\"color:#0d0016\">\u672c\u4eba\u53ea\u662f\u4e00\u4e2a\u76ee\u524d\u5728\u505a\u4e00\u4e9b\u81ea\u8ba4\u4e3a\u6709\u610f\u4e49\u7684\u5b66\u4e60\u7684\u5c0f\u767d&#xff0c;\u6b64\u7bc7\u53ea\u662f\u6211\u4e2a\u4eba\u7684\u4e00\u4e9b\u5f00\u53d1\u8def\u5f84\u548c\u89c2\u70b9\u3002\u53d1\u5e03\u7684\u76ee\u7684\u662f\u6e34\u671b\u5f97\u5230\u4e00\u4e9b\u6307\u70b9&#xff0c;\u540c\u65f6\u4e5f\u4e3a\u60f3\u8fc8\u51fa\u6e38\u620f\u5f00\u53d1\u8fd9\u4e00\u6b65\u7684\u8bfb\u8005\u4eec\u4e00\u4e9b\u5c0f\u7684\u65b9\u5411\u3002\u82e5\u6709\u4e0d\u5bf9\u6216\u4e0d\u8db3\u4e4b\u5904\u6073\u8bf7\u5404\u4f4d\u5927\u4f6c\u6307\u70b9\u8ff7\u6d25&#xff01;<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u4e0b\u4e00\u7bc7\u9884\u544a<\/span><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"><span style=\"color:#0d0016\">\u8840\u91cf\u3001\u836f\u6c34\u3001\u5bf9\u8bdd&#xff1a;\u8ba9\u6e38\u620f\u53d8\u5f97\u5b8c\u6574 \u2014\u2014 HP \u7ea2\u5fc3 UI \u7684\u6570\u636e\u7ed1\u5b9a\u600e\u4e48\u505a\u7684\u3001\u53d7\u4f24\u95ea\u70c1\u534f\u7a0b\u548c\u65e0\u654c\u5e27\u3001TMP \u4e2d\u6587\u8fdf\u8fdf\u4e0d\u663e\u793a\u5230\u5e95\u600e\u4e48\u89e3\u51b3\u3001\u5bf9\u8bdd\u7cfb\u7edf\u9996\u6b21\u548c\u540e\u7eed\u600e\u4e48\u533a\u5206\u3001NPC \u7684\u4ea4\u4e92\u56fe\u6807\u4e3a\u4ec0\u4e48\u8ddf\u7740\u7ffb\u8f6c\u3002<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u654c\u4eba\u7cfb\u7edf&#xff1a;\u5de1\u903b\u8005\u3001\u51b2\u649e\u91ce\u732a\u4e0e\u8ffd\u51fb\u9ec4\u8702Echo Orb 2D \u4fef\u89c6\u89d2\u52a8\u4f5c\u89e3\u8c1c\u6e38\u620f \u5f00\u53d1\u65e5\u5fd7\u7b2c 2 \u7bc7\u4f5c\u8005&#xff1a;\u9752\u7af9\u4e39\u67ab | \u5357\u4eac\u90ae\u7535\u5927\u5b66 \u6570\u5b57\u5a92\u4f53\u6280\u672f | 2026\u5e748\u6708Tips&#xff1a;\u8fd9\u662f\u672c\u7cfb\u5217\u7684\u7b2c\u4e8c\u7bc7\u6b63\u5f0f\u6280\u672f\u65e5\u5fd7\u5566&#xff0c;\u8fd9\u4e00\u6b21\u4e3b\u8981\u7684\u5185\u5bb9\u6d89\u53ca\u56db\u79cd\u654c\u4eba\u7684\u8bbe\u8ba1\u4e0e\u5b9e\u73b0\u3002\u540c\u6837\u7684&#xff0c;\u672c\u7cfb\u5217\u4ecb\u7ecd\u7684\u662f\u535a\u4e3b\u4e2a\u4eba\u7684\u5b66\u4e60\u8def\u5f84\u4ee5\u53ca\u6280\u672f\u8bb0\u5f55&#xff0c;\u5305\u62ec\u4e86\u535a\u4e3b\u5bf9\u4e00\u4e9b\u95ee\u9898\u7684\u89e3\u51b3\u65b9\u6cd5&#xff0c;\u5e0c\u671b\u5bf9\u521d\u5b66\u8005\u6709\u4e00\u5b9a\u7684\u5e2e\u52a9\u3002\u672c\u4eba\u53ea\u662f\u4e00\u4e2a\u76ee\u524d\u5728\u505a<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[9098,183,248,735],"topic":[],"class_list":["post-92583","post","type-post","status-publish","format-standard","hentry","category-server","tag-it","tag-unity","tag-248","tag-735"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>02.Unity\u6e38\u620f\u5f00\u53d1\u521d\u5b66\u8005\u7684\u7b2c\u4e00\u4e2a\u7ec3\u624bDemo\u2014\u2014\u56db\u5927\u654c\u4eba\u7cfb\u7edf\u8bbe\u8ba1 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/92583.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"02.Unity\u6e38\u620f\u5f00\u53d1\u521d\u5b66\u8005\u7684\u7b2c\u4e00\u4e2a\u7ec3\u624bDemo\u2014\u2014\u56db\u5927\u654c\u4eba\u7cfb\u7edf\u8bbe\u8ba1 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u654c\u4eba\u7cfb\u7edf&#xff1a;\u5de1\u903b\u8005\u3001\u51b2\u649e\u91ce\u732a\u4e0e\u8ffd\u51fb\u9ec4\u8702Echo Orb 2D \u4fef\u89c6\u89d2\u52a8\u4f5c\u89e3\u8c1c\u6e38\u620f \u5f00\u53d1\u65e5\u5fd7\u7b2c 2 \u7bc7\u4f5c\u8005&#xff1a;\u9752\u7af9\u4e39\u67ab | \u5357\u4eac\u90ae\u7535\u5927\u5b66 \u6570\u5b57\u5a92\u4f53\u6280\u672f | 2026\u5e748\u6708Tips&#xff1a;\u8fd9\u662f\u672c\u7cfb\u5217\u7684\u7b2c\u4e8c\u7bc7\u6b63\u5f0f\u6280\u672f\u65e5\u5fd7\u5566&#xff0c;\u8fd9\u4e00\u6b21\u4e3b\u8981\u7684\u5185\u5bb9\u6d89\u53ca\u56db\u79cd\u654c\u4eba\u7684\u8bbe\u8ba1\u4e0e\u5b9e\u73b0\u3002\u540c\u6837\u7684&#xff0c;\u672c\u7cfb\u5217\u4ecb\u7ecd\u7684\u662f\u535a\u4e3b\u4e2a\u4eba\u7684\u5b66\u4e60\u8def\u5f84\u4ee5\u53ca\u6280\u672f\u8bb0\u5f55&#xff0c;\u5305\u62ec\u4e86\u535a\u4e3b\u5bf9\u4e00\u4e9b\u95ee\u9898\u7684\u89e3\u51b3\u65b9\u6cd5&#xff0c;\u5e0c\u671b\u5bf9\u521d\u5b66\u8005\u6709\u4e00\u5b9a\u7684\u5e2e\u52a9\u3002\u672c\u4eba\u53ea\u662f\u4e00\u4e2a\u76ee\u524d\u5728\u505a\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/92583.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-08-10T09:24:50+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/92583.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/92583.html\",\"name\":\"02.Unity\u6e38\u620f\u5f00\u53d1\u521d\u5b66\u8005\u7684\u7b2c\u4e00\u4e2a\u7ec3\u624bDemo\u2014\u2014\u56db\u5927\u654c\u4eba\u7cfb\u7edf\u8bbe\u8ba1 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-08-10T09:24:50+00:00\",\"dateModified\":\"2026-08-10T09:24:50+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/92583.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/92583.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/92583.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"02.Unity\u6e38\u620f\u5f00\u53d1\u521d\u5b66\u8005\u7684\u7b2c\u4e00\u4e2a\u7ec3\u624bDemo\u2014\u2014\u56db\u5927\u654c\u4eba\u7cfb\u7edf\u8bbe\u8ba1\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"02.Unity\u6e38\u620f\u5f00\u53d1\u521d\u5b66\u8005\u7684\u7b2c\u4e00\u4e2a\u7ec3\u624bDemo\u2014\u2014\u56db\u5927\u654c\u4eba\u7cfb\u7edf\u8bbe\u8ba1 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/92583.html","og_locale":"zh_CN","og_type":"article","og_title":"02.Unity\u6e38\u620f\u5f00\u53d1\u521d\u5b66\u8005\u7684\u7b2c\u4e00\u4e2a\u7ec3\u624bDemo\u2014\u2014\u56db\u5927\u654c\u4eba\u7cfb\u7edf\u8bbe\u8ba1 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u654c\u4eba\u7cfb\u7edf&#xff1a;\u5de1\u903b\u8005\u3001\u51b2\u649e\u91ce\u732a\u4e0e\u8ffd\u51fb\u9ec4\u8702Echo Orb 2D \u4fef\u89c6\u89d2\u52a8\u4f5c\u89e3\u8c1c\u6e38\u620f \u5f00\u53d1\u65e5\u5fd7\u7b2c 2 \u7bc7\u4f5c\u8005&#xff1a;\u9752\u7af9\u4e39\u67ab | \u5357\u4eac\u90ae\u7535\u5927\u5b66 \u6570\u5b57\u5a92\u4f53\u6280\u672f | 2026\u5e748\u6708Tips&#xff1a;\u8fd9\u662f\u672c\u7cfb\u5217\u7684\u7b2c\u4e8c\u7bc7\u6b63\u5f0f\u6280\u672f\u65e5\u5fd7\u5566&#xff0c;\u8fd9\u4e00\u6b21\u4e3b\u8981\u7684\u5185\u5bb9\u6d89\u53ca\u56db\u79cd\u654c\u4eba\u7684\u8bbe\u8ba1\u4e0e\u5b9e\u73b0\u3002\u540c\u6837\u7684&#xff0c;\u672c\u7cfb\u5217\u4ecb\u7ecd\u7684\u662f\u535a\u4e3b\u4e2a\u4eba\u7684\u5b66\u4e60\u8def\u5f84\u4ee5\u53ca\u6280\u672f\u8bb0\u5f55&#xff0c;\u5305\u62ec\u4e86\u535a\u4e3b\u5bf9\u4e00\u4e9b\u95ee\u9898\u7684\u89e3\u51b3\u65b9\u6cd5&#xff0c;\u5e0c\u671b\u5bf9\u521d\u5b66\u8005\u6709\u4e00\u5b9a\u7684\u5e2e\u52a9\u3002\u672c\u4eba\u53ea\u662f\u4e00\u4e2a\u76ee\u524d\u5728\u505a","og_url":"https:\/\/www.wsisp.com\/helps\/92583.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-08-10T09:24:50+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/92583.html","url":"https:\/\/www.wsisp.com\/helps\/92583.html","name":"02.Unity\u6e38\u620f\u5f00\u53d1\u521d\u5b66\u8005\u7684\u7b2c\u4e00\u4e2a\u7ec3\u624bDemo\u2014\u2014\u56db\u5927\u654c\u4eba\u7cfb\u7edf\u8bbe\u8ba1 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-08-10T09:24:50+00:00","dateModified":"2026-08-10T09:24:50+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/92583.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/92583.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/92583.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"02.Unity\u6e38\u620f\u5f00\u53d1\u521d\u5b66\u8005\u7684\u7b2c\u4e00\u4e2a\u7ec3\u624bDemo\u2014\u2014\u56db\u5927\u654c\u4eba\u7cfb\u7edf\u8bbe\u8ba1"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/92583","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=92583"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/92583\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=92583"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=92583"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=92583"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=92583"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}