public void 正しく読み取れる100円Version() { var managedMoney = new MoneyController(); managedMoney.PutMoney(Coin.Create(100)); Assert.AreEqual(100, managedMoney.Total); }
// Use this for initialization void Start() { moneyController = FindObjectOfType <MoneyController>(); moneyText.text = "Money: " + moneyController.Money.ToString(); moneyController.MoneyChanged += MoneyChanged; ParkingSlot.UnlockPriceChanged += UnlockPriceChanged; }
public void Interact(InteractController interactController) { MoneyController moneyController = interactController.gameObject.GetComponent <MoneyController>(); if (keyRequirement) { if (moneyController.HasKey()) { moneyController.SetKey(false); open = true; GetComponent <AudioSource>().Play(); if (newEnemySpawnGroup != null) { GameObject.Find("WaveManager").GetComponent <WaveManager>().AddSpawns(newEnemySpawnGroup); } } } else if (moneyCost <= moneyController.GetMoney()) { moneyController.DeductMoney(moneyCost); open = true; GetComponent <AudioSource>().Play(); if (newEnemySpawnGroup != null) { GameObject.Find("WaveManager").GetComponent <WaveManager>().AddSpawns(newEnemySpawnGroup); } } }
//public void ShowLifeAd() //{ // //isLifeAd = true; // //if (!isLifeAdShown && Advertisement.IsReady("rewardedVideo") && player.hitPoints < player.hitPointsMaximum) // //{ // // adText.text = lifeAdText; // // adButton.interactable = true; // // anim.SetBool("ShowAd", true); // //} //} public void ShowMoneyAd() { bool giveFreeMoney = PlayerInfo.info.CanGiveFreeMoney(); if (giveFreeMoney) { giveFreeMoney = Advertisement.IsReady("rewardedVideo"); } if (giveFreeMoney) { isMoneyAd = true; anim.SetBool("ShowFreeMoneyAd", true); adMoneyButton.interactable = true; PlayerPrefs.DeleteKey("freeMoneySum"); freeMoneySum = PlayerPrefs.GetInt("freeMoneySum", 0); if (freeMoneySum == 0 || isFreeMoneyTaken) { freeMoneySum = MoneyController.RoundSumWithZeroes(Random.Range(100, maxAdRewardMoneySum), 1); PlayerPrefs.SetInt("freeMoneySum", freeMoneySum); PlayerPrefs.Save(); isFreeMoneyTaken = false; } adMoneyText.text = freeMoneySum.ToString(); } }
public void 投入金額と投入金額総計が一致するかテスト(int insertNum, int exp1, int exp2, int exp3, int exp4) { //投入するお金を用意 this.SetMoneyNum(insertNum); var target = new MoneyController(); //10円*1を投入 target.InputMoneyAdd(this.yen10); var expect = exp1; var actual = target.InputMoneySum(); Assert.AreEqual(expect, actual); //50円を投入 target.InputMoneyAdd(this.yen50); expect = exp2; actual = target.InputMoneySum(); Assert.AreEqual(expect, actual); //100円を投入 target.InputMoneyAdd(this.yen100); expect = exp3; actual = target.InputMoneySum(); Assert.AreEqual(expect, actual); //500円を投入 target.InputMoneyAdd(this.yen500); expect = exp4; actual = target.InputMoneySum(); Assert.AreEqual(expect, actual); }
private void Start() { currentAction = null; modeController = world.modeController; moneyController = world.money; }
public void NextLevelButtonAction() { ClosePanel(); MoneyController.Increment(MoneyController.instance.earnedMoney); CanvasManager.instance.moneyTxt.text = "" + MoneyController.GetMoney(); LevelManager.LoadNextLevel(); }
public PopulationUpdater(CountryController country, PopulationController population, MoneyController money, MapController map) { _country = country; _population = population; _money = money; _map = map; }
void Start() { mc = GetComponent <MoneyController>(); lc = GetComponent <LightController>(); uic = GetComponent <UIController>(); sc = GetComponent <SoundController>(); }
void Awake() { if (Instance == null) { Instance = this; } else if (Instance != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); BoostController = new BoostController(_boostView); MoneyController = new MoneyController(_moneyView, BoostController); ShopController = new ShopController(_listOfBoosts, _shopView); ManagerController = new ManagerController(_listOfManagers, _managerView); if (_useClearSavegame) { PlayerPrefs.SetFloat("money", 3000); } float oldMoney = PlayerPrefs.GetFloat("money"); MoneyController.AddMoney(oldMoney); }
public void OnClickDepositButton( float price, int value ) { if (string.IsNullOrEmpty(_moneySetting.identifierDepositClientId) || string.IsNullOrEmpty(_moneySetting.identifierDepositClientSecret)) { Debug.LogError("インストーラーの設定でデバッグ機能が無効化されています"); } StartCoroutine( MoneyController.Deposit( _moneySetting.identifierDepositClientId, _moneySetting.identifierDepositClientSecret, _moneySetting.moneyNamespaceName, _session.AccessToken.userId, _slot, price, value, _moneySetting.onDeposit, _moneySetting.onError ) ); }
public JsonResult TransferToChinese(long number) { MoneyContext context = new MoneyContext(number); MoneyController uco = new MoneyController(); uco.TransferToChinese(ref context); return(Json(context.ToChinese(), JsonRequestBehavior.AllowGet)); }
public MoneyInteface(OutputController output, ContextController context, CountryController country, MoneyController money, TimeController time) { _out = output; _context = context; _country = country; _money = money; _time = time; }
void Start() { //Getting the TurrentController GameObject , to access the TurrentControl script temp = GameObject.Find("TurrentController"); TC = temp.GetComponent <TurrentControl>(); Money = GameObject.Find("Money").GetComponent <MoneyController>(); //getting the MoneyController Scipt standard = gameObject.GetComponent <Renderer> ().material.color; }
void Start() { healthFinal = health; Money = GameObject.Find("Money").GetComponent <MoneyController>(); //getting the MoneyController SCript LC = GameObject.Find("Life").GetComponent <LifeController>(); //same for life HealthBar = transform.GetChild(0).GetComponent <Image>(); originalSpeed = speed; }
void Start() { moneyController = moneyControllerObject.GetComponent(typeof(MoneyController)) as MoneyController; buildingsController = GameObject.Find("BuildingsController").GetComponent <BuildingsController>(); mapController = GameObject.Find("MapController").GetComponent <MapController>(); defaultRotation = Quaternion.Euler(new Vector3(-90, 0, 0)); roadsOnlyNavMesh = GameObject.Find("RoadsOnlyNavMesh").GetComponent <NavMeshSurface>(); buildingDisplayer = GameObject.Find("ConstructingBuildingsDisplayer").GetComponent <ConstructingBuildingDisplayer>(); uiController = GameObject.Find("GameUI").GetComponent <UIController>(); }
// Use this for initialization void Start() { gameController = GameObject.FindWithTag("GameController").GetComponent <GameController>(); enemyController = GetComponent <EnemyController>(); moneyController = GameObject.FindWithTag("Money UI").GetComponent <MoneyController>(); healthBar = transform.GetChild(1).GetChild(0).GetComponent <EnemyHealthBar>(); waveCounterUI = GameObject.FindWithTag("Wave Counter UI").GetComponent <WaveCounterUI>(); health = 100; }
// Use this for initialization void Start() { score = 0; baseHealth = 0; scoreController = GameObject.Find("ScoreInfo").GetComponent <ScoreController>(); moneyController = GameObject.Find("GoldInfo").GetComponent <MoneyController>(); baseHpController = GameObject.Find("BaseInfo").GetComponent <BaseHpController>(); startingMoney = money = 500; towerMarker.SetActive(false); }
} // The instance to reference #endregion #region Events // Awake is called before Start private void Awake() { if (Instance == null) { Instance = this; } else { Destroy(this); } }
public void TestMoneyCallback() { _moneyController = new MoneyController(100); long value = 0; _moneyController.OnValueChange += delegate(long oldValue, long currentValue) { value = currentValue; }; _moneyController.MoneyAmount += 100; Assert.AreEqual(200, value); Assert.AreEqual(200, _moneyController.MoneyAmount); }
void UpdateSelectionObjectMaterial() { if (gridObject.CanBuild(Vector2.zero) && MoneyController.CanBuy(cost)) { selection_object.gameObject.GetComponent <Renderer>().material = selectionMaterialValid; } else { selection_object.gameObject.GetComponent <Renderer>().material = selectionMaterialInvalid; } }
void Start() { blockSize = 5.65f; worldObject.transform.position = new Vector3(.66f, -.8f + 10f, .306f); blockSize = 5.65f; targetLocation = worldObject.transform.position; moveSpeed = 5f; shipMask = LayerMask.GetMask("Buttons"); moneyController = moneyObject.GetComponent <MoneyController>(); audioManager = FindObjectOfType <AudioManager>(); audioManager.Play("Engine"); }
// Use this for initialization void Start() { button = gameObject.GetComponent <Button>(); buttonText = transform.GetChild(0).gameObject.GetComponent <Text>(); shopAudioSource = shopAudioGameObject.GetComponent <AudioSource>(); moneyController = GameObject.FindWithTag("Money UI").GetComponent <MoneyController>(); gameController = GameObject.FindWithTag("GameController").GetComponent <GameController>(); buttonText.text = string.Format("Buy {0} ({1})", weapon.name, weaponCost); button.onClick.AddListener(BuyWeapon); }
private void CreateMoneyController() { MoneyModel = new MoneyModel(); MoneyController MCont = new MoneyController { View = MoneyView, Model = MoneyModel }; MCont.Init(); MoneyModel.Money = 40; }
void Start() { GetMoney(); if (instance == null) { instance = this; } else { Destroy(gameObject); } }
void Start() { EnemyHolder = GameObject.Find("EnemyHolder"); //getting the enemyHolder gameObject InvokeRepeating("UpdateEnemies", 0f, 0.1f); //updating the array of enemies , every second-> not in Update()-> for better performance UpdateEnemies(); upgradePrice = price * 1.5f; sellPrice = price * 0.5f; money = GameObject.Find("Money").GetComponent <MoneyController>(); ES = GameObject.Find("Path").GetComponent <EnemySpawner> (); }
void Start() { moneyController = GameObject.FindGameObjectWithTag("Player").GetComponent <MoneyController>(); hp = maxHP; try { uiStatsElement = lineStatsHP.GetComponent <StatsHP>(); } catch { Debug.LogError("Set UI element for show statistics"); } }
public bool Buy(MoneyController controller) { if (cost <= controller.GetMoney()) { controller.DeductMoney(cost); GameObject.Find("GameManager").GetComponent <AudioSource>().PlayOneShot(buySound); return(true); } else { return(false); } }
void Start() { MoneyController moneyController = FindObjectOfType <MoneyUiView>().MoneyController; _barChartController = new BarChartController(moneyController); _barChartValueViewPrefab = Resources.Load <BarChartValueView>(Util.PathTo("BarChartValueView")); _barChartValueElements = new List <BarChartValueView>(); _barChartController.OnValueChange += OnValueEmitted; _visibilityToggle.onClick.AddListener(delegate { _visibleObject.enabled = !_visibleObject.enabled; }); _closeButton.onClick.AddListener(delegate { _visibleObject.enabled = false; }); }
public void BuildGridObjectPress() { if (gridObject.CanBuild(Vector2.zero) && MoneyController.CanBuy(cost)) { GridObject grid_object = gridObject.CreateGridObject(); MoneyController.Buy(cost, grid_object); buildingSmoke.StartSmoke(gridObject); } else { print("no build"); } }