「!IsPlayingOrEditMode ()」不明なバグ Unity
「GameObject:SendMessage」を使用してて!IsPlayingOrEditMode () UnityEngine.GameObject:SendMessage(String, Object) 〜〜
http://forum.unity3d.com/threads/9299-Unity-Error-!IsPlayingOrEditMode/page2
こちらでも原因わかってなさそう。Googleでも3件(2011/9/30 5:02 現在) しかヒットしない。
GameObject.Find("HogeObj").gameObject.SendMessage("HogeFunc", 1);
私の予想では動的なGameObjectへSendMessageした時だと思われる。
if (!Application.isPlaying) return; GameObject.Find("HogeObj").gameObject.SendMessage("HogeFunc", 1);
↑一応解決というか応急処置は、直前にプレイ中でないときは returnsすればいい。
Windows7 スリープ解除 Unity
- 設定がわかりにくいのでメモ
http://dekiru.impress.co.jp/contents/201/20135.htm
マネタイズ系のBlog
http://dev.classmethod.jp/etc/android-marketing-manetization-seminar-report/
http://hachimitu.jp/blog/archives/2009/06/25215652.html
マテリアル変更によりスプライト変更 C# Unity
- 宣言
public Material targetMaterial;
- 実際
this.gameObject.renderer.material = targetMaterial;
画面内ランダムウォーク C# Unity
- マジックナンバーは自分で調整
// 宣言部 private int rndmakeCnt; private int rndmakeCntMax; private Vector3 targetPos; private Vector3 screenSpace; private Vector3 curScreenSpace; private Transform mytrans;
void Start () { mytrans = this.transform; } void Update () { if (rndmakeCntMax < rndmakeCnt) { rndmakeCntMax = Random.Range(220, 322); // ランダム周期(数字を変えて調整) screenSpace = Camera.main.WorldToScreenPoint(mytrans.position); curScreenSpace = new Vector3(Screen.width, Screen.width, screenSpace.z); Vector3 worldPos = Camera.main.ScreenToWorldPoint(curScreenSpace); targetPos = new Vector3(Random.Range(-worldPos.x/2, worldPos.x/2), Random.Range(-worldPos.y/2, worldPos.y/2), 0); rndmakeCnt = 0; } rndmakeCnt++; mytrans.position += (targetPos - mytrans.position) * 0.008F; // 数字を変えて調整