private void Awake() { if (manager == null) { manager = this.gameObject.GetComponent <MoneyManager>(); } }
private void Awake() { I = this; _winScreen = GameObject.Find("Win Screen").GetComponent <WinScreen>(); _gameOverScreen = GameObject.Find("Game Over Screen").GetComponent <GameOverScreen>(); }
// Use this for initialization void Start() { //Iniciar el grid de zanahorias grid = new GameObject[gridSizeX, gridSizeY]; for (int i = 0; i < gridSizeX; i++) { for (int j = 0; j < gridSizeY; j++) { grid[i, j] = Instantiate(carrot); grid[i, j].name = "Carrot:" + i + "," + j; grid[i, j].transform.position = transform.position + new Vector3(i * 2.2f, -j * 1.4f - .1f, 0); grid[i, j].GetComponent <SpriteRenderer>().sortingLayerName = (j + 1) + "_Carrot"; } } //Iniciar la posición del jugador respecto al grid playerPosX = 0; playerPosY = 0; carrotsInArea = new ArrayList(); //Tiempo para la primera zanahoria de oro goldenCarrotTime = Mathf.Round(Random.Range(5, 8)); goldenCarrotActive = false; //Tiempo para la primera ardilla squirrelAppearTime = Mathf.Round(Random.Range(5, 8)); squirrelStartPullTime = 1; squirrelActive = false; squirrelCarrotSprite = 0; //Sprites de las zanahorias carrotSprites = new Sprite[] { carrot_0, carrot_1, carrot_2, carrot_3, carrot_4 }; goldenCarrotSprites = new Sprite[] { GoldenCarrot_0, GoldenCarrot_1, GoldenCarrot_2, GoldenCarrot_3, GoldenCarrot_4 }; CreateObstacles(); totalTime = 60f; MoneyManager.IniciateMoney(); }
private void Awake() { if (instance == null) { instance = this; } }
// Use this for initialization void Start() { anim = GetComponent <Animator>(); myRigidbody = GetComponent <Rigidbody2D>(); playerSprite = GetComponent <SpriteRenderer>(); originalColor = playerSprite.color; originalSpeed = moveSpeed; theSFXM = FindObjectOfType <SFXMnager>(); theMM = FindObjectOfType <MoneyManager>(); thePS = FindObjectOfType <PlayerStats>(); if (!playerExists) { // 沒有相同player ( bool預設為false playerExists = true; DontDestroyOnLoad(transform.gameObject); // 切換畫面不改變gameObject參數 } else { // 已存在相同player Destroy(gameObject); // 刪除當前gameObject } canMove = true; lastMove = new Vector2(0, -1f); }
void Start() { timeText = GameObject.FindGameObjectWithTag("TimeText").GetComponent <Text>(); newsManager = new NewsManager(this, GameObject.FindGameObjectWithTag("NewsBox")); gameEventManager = new GameEventManager(this); moneyManager = GameObject.FindGameObjectWithTag("_Manager").GetComponent <MoneyManager>(); }
// Start is called before the first frame update void Start() { worldMap = FindObjectOfType <WorldMap>(); builtObjectParent = new GameObject("Built Objects"); moneyManager = FindObjectOfType <MoneyManager>(); gameManager = FindObjectOfType <GameManager>(); }
public override void LoadContent() { CurrGame = (PathDefenceGame)ScreenManager.Game; LevelManager = new LevelManager(CurrGame, this, levelName); LevelManager.Initialize(); WaveManager = new WaveManager(CurrGame, this, levelName); WaveManager.Initialize(); Background = new BackgroundGamePlayScreen(CurrGame, levelName); Background.Initialize(); TowerManager = new TowerManager(CurrGame, this); TowerManager.Initialize(); MoneyManager = new MoneyManager(CurrGame, this); MoneyManager.Initialize(); LiveManager = new LiveManager(CurrGame, this); LiveManager.Initialize(); PointsManager = new PointsManager(); PointsManager.Initialize(); GuiManager = new GuiManager(CurrGame, this); GuiManager.Initialize(); CreepDeleteList.AddRange(CreepList); AddCreepList.Clear(); CreepTimer.Start(); gameState = EGameState.Running; CurrGame.IsMouseVisible = true; base.LoadContent(); }
//--------------------------------------------------------------------------------------------------------------------------------------------- void Awake() { if (_instance == null) { _instance = this; //設定單例模式 } }
void Start() { Button btn = sellButton.GetComponent <Button>(); moneyManager = (MoneyManager)Object.FindObjectOfType <MoneyManager>(); btn.onClick.AddListener(Sell); }
public override void _Ready() { soundManager = GetNode <SoundManager>("/root/SoundManager"); sceneManager = GetNode <SceneManager>("/root/SceneManager"); candyManager = GetNode <CandyManager>("/root/CandyManager"); moneyManager = GetNode <MoneyManager>("/root/MoneyManager"); }
private void Start() { m_moneyManager = FindObjectOfType <MoneyManager>(); m_housingManager = FindObjectOfType <HousingManager>(); Charge = ChargeCapacity; }
void Start() { StartCoroutine (RefreshStats ()); started = true; nurseryManagerSCR = GameObject.FindGameObjectWithTag ("NurseryManager").GetComponent<NurseryManager>(); moneyManagerSCR = GameObject.FindGameObjectWithTag ("MoneyManager").GetComponent<MoneyManager>(); }
// Update is called once per frame void Update() { if (isInHand) { activeTool.transform.position = Hand.transform.position; //print("hullo?"); } if (Input.GetButtonDown("Y_Button") || mobileInputs.YButton) { toolType = 1; ChangeToolSelectColor(); } else if (Input.GetButtonDown("X_Button") || mobileInputs.XButton) { toolType = 0; ChangeToolSelectColor(); } else if (Input.GetButtonDown("A_Button") || mobileInputs.AButton) { toolType = 2; ChangeToolSelectColor(); } else if (Input.GetButtonDown("B_Button") || mobileInputs.BButtonBegan) { //DestroyActiveTool(); CreateTool(); } else if (Input.GetButtonUp("B_Button") || mobileInputs.BButtonUp) { DestroyActiveTool(); CreateTool(); isInHand = false; //Por alguna razon x y y van alrevez, float y = fillPowerBar.finalPowerBarValue * Mathf.Sin(shouderRotation.angle * Mathf.Deg2Rad); float x = fillPowerBar.finalPowerBarValue * Mathf.Cos(shouderRotation.angle * Mathf.Deg2Rad); print("Shoulder Angle = " + (shouderRotation.angle) + " PowerBarValue = " + fillPowerBar.finalPowerBarValue + "\n X : " + x + " Y : " + y + "\n ThrowStrength : " + throwStrength); activeTool.GetComponent <Rigidbody2D>().AddForce(new Vector2(x, y) * throwStrength); audioSource.PlayOneShot(audioWoosh); } //hace algo si se acaba el tiempo if (timeManager.IsTimeOverUpdate()) { ComboManager.resetCombo(); //print("Time is OVER"); MoneyManager.EndActivity(); print(MoneyManager.TotalMoney); GameManager.goToScene(20);//16 es el numero actual de la escena de transicion. } }
/// <summary> /// Constructor adds items to the top-level menu /// </summary> public MainMenu(VendingMachine vendingMachine, MoneyManager manager) : base(vendingMachine, manager) { this.Title = "*** Welcome to Vendo-Matic 500 ***"; this.menuOptions.Add("1", "Display Vending Machine Items"); this.menuOptions.Add("2", "Purchase"); this.menuOptions.Add("Q", "Quit"); }
public SpendMoney(MoneyManager money, InventoryManager inventory) { InitializeComponent(); this.money = money; this.inventory = inventory; }
protected override void InitSource() { lock (matchMutex) { try { money = BOT.getMoneyManager(); var lines = FileHelper.readLines(PluginPath + userinfoFile); foreach (var line in lines) { RHUser user = new RHUser(); user.parse(line); users[user.id] = user; } lines = FileHelper.readLines(PluginPath + horseinfoFile); foreach (var line in lines) { RHHorse horse = new RHHorse(line); horses[horse.name] = horse; } } catch (Exception e) { FileHelper.Log(e.Message + "\r\n" + e.StackTrace); } } }
public CashBoardElement(int[] indexInParent, int cashElementTypeIndex) : base(indexInParent, Vector4.One) { base.elementSpriteIndexInArray = (int)ConstantValues.AvailableSprites.cashWhite + cashElementTypeIndex; base.thisType = typeof(CashBoardElement); this.cashValue = ConstantValues.cashElementsValues[cashElementTypeIndex] * MoneyManager.GetSwapCost() * 100; }
// Start is called before the first frame update void Awake() { spriteRenderer = gameObject.GetComponent <SpriteRenderer>(); gameManager = FindObjectOfType <GameManager>(); moneyManager = FindObjectOfType <MoneyManager>(); spriteRenderer.sprite = gemSprite[0]; }
// Update is called once per frame void Update() { anim.SetFloat("Move", Mathf.Abs(rb2d.velocity.x)); if (mobileInputs.AButton) { rb2d.velocity += new Vector2(3f, 0f); } contador -= Time.deltaTime; if (contador < 0) { if (rb2d.velocity.x > 0) { rb2d.velocity -= new Vector2(2f, 0f); } contador = 0.5f; } tiempo -= Time.deltaTime; tiempoText.text = tiempo.ToString("00"); if (tiempo < 0) { MoneyManager.EndActivity(); GameManager.goToScene(20);//20es el numero de la escena de transicion. } }
/// <summary> /// If a player no longer has any health kill them /// </summary> public void Update() { if (moneyM == null) { try { moneyM = FindObjectOfType <MoneyManager>().GetComponent <MoneyManager>(); } catch (NullReferenceException ex) { // Do nothing as there is a null ref exception here. } } if (currentHealth <= 0) { Die(); } if (spawner.respawned) { Debug.Log("if spawner.respawner"); CmdRespawn(); spawner.setRespawn(false); spawner.RemoveFloatingText(); Respawn(); Debug.Log("if spawner.respawner end"); } RefreshRespawn(); }
// Start is called before the first frame update void Start() { player = GameObject.FindWithTag("Player"); money = player.GetComponent <MoneyManager>(); healthManager = player.GetComponent <PlayerHealthManager>(); sfxMan = FindObjectOfType <SFXManager>(); }
/// <summary> /// after finished ads /// </summary> private void GiveFreeCoins() { CloseButtonFreeMoney(); openFreeCoinsPanel(); MoneyManager.Give(MoneyManager.TotalMPS * 90); FreeCoinPanelTxt.text = "You received: " + MoneyManager.TotalMPS * 90 * MoneyManager.AllmoneyMultiply + " coins :)"; }
void Update() { //Contar el tiempo total totalTime -= Time.deltaTime; timeText.text = totalTime.ToString("00"); if (totalTime <= 0) { MoneyManager.EndActivity(); GameManager.goToScene(20);//16 es el numero actual de la escena de transicion. } //Contar el tiempo para las zanahorias de oro goldenCarrotTime -= Time.deltaTime; if (goldenCarrotTime <= 0f) { GoldenCarrot(); goldenCarrotTime = 100; } if (goldenCarrotActive) { //Contar el tiempo para que desaparezca la zanahoria de oro if (!playerIsPullingGoldenCarrot) { returnGoldenCarrotTime -= Time.deltaTime; } if (returnGoldenCarrotTime < 0f) { goldenCarrotTime = Mathf.Round(Random.Range(5, 8)); ReturnGoldenCarrot(); } } //Contar el tiempo para las ardillas squirrelAppearTime -= Time.deltaTime; if (squirrelAppearTime <= 0f) { SquirrelAppear(); squirrelAppearTime = 100; } if (squirrelActive) { squirrelStartPullTime -= Time.deltaTime; if (squirrelStartPullTime <= 0f) { SquirrelStartPull(); //Contar el tiempo para que desaparezca la ardilla squirrelDisappearTime -= Time.deltaTime; squirrelCarrotPullTime -= Time.deltaTime; //Cambiar el sprite de la zanahoria que se esta llevando la ardilla if (squirrelCarrotPullTime < 0f) { squirrelCarrotPullTime = .2f; squirrelCarrotSprite = squirrelCarrotSprite == 0 ? 1 : 0; grid[squirrelPosX, squirrelPosY].GetComponent <SpriteRenderer>().sprite = carrotSprites[squirrelCarrotSprite]; } if (squirrelDisappearTime < 0f) { SquirrelDisappear(); } } } }
// Called when the node enters the scene tree for the first time. public override void _Ready() { movement_player = GetNode <AnimationPlayer>("Animations/Movement"); turning_player = GetNode <AnimationPlayer>("Animations/Turning"); sprites = GetNode <Node2D>("Sprites"); if (detectorAreaPath != null) { detectorArea = GetNode <Area2D>(detectorAreaPath); } if (questionMarkPath != null) { questionMark = GetNode <Sprite>(questionMarkPath); questionMarkOriginalPos = questionMark.Position; } interactableAreas = new Area2D[0]; saveManager = GetNode <SaveManager>("/root/SaveManager"); candyManager = GetNode <CandyManager>("/root/CandyManager"); soundManager = GetNode <SoundManager>("/root/SoundManager"); moneyManager = GetNode <MoneyManager>("/root/MoneyManager"); if (GetType() == typeof(Player)) { _ReadyPlayer(); } }
void Start() { IdleManager.onAwayProfitsCalculated += DisplayUI; utilities = Utilities.Instance; moneyManager = MoneyManager.Instance; }
public static void addMoney(float money) { float m = float.Parse((getCurrentMoney() + money).ToString("F2")); PlayerPrefs.SetFloat(KEY_MONEY, m); MoneyManager.sendChange(getCurrentMoney()); }
/// <summary> /// product every 1 second /// </summary> /// <returns></returns> IEnumerator Production() { MoneyManager.Give(actualRevenue); yield return(new WaitForSeconds(1f)); StartCoroutine(Production()); }
void FixedUpdate() { if (!MoneyManager.IsEarningMoney && !particleSystemMoneyLost.isPlaying) { particleSystemMoneyGained.Stop(); particleSystemMoneyLost.Play(); } else if (MoneyManager.IsEarningMoney && !particleSystemMoneyGained.isPlaying) { particleSystemMoneyLost.Stop(); particleSystemMoneyGained.Play(); } if (isWorking) { //Pulls the player towards the workstation. PullPlayer(); MoneyManager.GenerateMoney(); } else { //Hide particle emission if (particleSystemMoneyGained.isPlaying) { particleSystemMoneyGained.Stop(); } } //Update particle emission based on how many workers are working and how motivated they are. //Less motivated & non working people = more red dollar signs, less green dollar signs //more motivated & working people = more green dollar signs, less red dollar signs ParticleSystem.EmissionModule emissionMoneyGained = particleSystemMoneyGained.emission; ParticleSystem.EmissionModule emissionMoneyLost = particleSystemMoneyLost.emission; float totalMotivation = 0; float totalHappiness = 0; foreach (DAS.NPC npc in DAS.NPC.s_npcList) { if (npc.moveRef.IsCurrentlyWorking) { totalMotivation += npc.myFeelings.Motivation; totalHappiness += npc.myFeelings.Happiness; } else { totalHappiness += npc.myFeelings.Happiness; } } float resultMotivation; float resultHappiness; resultMotivation = totalMotivation / DAS.NPC.s_npcList.Count; resultHappiness = 1 - totalHappiness / DAS.NPC.s_npcList.Count; emissionMoneyGained.rateOverTime = new ParticleSystem.MinMaxCurve(resultMotivation * 8f); emissionMoneyLost.rateOverTime = new ParticleSystem.MinMaxCurve(resultHappiness * 8f); }
public override void _Ready() { PauseMode = PauseModeEnum.Process; saveManager = GetNode <SaveManager>("/root/SaveManager"); candyManager = GetNode <CandyManager>("/root/CandyManager"); moneyManager = GetNode <MoneyManager>("/root/MoneyManager"); }
private void SendLicenseMenuToPlayer(Client player, bool isUpdate = false) { List <Dictionary <string, dynamic> > vehicleLicenseList = new List <Dictionary <string, dynamic> >(); List <Dictionary <string, dynamic> > weaponLicenseList = new List <Dictionary <string, dynamic> >(); List <Dictionary <string, dynamic> > featureLicenseList = new List <Dictionary <string, dynamic> >(); List <string> ownedLicenses = Licenses.GetUserLicensesIndentifiers(player); foreach (ILicense lic in Licenses.GetAllLicenses()) { Dictionary <string, dynamic> licenseObject = new Dictionary <string, dynamic>(); licenseObject.Add("price", lic.GetLicensePrice()); licenseObject.Add("identifier", lic.GetLicenseIdentifierName()); licenseObject.Add("name", lic.GetHumanReadableName()); licenseObject.Add("description", lic.GetHumanReadableDescription()); if ((int)player.getSyncedData("Level") < lic.GetMinRequiredLevel()) { licenseObject.Add("error", "Level " + lic.GetMinRequiredLevel()); licenseObject.Add("enabled", false); } else if (ownedLicenses.Contains(lic.GetLicenseIdentifierName())) { licenseObject.Add("error", "im Besitz"); licenseObject.Add("enabled", false); } else if (MoneyManager.GetPlayerMoney(player) < lic.GetLicensePrice() && MoneyManager.GetPlayerBank(player) < lic.GetLicensePrice()) { licenseObject.Add("color", "~r~"); licenseObject.Add("enabled", false); } else { licenseObject.Add("enabled", true); } var memberInfo = lic.GetType().BaseType; if (memberInfo != null && memberInfo.Name.Equals("VehicleLicense")) { vehicleLicenseList.Add(licenseObject); } else if (memberInfo != null && memberInfo.Name.Equals("FeatureLicense")) { featureLicenseList.Add(licenseObject); } else if (memberInfo != null && memberInfo.Name.Equals("WeaponLicense")) { weaponLicenseList.Add(licenseObject); } } Dictionary <string, dynamic> licensesDictionary = new Dictionary <string, dynamic>(); licensesDictionary.Add("vehicleLicenses", vehicleLicenseList); licensesDictionary.Add("featureLicenses", featureLicenseList); licensesDictionary.Add("weaponLicenses", weaponLicenseList); string json = JObject.FromObject(licensesDictionary).ToString(); player.triggerEvent(isUpdate ? "updateLicensesMenu" : "createLicensesMenu", json); }
void Start() { gridManager = GameObject.FindObjectOfType<GridManager>(); worldPlacer = GameObject.FindObjectOfType<WorldPlacer>(); itemMenu = GameObject.FindObjectsOfType<ItemMenu>(); moneyManager = GameObject.FindObjectOfType<MoneyManager>(); importMenu = GameObject.FindObjectOfType<ImportMenu>(); }
void Start() { teamManagerSCR = GameObject.FindGameObjectWithTag("TeamManager").GetComponent<TeamManager>(); // pour la gestion de team globalManagerSCR = GameObject.FindGameObjectWithTag("GlobalManager").GetComponent<GlobalManager>(); // pour la limite du nombre de hero moneyManager = GameObject.FindGameObjectWithTag ("MoneyManager").GetComponent<MoneyManager> (); // pour le prix du hero (outcome) ModalWindowManagerSCR = GameObject.FindGameObjectWithTag("ModalWindowManager").GetComponent<ModalWindowManager>(); // pour la demande de suppression de hero inventorySCR = GameObject.FindGameObjectWithTag("Inventory").GetComponent<Inventory>(); // pour la suppression de hero if(heroStatsSCR.heroStatus == 0 ) // Si le hero est en attente d'achat { StartCoroutine(DisplayHeroCoroutine()); // fais afficher le hero dans le panel mercenary // ajoute le hero au nombre de heros actifs } else if(heroStatsSCR.heroStatus == 1) // Si le hero est actif et en vie { globalManagerSCR.numberOfHeroes ++; // ajoute le hero au nombre de heros actifs HeroDisplayManagerSCR.DisplayInPanelRight(); // Affiche le hero dans le panel right HeroDisplayManagerSCR.DisplayInPanelPantheon(); // Affiche le hero dans le panel Pantheon HeroDisplayManagerSCR.DisplayInItemHeroSelection(); // Affiche le hero dans le panel d'inventaire if(heroStatsSCR.heroHp < heroStatsSCR.heroMaxHp) // Si les hp ne sont pax maxés { HeroDisplayManagerSCR.DisplayInNursery (); // Cree un panel dans l'infirmerie } } else if(heroStatsSCR.heroStatus == 2) { HeroDisplayManagerSCR.DisplayInPanelPantheon(); // Affiche le hero dans le panel Pantheon HeroDisplayManagerSCR.DisplayInGraveyard(); // Affiche le hero dans le cimetiere } }
/// <summary> /// This is like the Init but done by the MonoBehaviour /// </summary> private void Awake() { if (m_Instance == null) m_Instance = this; else { Debug.LogError("Someone is trying to create various MoneyManager [" + name + "]"); this.enabled = false; } }
// Use this for initialization void Start() { moneyManagerSCR = GameObject.FindGameObjectWithTag("MoneyManager").GetComponent<MoneyManager>(); }
/// <summary> /// This is like the Release but done by the MonoBehaviour /// </summary> private void OnDestroy() { if (m_Instance == this) m_Instance = null; }
void Awake() { moneyManager = GameObject.FindGameObjectWithTag ("MoneyManager").GetComponent<MoneyManager> (); }
void Awake() { //camera_main.GetComponent<camera_main>().orthographicSize =0; //camera_main_intro_on = true; stage_num = PlayerPrefsX.GetBoolArray ("Cleared_Stage"); stage_mode = PlayerPrefsX.GetBoolArray ("Cleared_Stage_Mode"); thisStage =Application.loadedLevel-1; numofGoal = GameObject.Find ("Goal").transform.childCount; money_manager = this.gameObject.GetComponent<MoneyManager> (); start_UI.SetActive (true); if (stage_mode [thisStage * 3] == false) speedMode = 0; else if (stage_mode [thisStage * 3 + 1] == false) speedMode = 1; else if (stage_mode [thisStage * 3 + 2] == false) speedMode = 2; else speedMode = 2; SetInitialBallSpeed (); bb = GameObject.Find ("Player").GetComponentsInChildren<BoxBehavior_2> (); foreach (BoxBehavior_2 player in bb) { player.boxSpeed =0; } StageNum.GetComponent<Text> ().text = Application.loadedLevel.ToString(); main_UI.SetActive(false); camera_main.transform.position = temp_camera_vector; camera_main_intro_on = true; //camera_main.GetComponent<UnityStandardAssets.ImageEffects.BlurOptimized>().enabled = true; //camera_main.GetComponent<UnityStandardAssets.ImageEffects.BlurOptimized> ().blurType = UnityStandardAssets.ImageEffects.BlurOptimized.BlurType.StandardGauss; }
/// <summary> /// Set player info. /// </summary> /// <param name="username">Player's username.</param> /// <param name="playerNumber">Player's number.</param> public void Initialize(string username, int playerNumber) { playerInfo = new PlayerInfo(username, playerNumber); name = username; // set up myExperience.Load(0); myMoney = new MoneyManager(playerInfo.username); myPerformance = new PerformanceManager(playerInfo.username); myScore = new ScoreManager(playerInfo.username); myStats.Initialize(playerInfo.username); StartInitialState(null); }
protected override void Awake() { base.Awake(); // input #if UNITY_EDITOR input = gameObject.AddComponent<DeviceInput>(); #else if (InputManager.ActiveInput == InputManager.Inputs.Touch) { input = gameObject.AddComponent<TouchInput>(); } else { input = gameObject.AddComponent<DeviceInput>(); } #endif // setup myMoney = new MoneyManager(); Augmentations = GetComponent<AugmentationManager>(); Weapons = GetComponent<WeaponManager>() ?? gameObject.AddComponent<WeaponManager>(); // create states stateMachine = new StateMachine(this, MovingState); stateMachine.CreateState(MovingState, MovingEnter, MovingExit); stateMachine.CreateState(BarrelRollingState, BarrelRollingEnter, BarrelRollingExit); stateMachine.CreateState(DyingState, DyingEnter, info => { }); }