Similar documents
しずおかアプリ部 Unity はじめるよ すごいよサウンド機能 実践編 統合開発環境を内蔵したゲームエンジン いろんな職業の が る資料なので説明を簡単にしてある部分があります 正確には本来の意味と違いますが上記理由のためです ご了承ください この

PowerPoint プレゼンテーション

4名連記 P1-21

1.中山&内田 P1-9

2016 VOCALOID Group, Yamaha Corporation 2

ol_

WPF アプリケーションの 多言語切替

TOEIC

2 ColorSpace DepthSpace CameraSpace Kinect V2 Kinect V2 BOdyIndex 3. NtKinect Kinect V2 C++ NtKinect [4] NtKinect = Kinect SDK + + STL(C++) + OpenCV +


平成 29 年度卒業研究 初心者のためのゲームプログラミング用 教材の開発 函館工業高等専門学校生産システム工学科情報コース 5 年 25 番細見政央指導教員東海林智也

VB.NETコーディング標準

_TJ…X…g†[…fi_0216


ONPRESS190

広報しもつけp01ol

A, K, Q, J, 10, 9, 8, 7, 6, 5, 4, 3,

Unite2016Tokyo-yasuhara.key

学校では教えてくれないアセットバンドル

8 if switch for while do while 2

caimmetal03.key

10/31 Java AWTの基本構造(Frameクラスの継承) 演習課題資料

Java演習(4) -- 変数と型 --

第26回_プレゼン資料_菅原(Unityはじめるよ~NavMesh基礎~)

第33回_プレゼン資料_菅原(~IKを使ってアニメーションをコントロール~)

WPF アプリケーションの 多言語切替

19 3!! (+) (>) (++) (+=) for while 3.1!! (20, 20) (1)(Blocks1.java) import javax.swing.japplet; import java.awt.graphics;

プロセス間通信

10K pdf


Microsoft Word - tyukan

: : : TSTank 2

C#の基本2 ~プログラムの制御構造~

このアセットがスゴい!2016 Unity を進化させるアセット達 シージャイル株式会社 VR 室室長島田侑治

3.1 stdio.h iostream List.2 using namespace std C printf ( ) %d %f %s %d C++ cout cout List.2 Hello World! cout << float a = 1.2f; int b = 3; cout <<

Condition DAQ condition condition 2 3 XML key value

ウィンドウ操作 応用

つるい27-5月号PDF.indd

1 C STL(1) C C C libc C C C++ STL(Standard Template Library ) libc libc C++ C STL libc STL iostream Algorithm libc STL string vector l

3.2. Unity Unity の画面構成 Unity を起動すると以下の図 1 のような画面が表示される 図 1 Unity のインターフェース Unity の画面は主に以下のように分けられる ① Scene View Game View Scene View には作成するゲーム内

データ構造とアルゴリズム論

K227 Java 2

02

Unity講座①

Microsoft Word - keisankigairon.ch doc

DEMO1 まずはやってみよう アクティビティをダブルクリック 作成 - プロジェクト C# => Workflow CodeActivity をぽとぺ シーケンシャルと ステートマシン それぞれのコ ンソールアプリ あとライブラリがある びっくりマークは足りていないあかし プロパティをみると判別で

C のコード例 (Z80 と同機能 ) int main(void) { int i,sum=0; for (i=1; i<=10; i++) sum=sum + i; printf ("sum=%d n",sum); 2

アルゴリズムとデータ構造1

新版明解C言語 実践編

@(h) Select.vb ver 1.1 ( Select.vb ver 1.0 ( Option Explicit Private Structure SYMBOLINFO Dim SyDataType As String Dim

(STL) STL 1 (deta structure) (algorithm) (deta structure) 2 STL STL (Standard Template Library) 2.1 STL STL ( ) vector<int> x; for(int i = 0; i < 10;


PowerPoint プレゼンテーション

ロート製薬株式会社

新・明解Java入門

VB 資料 電脳梁山泊烏賊塾 音声認識 System.Speech の利用 System.Speech に依るディクテーション ( 音声を文字列化 ).NetFramework3.0 以上 (Visual Studio 2010 以降 ) では 標準で System.Speech が用意されて居るの

1-4 int a; std::cin >> a; std::cout << "a = " << a << std::endl; C++( 1-4 ) stdio.h iostream iostream.h C++ include.h 1-4 scanf() std::cin >>

第47回_プレゼン資料_菅原(~よく人に質問されるTIPSと冬休みに勉強した技術紹介~)

10/ / /30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20 6. http, CGI Perl 11/27 7. ( ) Perl 12/ 4 8. Windows Winsock 12/11 9. JAV

JavaプログラミングⅠ

目的 泡立ち法を例に Comparableインターフェイスの実装 抽象クラスの利用 型パラメタの利用 比較 入替 の回数を計測

解きながら学ぶC++入門編

TestDesign for Web

Microsoft Word - material_3_object.docx

PowerPoint プレゼンテーション

JUnit 概要 2015/4/16 版今泉俊幸 2015 bbreak Systems 1

Prog2_9th

スライド 1

Transcription:

using UnityEngine; using System.Collections; namespace Monolizm { /// <summary> /// フェイスアニメーション管理クラス. /// </summary> public class FaceAnimationController : MonoBehaviour { #region public enumerate ----------------------------------------------------------------- /// <summary> /// 目の種類. /// </summary> public enum EyeTypes:int { Default, /// デフォルト. Angry, /// 怒ってる. Blink, /// 瞬き. Close, /// 閉じている. Open, /// 見開いている. Dizzy, /// フラフラ. Happy, /// 嬉しい. Hmm, /// ふーん. Feel, /// 感じる. Wink, /// ウィンク. Dot, /// 目が点. Wet, /// 潤んでる. Surprised, /// 驚き. Boast, /// 自慢. NUM, /// 目の種類数. } /// <summary> /// 口の種類. /// </summary> public enum MouthTypes:int { Default, /// デフォルト. Smile, /// 笑顔. A, /// あ. I, /// い. U, /// う. E, /// え. O, /// お. Happy, /// 嬉しい. Nmm, /// ん. Chu, /// チュ. NUM, /// 口の種類数. } #endregion #region public variable ------------------------------------------------------------------ public Material EyeMaterial; /// 目のマテリアル public Material MouthMaterial; /// 口のマテリアル public Vector2 EyeAtlasSize; /// 目テクスチャ内の一つのマップサイズ. public Vector2 MouthAtlasSize; /// 口テクスチャ内の一つのマップサイズ. #endregion #region private variable ----------------------------------------------------------------- /// <summary> /// アニメーション情報 /// </summary> private struct AnimationInfo { public Vector2 TextureSize; /// テクスチャのサイズ. public Rect Atlas; /// アトラス情婦. public int Type; /// 種類. public Material Mat; /// マテリアル. public int VNum; /// 縦方向のアトラス数 public int HNum; /// 横方向のアトラス数 } private AnimationInfo m_eyeinfo; /// 目のアニメーション情報 private AnimationInfo m_mouthinfo; /// 目のアニメーション情報 #endregion

#region Unity MonoBehaviour OverRide------------------------------------------------------ void Awake () { // 目のテクスチャ情報 m_eyeinfo.mat = EyeMaterial; Texture texture = m_eyeinfo.mat.maintexture; m_eyeinfo.texturesize.x = texture.width; m_eyeinfo.texturesize.y = texture.height; m_eyeinfo.atlas.width = EyeAtlasSize.x; m_eyeinfo.atlas.height = EyeAtlasSize.y; m_eyeinfo.vnum = (int)(m_eyeinfo.texturesize.y / m_eyeinfo.atlas.height); m_eyeinfo.hnum = (int)(m_eyeinfo.texturesize.x / m_eyeinfo.atlas.width); // 口のテクスチャ情報 m_mouthinfo.mat = MouthMaterial; texture = m_mouthinfo.mat.maintexture; m_mouthinfo.texturesize.x = texture.width; m_mouthinfo.texturesize.y = texture.height; m_mouthinfo.atlas.width = MouthAtlasSize.x; m_mouthinfo.atlas.height = MouthAtlasSize.y; m_mouthinfo.vnum = (int)(m_mouthinfo.texturesize.y / m_mouthinfo.atlas.height); m_mouthinfo.hnum = (int)(m_mouthinfo.texturesize.x / m_mouthinfo.atlas.width); } #endregion #region public methods ------------------------------------------------------------------- /// <summary> /// 目の種類を変更. /// </summary> /// <param name="type">type.</param> public void ChangeEyeType(EyeTypes type) { m_eyeinfo.type = (int)type; // 座標を求める m_eyeinfo.atlas.x = ((int)type / m_eyeinfo.vnum); m_eyeinfo.atlas.y = ((int)type - (m_eyeinfo.atlas.x * m_eyeinfo.vnum)); m_eyeinfo.atlas.x *= m_eyeinfo.atlas.width; m_eyeinfo.atlas.y *= m_eyeinfo.atlas.height; // UV 座標計算 Vector2 offset; offset = new Vector2(m_eyeInfo.Atlas.x / m_eyeinfo.texturesize.x, 1.0f-(m_eyeInfo.Atlas.y / m_eyeinfo.texturesize.y)); // 適用 m_eyeinfo.mat.settextureoffset("_maintex", offset); } /// <summary> /// 口の種類を変更. /// </summary> /// <param name="type">type.</param> public void ChangeMouthType(MouthTypes type) { m_mouthinfo.type = (int)type; // 座標を求める m_mouthinfo.atlas.x = ((int)type / m_mouthinfo.vnum); m_mouthinfo.atlas.y = ((int)type - (m_mouthinfo.atlas.x * m_mouthinfo.vnum)); m_mouthinfo.atlas.x *= m_mouthinfo.atlas.width; m_mouthinfo.atlas.y *= m_mouthinfo.atlas.height; // UV 座標計算 Vector2 offset; offset = new Vector2(m_mouthInfo.Atlas.x / m_mouthinfo.texturesize.x, 1.0f-(m_mouthInfo.Atlas.y / m_mouthinfo.texturesize.y)); // 適用 m_mouthinfo.mat.settextureoffset("_maintex", offset); } #endregion #region private methods ------------------------------------------------------------------ #endregion } }