<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>uni-mal</author_name>
  <author_url>https://blog.hatena.ne.jp/uni-mal/</author_url>
  <blog_title>Unityでインディゲームを作る！</blog_title>
  <blog_url>https://indie-game-creation-with-unity.hatenablog.com/</blog_url>
  <categories>
    <anon>UnityのためのC#</anon>
  </categories>
  <description>下から叩くと画面を揺らし、画面上にいる敵キャラを全部倒す、というブロックをUnity2Dで再現してみました！一気に敵を一掃できる爽快感溢れるアクションになりますが、これを上手くやるためにはカメラを揺らすだけでなく、ポリモーフィズムと継承を上手く活用する必要があります。 敵キャラをまとめて処理 敵キャラといっても、様々なキャラがいます。マリオで言えばクリボー、ノコノコをはじめとした多くのキャラクタがおり、多様な動きをしています。 クラスを横断する一括処理を実現させるにはポリモーフィズム を使います。いろいろな敵キャラを&quot;ひとまとめ&quot;にし、一括して処理する必要があるからです。 つまり、&quot;衝撃波で攻…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Findie-game-creation-with-unity.hatenablog.com%2Fentry%2Fshaking-box-unity2d&quot; title=&quot;カメラを揺らして、画面上の敵を振動で倒すブロックを作る！| Unity 2D ポリモーフィズム 継承 - Unityでインディゲームを作る！&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://cdn-ak.f.st-hatena.com/images/fotolife/m/miur-us/20180601/20180601003622.gif</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2018-06-01 10:00:00</published>
  <title>カメラを揺らして、画面上の敵を振動で倒すブロックを作る！| Unity 2D ポリモーフィズム 継承</title>
  <type>rich</type>
  <url>https://indie-game-creation-with-unity.hatenablog.com/entry/shaking-box-unity2d</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
