Entries from 2015-04-01 to 1 month

音楽を再生する。

Audiosouceを入れているスクリプトとGameManagerを使って、音楽を再生する。スクリプトからだと、clipを指定してあげるだけではダメで再生(Play())してあげなければならない。 using UnityEngine; using System.Collections; public class AudioSourceScript…

bool変数を使って、ボタンの制限をかける。

オブジェクトを開いている干渉しないようにする。 画面上に複数のbuttonオブジェクトがある場合、何かを開いている時に他を押せないようにする。 public class Shop : MonoBehaviour { public bool ShopClicked; public void ShopButton(){ // buttonを押し…

Toggle(UI)の使用例

トグル(Toggle)を用いた音楽の設定例 オーディオソースのスクリプトで… 音楽の再生はトグルに依存するように設定する。 using UnityEngine; using UnityEngine.UI; using System.Collections; public class AudioManager : MonoBehaviour { public AudioSo…

iTween使用例

iTween使用例 //指定したポジションに。 iTween.MoveTo (this.gameObject, iTween.Hash("y",-1.5,"time", 1f)); //指定した大きさに。 iTween.ScaleTo (FrontRoom.gameObject, iTween.Hash("x",1,"time",0.5f)); //指定した大きさ・方向に揺れ iTween.ShakeP…

Screen.SetResolutionを使ってパフォーマンスを向上

using UnityEngine; using System.Collections; public class screenScript : MonoBehaviour { void Awake () { Screen.SetResolution (480, 800, false); // camera.aspect = 10f / 16.5f; } } 解像度を下げてパフォーマンスを得る - テラシュールブログtsu…

動作を確認したい時

メソッドの確認、bool型の変数の状態の確認 void Update(){ print("GameOver.GameOverFlag =" +GameOver.GameOverFlag); if(Input.GetKeyDown(KeyCode.S)){ ReplayButton(); } } 2014/05/05追記 コンソールにprintで出力したい時、Update()に書く、printは一…

【Unity ネタ】東大TV「Unity の開発環境が生み出す可能性(2013)」

ちょっと古いけど、Unityネタとして。 todai.tv

iTween.ScaleTo、ポップアップに使える!

使えるiTween iTween.ScaleTo (Player, iTween.Hash("x",0.25,"y",0.25,"time",0.5f));

UnityにWebを埋め込む

tips.hecomi.com

Rigidbody

物理挙動・摩擦UnityのRigidBodyや物理特性マテリアル設定castot09.seesaa.net

【Unity エラー】CS0201 : 演算子の間違い

error CS0201: Only assignment, call, increment, decrement, and new object expressions can be used as a statementgameObject.transform.tag=="ballRed"; これで解決、比較演算子ではない時(代入するとき)「=」 gameObject.transform.tag="ballRed"; …

【Unity エラー】CS0103 : タイプミスの可能性

テキストに書かれていない、認識できないものがある。例1 (タイプミス) error CS0103: The name `cal' does not exist in the current context if(cal.gameObject.transform.tag == "floorUpper"){ floor_Below = false; } 「col」の書き間違え例2 Assets/…

【C#】インクリメント、デクリメント

1つだけ足したり、1つだけ引くことはよくある 特別な書き方 x++; x--; //以下に等しい x = x + 1; x = x - 1; 例2 Score.instance.ScorePont++;

【Unity エラー】CS1612 : Mathf.Clamp

エラー内容 どうも一回要素を取り出してあげなければならないようだ。 Assets/Script/_Script_player2/PlayerManager.cs(20,35): error CS1612: Cannot modify a value type return value of `UnityEngine.Transform.position'. Consider storing the value …

foreach

int[] list = new int[]{1,2,3,4,5}; for (int i = 0, i < list.Length; i++){ } foreach(var item in list){ } www.youtube.com

【C#】デリゲートとは

複数のメソッドを渡すことができる デリゲートとは関数を入れられる変数である kan-kikuchi.hatenablog.com [C#] デリゲート(delegate)とはなんぞや – gomokulog 連載:C#入門 第17回 処理を委譲するdelegate 連載:C#入門 第13回 言語に内蔵されたイベント…

Untiy iTweenのeasetype

iTween.PunchScale(gameObject,iTween.Hash("amount",new Vector3(0.06f,0.06f,0),"time",1.7f,"easetype",iTween.EaseType.linear)); ActionScript入門Wiki - Unity - トゥイーンライブラリiTweenを使用するwww40.atwiki.jpiTweenでEaseTypeを設定する際に…

【Unity エラー】CS0104 : 競合が発生している

`UnityEngine.Random'と `System.Random'のどちらの"Random"か明言してあげないといけない。 `Random' is an ambiguous reference between `UnityEngine.Random' and `System.Random' Unityでゲーム開発 -C#で乱数- wonderpla.net

アプリのグローバル動向

www.metaps.com

アプリストア最適化(ASO)

アプリ命名 アプリストア最適化を意識して名前を決める。 注意点 1. GooglePlayとAppStoreで検索でひっかかる要素が異なる(どちらもタイトルは重要) 2. メインキーワードはタイトルに含めることは必須 3. 運用している間もタイトルが適切か考える必要。 [U…

【Xcode エラー】Archiveできない

iOSアプリ作成までの道が長い...。 [Xcode4.5.2] Application Loader の場所 : はじめてのMacBook Air ios - Xcode 6 crashes when validating or submitting app archive - Stack Overflow アップルのデベロッパーガイド(日本語!) https://developer.app…

【Xcode エラー】iOSビルドを作成

.ipaのビルドデータを作成する時、"Product"=>"Archive"から出力する。 ("Product"=>"Build"からでは".ipa"は生成されない。) また、キーチェーンアクセスがないとビルドできない。 「keychain Access.app」を開いて「iPhone Developer」「iPhone Distribu…

【iOS】Splash Screen

iOSのSplashをサイズを変えずに設定すると画像が良くない、伸びたり画素数が適切でなかったりする。それぞれ画像サイズを作成する必要がある。 iPhone 1–3 (portrait) 320 x 480 iPhone 4s 640 x 960 iPhone 6 and iPhone 5 640 x 1136 iPad 2 and iPadmini …

【iOS】App Storeへのアプリの登録手順

www.tamurasouko.com

オブジェクトをインスタンスする。(Listについて)

インスタンスについて! public List<GameObject> heart; public GameObject myheart; public Sprite HeartOn; // Spawnは生成するというような意味 public void SpawnHeartFirst(int startCountHeart){ for(int i=startCountHeart;i<5;i++){ // オブジェクトを生成する</gameobject>…

UnityAnalytics

UnityでGoogleAnalyticsを使う - Qiitaqiita.com Unity で Google Analytics を使う - nirasan's tech blognirasan.hatenablog.com

【Xcode エラー】「Build Phases」「Libraries」を出し入れしてエラー解消?!

エラー内容 ld: warning: directory not found for option '-L"/Users/yamakami/Desktop/iOS_marubatsu_plathome_device3/Libraries"' ld: library not found for -liPhone-lib clang: error: linker command failed with exit code 1 (use -v to see invoca…

【iOS】 "Player settings", "optimization"設定

オプティマイゼーション Api Compatibility Level アクティブ.NET APIのプロフィールを指定 .Net 2.0 .Net 2.0ライブラリ。最大の.net互換性、大きいファイルサイズ .Net 2.0 Subset 全体の一部の.net互換性、小さいファイルサイズ AOT compilation options …

【Xcode】プロパティの設定する際の注意点

注意点一覧1. 「General」=>「Identity」=>「Version」==ユーザーが見える 2. 「General」=>「Identity」=>「Build」== ユーザーが見える 3. 「code signing」=>「code signing Identity」を適切なものに変える。 4. 「code signing」=>「provisioning Ident…

【Xcode】Deviceタブは"Destination"から選択

「Product」「Destination」「Ineligible Devices」から選択することで選ぶ