{"id":3694,"date":"2025-06-12T18:00:20","date_gmt":"2025-06-12T10:00:20","guid":{"rendered":"https:\/\/www.wunen.com\/index.php\/2025\/06\/12\/unity3d%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f\/"},"modified":"2025-06-12T18:00:20","modified_gmt":"2025-06-12T10:00:20","slug":"unity3d%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f","status":"publish","type":"post","link":"http:\/\/www.wunen.com\/index.php\/2025\/06\/12\/unity3d%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f\/","title":{"rendered":"unity3D\u5c04\u51fb\u6e38\u620f"},"content":{"rendered":"<div class=\"article_content clearfix\" id=\"article_content\">\n <link href=\"https:\/\/csdnimg.cn\/release\/blogv2\/dist\/mdeditor\/css\/editerView\/kdoc_html_views-1a98987dfd.css\" rel=\"stylesheet\"\/>\n <link href=\"https:\/\/csdnimg.cn\/release\/blogv2\/dist\/mdeditor\/css\/editerView\/ck_htmledit_views-704d5b9767.css\" rel=\"stylesheet\"\/>\n<div class=\"markdown_views prism-atom-one-light\" id=\"content_views\">\n  <svg style=\"display: none;\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n   <path d=\"M5,0 0,2.5 5,5z\" id=\"raphael-marker-block\" stroke-linecap=\"round\" style=\"-webkit-tap-highlight-color: rgba(0, 0, 0, 0);\">\n   <\/path>\n  <\/svg><\/p>\n<h2>\n   <a id=\"_0\"><br \/>\n   <\/a><br \/>\n   \u5c04\u51fb\u6e38\u620f<br \/>\n  <\/h2>\n<h3>\n   <a id=\"1Enemy_2\"><br \/>\n   <\/a><br \/>\n   1.Enemy<br \/>\n  <\/h3>\n<pre><code class=\"prism language-c#\">using UnityEngine;\n\n[AddComponentMenu(\"MyGame\/Enemy\")]\npublic class Enemy : MonoBehaviour\n{\n    public float speed = 3.0f;\n    public float life = 10.0f;\n    protected float rotSpeed = 30;\n    internal Renderer renderer;\n    internal bool isActive = false;\n\n    private void Start()\n    {\n        renderer = this.transform.GetComponent&lt;Renderer&gt;();\n    }\n\n    private void OnBecameVisible()\n    {\n        isActive = true;\n    }\n    \n    void Update()\n    {\n        updateMove();\n        if (isActive &amp;&amp; !this.renderer.isVisible)\n        {\n            Destroy(this.gameObject);\n        }\n    }\n\n    public virtual void updateMove()\n    {\n        transform.Translate(new Vector3(Mathf.Sin(Time.time) * Time.deltaTime, 0, -speed * Time.deltaTime));\n    }\n\n    private void OnTriggerEnter(Collider other)\n    {\n        if (other.tag == TagsManager.PLAYEROCKET)\n        {\n            Rocket rocket = other.GetComponent&lt;Rocket&gt;();\n            if (rocket != null)\n            {\n                life -= rocket.power;\n                if (life &lt;= 0)\n                {\n                    GameManager.instance.AddScore(20);\n                    Destroy(this.gameObject);\n                }\n            }\n        }\n        else if (other.tag == TagsManager.PLAYER)\n        {\n            life = 0;\n            Destroy(this.gameObject);\n        }\n    }\n}\n<\/code><\/pre>\n<h3>\n   <a id=\"2EnemyRocket_64\"><br \/>\n   <\/a><br \/>\n   2.EnemyRocket<br \/>\n  <\/h3>\n<pre><code class=\"prism language-c#\">using UnityEngine;\n\npublic class EnemyRocket : Rocket\n{\n    private void OnTriggerEnter(Collider other)\n    {\n        if (other.tag == TagsManager.PLAYER || other.tag == TagsManager.PLAYEROCKET)\n        {\n            GameManager.instance.AddScore(1);\n            Destroy(this.gameObject);\n        }\n    }\n}\n<\/code><\/pre>\n<h3>\n   <a id=\"3EnemySpawn_82\"><br \/>\n   <\/a><br \/>\n   3.EnemySpawn<br \/>\n  <\/h3>\n<pre><code class=\"prism language-c#\">using System.Collections;\nusing UnityEngine;\n\npublic class EnemySpawn : MonoBehaviour\n{\n    public Transform[] ememyPrefab;\n    \n    void Start()\n    {\n        StartCoroutine(SpawnEnemy());\n    }\n\n    IEnumerator SpawnEnemy()\n    {\n        while (true)\n        {\n            yield return new WaitForSeconds(Random.Range(0, 15));\n            Instantiate(ememyPrefab[Random.Range(0, ememyPrefab.Length)], this.transform.position,\n                Quaternion.identity);\n        }\n    }\n\n    private void OnDrawGizmos()\n    {\n        Gizmos.DrawIcon(this.transform.position, \"item.png\", true);\n    }\n}\n<\/code><\/pre>\n<h3>\n   <a id=\"4GameManager_114\"><br \/>\n   <\/a><br \/>\n   4.GameManager<br \/>\n  <\/h3>\n<pre><code class=\"prism language-c#\">using UnityEngine;\nusing UnityEngine.SceneManagement;\nusing UnityEngine.UI;\n\npublic class GameManager : MonoBehaviour\n{\n    public static GameManager instance;\n\n    private void Awake()\n    {\n        instance = this;\n    }\n\n    public int score = 0;\n\n    public Text scoreText;\n    public Text lifeText;\n\n    public CanvasGroup gameover;\n    \n    void Start()\n    {\n        scoreText.text = string.Format(\"{0}\", 0);\n        lifeText.text = string.Format(\"{0}\", Player.life);\n        \/\/gameover.alpha = 0;\n        gameover.interactable = false;\n        gameover.alpha = 0;\n        gameover.blocksRaycasts = false;\n    }\n    \n    public void AddScore(int point)\n    {\n        this.score += point;\n        scoreText.text = string.Format(\"{0}\", score);\n    }\n\n    public void ChangeLife(int life)\n    {\n        lifeText.text = string.Format(\"{0}\", life);\n        if (life &lt;= 0)\n        {\n            gameover.interactable = true;\n            gameover.alpha = 1;\n            gameover.blocksRaycasts = true;\n        }\n    }\n\n    public void OnButtonGameReStart()\n    {\n        SceneManager.LoadScene(\"level1\");\n        Player.life = 3;\n    }\n}\n<\/code><\/pre>\n<h3>\n   <a id=\"5Player_172\"><br \/>\n   <\/a><br \/>\n   5.Player<br \/>\n  <\/h3>\n<pre><code class=\"prism language-c#\">using UnityEngine;\n\n[AddComponentMenu(\"MyGame\/Player\")]\npublic class Player : MonoBehaviour\n{\n    public float speed = 6.0f;\n    public Transform rocketBig;\n    public Transform rocketSmall;\n\n    public float rocketTime = 0;\n    public static int life = 3;\n    public AudioClip shootClip;\n    private AudioSource audioSource;\n    public Transform explosionFx;\n\n    public Transform fire1;\n    public Transform fire2;\n    public Transform fire3;\n\n    private void OnTriggerEnter(Collider other)\n    {\n        if (other.tag == TagsManager.ENEMY || other.tag == TagsManager.ENEMYROCKET)\n        {\n            life -= 1;\n            GameManager.instance.ChangeLife(life);\n            if (life &lt;= 0)\n            {\n                Instantiate(explosionFx, this.transform.position, Quaternion.identity);\n                Destroy(this.gameObject);\n            }\n        }\n    }\n\n    void Start()\n    {\n        audioSource = this.transform.GetComponent&lt;AudioSource&gt;();\n    }\n\n    void Update()\n    {\n        float movex = 0;\n        float movey = 0;\n        if (Input.GetKey(KeyCode.UpArrow))\n        {\n            movex += speed * Time.deltaTime;\n        }\n\n        if (Input.GetKey(KeyCode.DownArrow))\n        {\n            movex -= speed * Time.deltaTime;\n        }\n\n        if (Input.GetKey(KeyCode.LeftArrow))\n        {\n            movey -= speed * Time.deltaTime;\n        }\n\n        if (Input.GetKey(KeyCode.RightArrow))\n        {\n            movey += speed * Time.deltaTime;\n        }\n\n        if (this.transform.position.z + movex &gt;= 9 || this.transform.position.z + movex &lt;= -9 ||\n            this.transform.position.x + movey &gt;= 9 || this.transform.position.x + movey &lt;= -9)\n        {\n            return;\n        }\n\n        this.transform.Translate(new Vector3(movey, 0, movex));\n        rocketTime -= Time.deltaTime;\n        if (rocketTime &lt;= 0)\n        {\n            rocketTime = 0.1f;\n            if (Input.GetKey(KeyCode.Space) || Input.GetMouseButton(0))\n            {\n                Instantiate(rocketBig, this.transform.position, this.transform.rotation);\n                audioSource.PlayOneShot(shootClip);\n            }\n            else if (Input.GetMouseButton(1))\n            {\n                Instantiate(rocketSmall, fire1.position, this.transform.rotation);\n                Instantiate(rocketSmall, fire2.position, this.transform.rotation);\n                Instantiate(rocketSmall, fire3.position, this.transform.rotation);\n                audioSource.PlayOneShot(shootClip);\n            }\n        }\n    }\n}\n<\/code><\/pre>\n<h3>\n   <a id=\"6Rocket_265\"><br \/>\n   <\/a><br \/>\n   6.Rocket<br \/>\n  <\/h3>\n<pre><code class=\"prism language-c#\">using UnityEngine;\n\n[AddComponentMenu(\"MyGmme\/Rocket\")]\npublic class Rocket : MonoBehaviour\n{\n    public float speed = 6.0f;\n    public float power = 1.0f;\n    \n    void Update()\n    {\n        transform.Translate(new Vector3(0, 0, speed * Time.deltaTime));\n    }\n\n    private void OnBecameInvisible()\n    {\n        if (this.enabled)\n        {\n            Destroy(this.gameObject);\n        }\n    }\n\n    private void OnTriggerEnter(Collider other)\n    {\n        if (other.tag == TagsManager.ENEMY || other.tag == TagsManager.ENEMYROCKET)\n        {\n            Destroy(this.gameObject);\n        }\n    }\n}\n<\/code><\/pre>\n<h3>\n   <a id=\"7SuperEnemy_299\"><br \/>\n   <\/a><br \/>\n   7.SuperEnemy<br \/>\n  <\/h3>\n<pre><code class=\"prism language-c#\">using UnityEngine;\n\npublic class SuperEnemy : Enemy\n{\n    public Transform enemyRocket;\n    public float fireCoolDown = 1.0f;\n    private Transform player;\n\n    public override void updateMove()\n    {\n        fireCoolDown -= Time.deltaTime;\n        if (fireCoolDown &lt;= 0)\n        {\n            fireCoolDown = 1.0f;\n\n\n            if (player != null)\n            {\n                Vector3 relativePos = player.position - this.transform.position;\n                Instantiate(enemyRocket, this.transform.position, Quaternion.LookRotation(relativePos));\n            }\n\n            GameObject temp = GameObject.FindGameObjectWithTag(TagsManager.PLAYER);\n            if (temp != null)\n            {\n                player = temp.transform;\n            }\n        }\n\n        transform.Translate(new Vector3(0, 0, -speed * Time.deltaTime));\n    }\n\n    private void OnTriggerEnter(Collider other)\n    {\n        if (other.tag == TagsManager.PLAYEROCKET)\n        {\n            Rocket rocket = other.GetComponent&lt;Rocket&gt;();\n            if (rocket != null)\n            {\n                life -= rocket.power;\n                if (life &lt;= 0)\n                {\n                    GameManager.instance.AddScore(100);\n                    Destroy(this.gameObject);\n                }\n            }\n        }\n        else if (other.tag == TagsManager.PLAYER)\n        {\n            life = 0;\n            Destroy(this.gameObject);\n        }\n    }\n}\n<\/code><\/pre>\n<h3>\n   <a id=\"8TagsManager_358\"><br \/>\n   <\/a><br \/>\n   8.TagsManager<br \/>\n  <\/h3>\n<pre><code class=\"prism language-c#\">public class TagsManager\n{\n    public static string PLAYER = \"Players\";\n    public static string ROCKET = \"Rocket\";\n    public static string ENEMYROCKET = \"EnemyRocket\";\n    public static string PLAYEROCKET = \"PlayerRocket\";\n    public static string ENEMY = \"Enemy\";\n}\n<\/code><\/pre>\n<\/p><\/div>\n<link href=\"https:\/\/csdnimg.cn\/release\/blogv2\/dist\/mdeditor\/css\/editerView\/markdown_views-a5d25dd831.css\" rel=\"stylesheet\"\/>\n <link href=\"https:\/\/csdnimg.cn\/release\/blogv2\/dist\/mdeditor\/css\/style-e504d6a974.css\" rel=\"stylesheet\"\/>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u5c04\u51fb\u6e38\u620f 1.Enemy using UnityEngine; [AddComponentMenu(&#8220;MyGa [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":215,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[],"class_list":["post-3694","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-23"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>unity3D\u5c04\u51fb\u6e38\u620f - \u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51<\/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.wunen.com\/index.php\/2025\/06\/12\/unity3d\u5c04\u51fb\u6e38\u620f\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"unity3D\u5c04\u51fb\u6e38\u620f - \u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51\" \/>\n<meta property=\"og:description\" content=\"\u5c04\u51fb\u6e38\u620f 1.Enemy using UnityEngine; [AddComponentMenu(&quot;MyGa [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wunen.com\/index.php\/2025\/06\/12\/unity3d\u5c04\u51fb\u6e38\u620f\/\" \/>\n<meta property=\"og:site_name\" content=\"\u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51\" \/>\n<meta property=\"article:published_time\" content=\"2025-06-12T10:00:20+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"260\" \/>\n\t<meta property=\"og:image:height\" content=\"180\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"admin@wunen\" \/>\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@wunen\" \/>\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\":\"Article\",\"@id\":\"https:\/\/www.wunen.com\/index.php\/2025\/06\/12\/unity3d%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.wunen.com\/index.php\/2025\/06\/12\/unity3d%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f\/\"},\"author\":{\"name\":\"admin@wunen\",\"@id\":\"https:\/\/www.wunen.com\/#\/schema\/person\/d5f7a6cf545656a9c90d507e64452db8\"},\"headline\":\"unity3D\u5c04\u51fb\u6e38\u620f\",\"datePublished\":\"2025-06-12T10:00:20+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.wunen.com\/index.php\/2025\/06\/12\/unity3d%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f\/\"},\"wordCount\":10,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.wunen.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.wunen.com\/index.php\/2025\/06\/12\/unity3d%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg\",\"articleSection\":[\"\u5c04\u51fb\u6e38\u620f\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.wunen.com\/index.php\/2025\/06\/12\/unity3d%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wunen.com\/index.php\/2025\/06\/12\/unity3d%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f\/\",\"url\":\"https:\/\/www.wunen.com\/index.php\/2025\/06\/12\/unity3d%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f\/\",\"name\":\"unity3D\u5c04\u51fb\u6e38\u620f - \u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51\",\"isPartOf\":{\"@id\":\"https:\/\/www.wunen.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.wunen.com\/index.php\/2025\/06\/12\/unity3d%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.wunen.com\/index.php\/2025\/06\/12\/unity3d%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg\",\"datePublished\":\"2025-06-12T10:00:20+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.wunen.com\/index.php\/2025\/06\/12\/unity3d%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wunen.com\/index.php\/2025\/06\/12\/unity3d%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wunen.com\/index.php\/2025\/06\/12\/unity3d%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f\/#primaryimage\",\"url\":\"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg\",\"contentUrl\":\"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg\",\"width\":260,\"height\":180},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wunen.com\/index.php\/2025\/06\/12\/unity3d%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wunen.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"unity3D\u5c04\u51fb\u6e38\u620f\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wunen.com\/#website\",\"url\":\"https:\/\/www.wunen.com\/\",\"name\":\"\u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51\",\"description\":\"\u8f6f\u4ef6\u8d44\u8baf\u6765\u7269\u5ae9\",\"publisher\":{\"@id\":\"https:\/\/www.wunen.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wunen.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.wunen.com\/#organization\",\"name\":\"\u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51\",\"url\":\"https:\/\/www.wunen.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wunen.com\/#\/schema\/logo\/image\/\",\"url\":\"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/cropped-\u7269\u5ae9-1.png\",\"contentUrl\":\"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/cropped-\u7269\u5ae9-1.png\",\"width\":1024,\"height\":1024,\"caption\":\"\u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51\"},\"image\":{\"@id\":\"https:\/\/www.wunen.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wunen.com\/#\/schema\/person\/d5f7a6cf545656a9c90d507e64452db8\",\"name\":\"admin@wunen\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wunen.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d90ec1e3faf77c4d4e66e40c29b85ff6401161e0502f401dae2f0e25b38ce25e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d90ec1e3faf77c4d4e66e40c29b85ff6401161e0502f401dae2f0e25b38ce25e?s=96&d=mm&r=g\",\"caption\":\"admin@wunen\"},\"sameAs\":[\"http:\/\/www.wunen.com\"],\"url\":\"http:\/\/www.wunen.com\/index.php\/author\/adminwunen\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"unity3D\u5c04\u51fb\u6e38\u620f - \u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51","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.wunen.com\/index.php\/2025\/06\/12\/unity3d\u5c04\u51fb\u6e38\u620f\/","og_locale":"zh_CN","og_type":"article","og_title":"unity3D\u5c04\u51fb\u6e38\u620f - \u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51","og_description":"\u5c04\u51fb\u6e38\u620f 1.Enemy using UnityEngine; [AddComponentMenu(\"MyGa [&hellip;]","og_url":"https:\/\/www.wunen.com\/index.php\/2025\/06\/12\/unity3d\u5c04\u51fb\u6e38\u620f\/","og_site_name":"\u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51","article_published_time":"2025-06-12T10:00:20+00:00","og_image":[{"width":260,"height":180,"url":"https:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg","type":"image\/jpeg"}],"author":"admin@wunen","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin@wunen","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.wunen.com\/index.php\/2025\/06\/12\/unity3d%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f\/#article","isPartOf":{"@id":"https:\/\/www.wunen.com\/index.php\/2025\/06\/12\/unity3d%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f\/"},"author":{"name":"admin@wunen","@id":"https:\/\/www.wunen.com\/#\/schema\/person\/d5f7a6cf545656a9c90d507e64452db8"},"headline":"unity3D\u5c04\u51fb\u6e38\u620f","datePublished":"2025-06-12T10:00:20+00:00","mainEntityOfPage":{"@id":"https:\/\/www.wunen.com\/index.php\/2025\/06\/12\/unity3d%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f\/"},"wordCount":10,"commentCount":0,"publisher":{"@id":"https:\/\/www.wunen.com\/#organization"},"image":{"@id":"https:\/\/www.wunen.com\/index.php\/2025\/06\/12\/unity3d%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f\/#primaryimage"},"thumbnailUrl":"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg","articleSection":["\u5c04\u51fb\u6e38\u620f"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.wunen.com\/index.php\/2025\/06\/12\/unity3d%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.wunen.com\/index.php\/2025\/06\/12\/unity3d%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f\/","url":"https:\/\/www.wunen.com\/index.php\/2025\/06\/12\/unity3d%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f\/","name":"unity3D\u5c04\u51fb\u6e38\u620f - \u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51","isPartOf":{"@id":"https:\/\/www.wunen.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.wunen.com\/index.php\/2025\/06\/12\/unity3d%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f\/#primaryimage"},"image":{"@id":"https:\/\/www.wunen.com\/index.php\/2025\/06\/12\/unity3d%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f\/#primaryimage"},"thumbnailUrl":"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg","datePublished":"2025-06-12T10:00:20+00:00","breadcrumb":{"@id":"https:\/\/www.wunen.com\/index.php\/2025\/06\/12\/unity3d%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wunen.com\/index.php\/2025\/06\/12\/unity3d%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f\/"]}]},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wunen.com\/index.php\/2025\/06\/12\/unity3d%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f\/#primaryimage","url":"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg","contentUrl":"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg","width":260,"height":180},{"@type":"BreadcrumbList","@id":"https:\/\/www.wunen.com\/index.php\/2025\/06\/12\/unity3d%e5%b0%84%e5%87%bb%e6%b8%b8%e6%88%8f\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wunen.com\/"},{"@type":"ListItem","position":2,"name":"unity3D\u5c04\u51fb\u6e38\u620f"}]},{"@type":"WebSite","@id":"https:\/\/www.wunen.com\/#website","url":"https:\/\/www.wunen.com\/","name":"\u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51","description":"\u8f6f\u4ef6\u8d44\u8baf\u6765\u7269\u5ae9","publisher":{"@id":"https:\/\/www.wunen.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wunen.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-Hans"},{"@type":"Organization","@id":"https:\/\/www.wunen.com\/#organization","name":"\u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51","url":"https:\/\/www.wunen.com\/","logo":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wunen.com\/#\/schema\/logo\/image\/","url":"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/cropped-\u7269\u5ae9-1.png","contentUrl":"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/cropped-\u7269\u5ae9-1.png","width":1024,"height":1024,"caption":"\u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51"},"image":{"@id":"https:\/\/www.wunen.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.wunen.com\/#\/schema\/person\/d5f7a6cf545656a9c90d507e64452db8","name":"admin@wunen","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wunen.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d90ec1e3faf77c4d4e66e40c29b85ff6401161e0502f401dae2f0e25b38ce25e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d90ec1e3faf77c4d4e66e40c29b85ff6401161e0502f401dae2f0e25b38ce25e?s=96&d=mm&r=g","caption":"admin@wunen"},"sameAs":["http:\/\/www.wunen.com"],"url":"http:\/\/www.wunen.com\/index.php\/author\/adminwunen\/"}]}},"_links":{"self":[{"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/posts\/3694","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/comments?post=3694"}],"version-history":[{"count":0,"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/posts\/3694\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/media\/215"}],"wp:attachment":[{"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/media?parent=3694"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/categories?post=3694"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/tags?post=3694"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}