やまめも

【 ゲーム開発・日々のことについて 】

gameObject.rigidbody2D.AddForce(Vector2.up * 300);

IEnumerator EmptyOpen(){
	Parent = CurrentSituation.gameObject.transform.parent.gameObject;

	if (CurrentSituation.Tag == "Empty") {
		yield return new WaitForSeconds(0.3f);
		CurrentSituation.Empty(LevelManager.instance.Level,CurrentSituation.CharaNumber);
		yield return new WaitForSeconds(0.3f);
		if(ObjectFromToilet.transform.tag == "Item"){

			Item = Instantiate(ItemPrefab) as GameObject;
			Item.transform.position = new Vector2(0.95f, -1f);
			Item.transform.name ="Item";
			Item.rigidbody2D.AddForce(Vector2.up * 300);
			yield return new WaitForSeconds(0.5f);
			Item.transform.SetParent(ObjectFromToilet.transform);
		}
		SituationCreater2.instance.CorrectSwipe();
		CurrentSituation.isCorrect = true;
		Destroy(Item, 0.5f);
	}
}

qiita.com
qiita.com
チラシの裏的備忘録: Unity基本メソッド覚書


www40.atwiki.jp