public void OnAddForceCharacter() { FoodPartsData partsdata = FoodPartsData.GetData(character.GetComponent <CharacterAnim>().GetPartsId()); rb2 = character.GetComponent <Rigidbody2D>(); rb2.gravityScale = 0.7f; var vector = new Vector2(90 - vectorPower, vectorPower); var gauge = gaugePower * 8; var weight = -3 + partsdata.weight; var wind = windPower * 0.5f; var force = vector * (Constant.GameMain.DefaultPower + gauge - weight + wind); //合計hが6が中央値 rb2.AddForce(force); Debug.Log("weight = " + weight); Debug.Log("windpower = " + windPower); }
public void SetCharacter() { var obj = Instantiate(Resources.Load <GameObject>(Constant.Path.Resources.GameMainPrefabs + "Character")); obj.GetComponent <CharacterAnim>().SetPartsId("parts" + foodId[GameMainManager.achievementCount]); //ゲームの進行度でパーツを変える obj.transform.position = setPosition.position; obj.GetComponent <CharacterAnim>().SetMoveEndPosition(moveEndPosition); //重さ FoodPartsData foodData = FoodPartsData.GetData("parts" + foodId[GameMainManager.achievementCount]); weightText.text = foodData.weight.ToString(); //風 wind = Random.Range(0, burgerData.windLevel + 1); forceController.SetWindPower = wind; windText.text = wind.ToString(); forceController.Setcharacter(obj); }
private void Start() { //foodPartsId = "parts8"; //仮設定 FoodPartsData data = FoodPartsData.GetData(foodPartsId); idol_1 = data.idolSprite_1; idol_2 = data.idolSprite_2; charge = data.chargeSprite; fly = data.flySprite; character = GetComponent <SpriteRenderer>(); character.sprite = idol_1; charaStatus = 2; idolCount = 0; transform.DOMove(moveEndPosition.position, 1.0f); Invoke("ChangeIdolStand", 1.0f); }
private void Start() { FoodPartsData data = FoodPartsData.GetData(foodpartsId); characterImage.sprite = data.idolSprite_1; }