【3Dゲームエンジン】Unity質問スレッド21 [転載禁止]©5ch.net
■ このスレッドは過去ログ倉庫に格納されています
0893名前は開発中のものです。
2016/01/07(木) 18:51:42.56ID:yWUOEVzg同時押しした場合、Xキーの弱ショットのみ出すという方法はどなたがご存知ありませんか?
一応、大体こんな感じのコードでやっております。
if (Input.GetKeyDown (KeyCode.Z) )
{
GameObject clone = Instantiate (bullet, transform.position, Quaternion.identity) as GameObject; //弾の生成
clone.GetComponent<Rigidbody2D> ().velocity = new Vector2 (0, 15); //弾をy軸15へ飛ばす
}
if (Input.GetKeyDown (KeyCode.X) )
{
GameObject clone = Instantiate (bullet2, transform.position, Quaternion.identity) as GameObject; //弾の生成
clone.GetComponent<Rigidbody2D> ().velocity = new Vector2 (0, 15); //弾をy軸15へ飛ばす
}
■ このスレッドは過去ログ倉庫に格納されています