private void OnSliderValueChanged(float amount) { float moneyAmount = Mathf.Lerp(AppConfig.current.minMoney, AppConfig.current.maxMoney, amount); foreach (MoneyPrefabTuple tuple in AppConfig.current.lootBoxPrefabs) { if (tuple.money > moneyAmount) { break; } changeCandidate = tuple; } changeTime = 0.0f; }
private void ChangeLootboxPrefab() { if (changeCandidate == currentSelectedTuple) { return; } currentSelectedTuple = changeCandidate; if (lootBoxObject != null) { Destroy(lootBoxObject); } GameObject inst = GameManager.Instantiate(currentSelectedTuple.prefab, lootBoxImmediateParent); inst.transform.localPosition = Vector3.zero; inst.transform.rotation = Quaternion.identity; lootBoxObject = inst; }