public void Setup(PlayerStatManager playerStatManager) { HealthMax = 100 * (playerStatManager.Get("HEALTH_MAX_PERCENT") / 100f + 1f); Health = HealthMax; WealthGenerationPercentBonus = playerStatManager.Get("WEALTH_GENERATION_PERCENT") / 100f + 1f; }
void Start() { theNotice = FindObjectOfType <NoticeManager>(); theOddEven = FindObjectOfType <OddEvenGame>(); theStat = FindObjectOfType <PlayerStatManager>(); InitMoneyChange(); }
void Start() { PSM = PlayerStatManager.Instance; GetSaves.Instance.SaveAll += Save; if (PlayerPrefs.HasKey("SoldierUpgradeHealthCost") || PlayerPrefs.HasKey("SoldierUpgradeDamageCost")) { Load(); } else { UpgradeHealthText.text = "Gems: " + UpgradeHealthCost; UpgradeDamageText.text = "Gems: " + UpgradeDamageCost; if (UType == UpgradeType.Mage) { UpgradeMageSpawnRateText.text = "Gems: " + UpgradeMageSpawnRateCost; UpgradeMageAoeRangeText.text = "Gems: " + UpgradeMageAoeRangeCost; UpgradeSpeedText.text = "Gems: " + UpgradeSpeedCost; } else if (UType == UpgradeType.Soldier) { UpgradeSpawnRateText.text = "Gems: " + UpgradeSpawnRateCost; UpgradeSpeedText.text = "Gems: " + UpgradeSpeedCost; } else if (UType == UpgradeType.Ninja) { UpgradeNinjaSpawnRateText.text = "Gems: " + UpgradeNinjaSpawnRateCost; } } }
IEnumerator Pickup(Collider player) { //Debug.Log("Power up picked up!"); //Particle GameObject explosion = Instantiate(pickupEffect, transform.position, transform.rotation, parentObject) as GameObject; ParticleSystem parts = explosion.GetComponent <ParticleSystem>(); Destroy(explosion, parts.main.duration); //Effect PlayerStatManager playerstat = player.GetComponent <PlayerStatManager>(); playerstat.currentHealth *= multiplier; GetComponent <MeshRenderer>().enabled = false; GetComponent <Collider>().enabled = false; yield return(new WaitForSeconds(duration)); playerstat.currentHealth /= multiplier; player.transform.localScale *= multiplier; //Destroy pickup Destroy(gameObject); }
public void GoToHorizon(Transform player) { SoundManager.instance.LoadSound("chock1", 0.7f, 1.0f); stopCurrentAction = true; PlayerTriggerManager playerTriggerManager = player.GetComponent <PlayerTriggerManager>(); PlayerStatManager playerStatManager = player.GetComponent <PlayerStatManager>(); if (playerTriggerManager.canColide) { ennemyHealth -= playerStatManager.damage; } else { ennemyHealth -= playerStatManager.damage * 2; } EnnemyBar.Play("EnnemyLife", 0, ennemyHealth / 100.0f); EnnemyBar.speed = 0.0f; activeDecelerate = false; StartCoroutine(ChangePositionAt(0.9f, 1.0f)); if (!playerTriggerManager.isInvinsible) { delegateHandler.OnDamage(40); } }
// Use this for initialization void Awake() { _gameManager = GameObject.FindGameObjectWithTag("GameManager"); PlayerStatManager g = null; if (_gameManager != null) { g = _gameManager.GetComponent <PlayerStatManager>(); } NumberOfPlayers = g.numberOfPlayers; SpawnPoints = GameObject.FindGameObjectsWithTag("Respawn"); for (int i = 0; i < NumberOfPlayers; i++) { var s = Random.Range(0, SpawnPoints.Length); while (s == oldSpawn) { s = Random.Range(0, SpawnPoints.Length); } Players[i] = Instantiate(PlayerPrefab, SpawnPoints[s].transform.position, Quaternion.identity) as GameObject; oldSpawn = s; PlayersScripts[i] = Players[i].GetComponent <Player>(); if (i == 0) { PlayersScripts[i].isPlayerOne = true; } var p = PlayersScripts[i]; p.Lives = g.Lives[i]; p.Deaths = g.Deaths[i]; p.Kills = g.Kills[i]; } }
//나의 주식함수를 불러서 내가 소유중인 주식 스크립트 배열을 사용한다 //기본적인 초기화 실시 void Start() { mystockOnOff = FindObjectOfType <MyStock>(); sellStockCountPanel.text = "0"; buyStockCountPanel.text = "0"; theStat = FindObjectOfType <PlayerStatManager>(); }
void Awake() { // singleton enforcement // if (FindObjectsOfType(typeof(PlayerStatManager)).Length > 1) // { // Debug.Log("PSM: Already found instance of script in scene; destroying."); // DestroyImmediate(gameObject); // } if (_instance != null && _instance != this) { GameObject.Destroy(this.gameObject); } else { _instance = this; playerStats = new PlayerStatistics[4]; for (int i = 0; i < 4; i++) { playerStats[i] = new PlayerStatistics(5, 5, 3f, 4f, 3); } DontDestroyOnLoad(gameObject); } }
public void Setup(PlayerStatManager playerStatManager) { PlayerStatManager = playerStatManager; RunSpeedPercentBonus = PlayerStatManager.Get("RUN_SPEED_PERCENT") / 100f + 1f; PlayerStatusController.Setup(PlayerStatManager); }
void Start() { theDate = FindObjectOfType <DateManager>(); theStat = FindObjectOfType <PlayerStatManager>(); theStockManager = FindObjectOfType <StockManager>(); M = Random.Range(1, 2); D = Random.Range(1, 2); }
private void OnTriggerEnter2D(Collider2D col) { if (col.tag == "PLAYER") { statManager = col.GetComponent <PlayerStatManager>(); ItemSlotManager.GetInstance().AttachItemInSlot(this); gameObject.SetActive(false); } }
//Loads the player stats public void LoadStats(ref PlayerStatManager stats) { stats.Speed = PlayerPrefs.GetFloat("SPEED", stats.BaseSpeed); stats.Jump = PlayerPrefs.GetFloat("JUMP", stats.BaseJump); stats.Shoot = PlayerPrefs.GetFloat("SHOOT", stats.BaseShoot); stats.Defense = PlayerPrefs.GetFloat("DEFENSE", stats.BaseDefense); stats.Dribble = PlayerPrefs.GetFloat("DRIBBLE", stats.BaseDribble); stats.Money = PlayerPrefs.GetFloat("MONEY", 0); }
//Saves the player stats public void SaveStats(PlayerStatManager stats) { PlayerPrefs.SetFloat("SPEED", stats.Speed); PlayerPrefs.SetFloat("JUMP", stats.Jump); PlayerPrefs.SetFloat("SHOOT", stats.Shoot); PlayerPrefs.SetFloat("DEFENSE", stats.Defense); PlayerPrefs.SetFloat("DRIBBLE", stats.Dribble); PlayerPrefs.SetFloat("MONEY", stats.Money); }
// Use this for initialization void Start() { gazTank = GetComponent <Image>(); StartCoroutine(UpdateGazTank()); if (IsPlayer) { playerStatManager = GameObject.Find("Player").GetComponent <PlayerStatManager>(); } }
// Start is called before the first frame update void Start() { theStat = FindObjectOfType <PlayerStatManager>(); theSellBuy = FindObjectOfType <StockManager>(); theNotice = FindObjectOfType <NoticeManager>(); theHandler = FindObjectOfType <LandmarksHandler>(); theDate = FindObjectOfType <DateManager>(); StockInOut = true; stockInOutT.text = "기업입주"; }
public void Setup(PlayerStatManager playerStatManager, PlayerStatusController playerStatusController) { PlayerStatusController = playerStatusController; PlayerStatManager = playerStatManager; HealthBar.rectTransform.sizeDelta = new Vector2(PlayerStatusController.HealthMax, HealthBar.rectTransform.sizeDelta.y); EnergyBar.rectTransform.sizeDelta = new Vector2(PlayerStatusController.EnergyMax, EnergyBar.rectTransform.sizeDelta.y); UpdateStatusText(); }
void OnTriggerEnter(Collider collider) { PlayerStatManager enemyPlayer = collider.GetComponent <PlayerStatManager>(); if (enemyPlayer != null && collider != instantiator.GetComponent <Collider>()) { enemyPlayer.TakeDamage(damage); } Destroy(gameObject); //destroys bullet }
private void Awake() { if (Instance != null) { Debug.Log("[PlayerStatManager] There is more then one Instance"); return; } Instance = this; LoadResources(); }
// Start is called before the first frame update void Start() { anim = GetComponent <Animator>(); playerStat = GetComponent <PlayerStatManager>(); rb = GetComponent <Rigidbody>(); walkSpeed = playerStat.p_DefaultWalkSpeed; sprintSpeed = playerStat.p_DefaultRunSpeed; jumpForce = playerStat.p_DefaultJumForce; fallMultiplier = playerStat.p_DefaultFallMultiplier; }
// Start is called before the first frame update void Awake() { anim = GetComponent <Animator>(); rb = GetComponent <Rigidbody>(); rb.constraints = RigidbodyConstraints.FreezeRotation; playerStat = GetComponent <PlayerStatManager>(); walkSpeed = playerStat.p_DefaultWalkSpeed; sprintSpeed = playerStat.p_DefaultRunSpeed; jumpForce = playerStat.p_DefaultJumForce; fallMultiplier = playerStat.p_DefaultFallMultiplier; }
// Use this for initialization void Start() { rb = GetComponent <Rigidbody2D>(); Movement = GetComponent <RigidbodyMovement2D>(); spriteRenderer = GetComponent <SpriteRenderer>(); playerScale = transform.localScale; possessionTimer = possessionTimerOriginal; moveAfterLaunchTimer = moveAfterLaunchTime; statManager = statObject.GetComponent <PlayerStatManager>(); henryAnim = GetComponent <Animator>(); }
void Start() { TransitionManager.FadeIn(1f, Color.black); var playerStatManager = new PlayerStatManager(); GameObjectM.GetComponentOnObject <PlayerController>("Player").Setup(playerStatManager); var PlayerStatusController = GameObjectM.GetComponentOnObject <PlayerStatusController>("Player"); GameObjectM.GetComponentOnObject <GuiPanelController>("GuiPanel").Setup(playerStatManager, PlayerStatusController); }
// Use this for initialization void Start() { IsDamage = false; if (GameObject.Find("Player") != null) { playerStat = GameObject.Find("Player").GetComponent <PlayerStatManager>(); } if (GameObject.Find("Score") != null) { Score = GameObject.Find("Score").GetComponent <Text>(); } StartCoroutine(UpdatePosition()); }
// Use this for initialization void Start() { #if UNITY_WEBGL || UNITY_STANDALONE tutoInputLeft.SetActive(true); tutoInputRight.SetActive(true); #endif canSwap = false; canUseInput = true; isTuto = true; beginTouch = Vector3.zero; endTouch = Vector3.zero; playerStat = GetComponent <PlayerStatManager>(); GetComponent <Animator>().Play("PlayerPath3", 0, 0.0f); StartCoroutine(InputUpdate()); }
public void InitMoneyChange() { /*신용등급에 따른 입장료의 변화*/ /*함수 호출시 선언 필요*/ theStat = FindObjectOfType <PlayerStatManager>(); if (theStat.playerCredit > 7) { inputMoney = 1000; inputMoneyT1.text = "비용 : $" + string.Format("{0}", inputMoney.ToString("n0")); inputMoneyT2.text = "비용 : $" + string.Format("{0}", inputMoney.ToString("n0")); inputMoneyT3.text = "비용 : $" + string.Format("{0}", inputMoney.ToString("n0")); inputMoneyT4.text = "비용 : $" + string.Format("{0}", inputMoney.ToString("n0")); } else if (theStat.playerCredit > 5) { inputMoney = 10000; inputMoneyT1.text = "비용 : $" + string.Format("{0}", inputMoney.ToString("n0")); inputMoneyT2.text = "비용 : $" + string.Format("{0}", inputMoney.ToString("n0")); inputMoneyT3.text = "비용 : $" + string.Format("{0}", inputMoney.ToString("n0")); inputMoneyT4.text = "비용 : $" + string.Format("{0}", inputMoney.ToString("n0")); } else if (theStat.playerCredit > 3) { inputMoney = 50000; inputMoneyT1.text = "비용 : $" + string.Format("{0}", inputMoney.ToString("n0")); inputMoneyT2.text = "비용 : $" + string.Format("{0}", inputMoney.ToString("n0")); inputMoneyT3.text = "비용 : $" + string.Format("{0}", inputMoney.ToString("n0")); inputMoneyT4.text = "비용 : $" + string.Format("{0}", inputMoney.ToString("n0")); } else if (theStat.playerCredit > 1) { inputMoney = 100000; inputMoneyT1.text = "비용 : $" + string.Format("{0}", inputMoney.ToString("n0")); inputMoneyT2.text = "비용 : $" + string.Format("{0}", inputMoney.ToString("n0")); inputMoneyT3.text = "비용 : $" + string.Format("{0}", inputMoney.ToString("n0")); inputMoneyT4.text = "비용 : $" + string.Format("{0}", inputMoney.ToString("n0")); } else if (theStat.playerCredit == 1) { inputMoney = 1000000; inputMoneyT1.text = "비용 : $" + string.Format("{0}", inputMoney.ToString("n0")); inputMoneyT2.text = "비용 : $" + string.Format("{0}", inputMoney.ToString("n0")); inputMoneyT3.text = "비용 : $" + string.Format("{0}", inputMoney.ToString("n0")); inputMoneyT4.text = "비용 : $" + string.Format("{0}", inputMoney.ToString("n0")); } }
//Should launch at the beginning of every scene public void ReloadScene() { if (GameObject.FindGameObjectWithTag("Player") != null) { Player = GameObject.FindGameObjectWithTag("Player"); PlayerStats = Player.GetComponent <PlayerStatManager>(); if (NewGame) { PlayerStats.SetBase(); _saveData.SaveStats(PlayerStats); NewGame = false; } else { _saveData.LoadStats(ref PlayerStats); } } }
void Start() { if (Instance == null) { Instance = this; } else if (Instance != this) { Destroy(gameObject); } GetSaves.Instance.SaveAll += Save; if (PlayerPrefs.HasKey("Money")) { LoadPlayerStats(); } //SetSoldiersStats(); }
private void OnEnable() { if (PSM == null) { PSM = PlayerStatManager.Instance; } if (WM == null) { WM = WaveManager.Instance; } if (FK != null) { TargetDied(); } CanMove = true; IsDead = false; SetStats = true; FK = null; }
public void init() { goFalse.SetActive(false); activeFalse.SetActive(false); theMiniGame = FindObjectOfType <MiniGameOnOff>(); theStat = FindObjectOfType <PlayerStatManager>(); theNotice = FindObjectOfType <NoticeManager>(); theMini = FindObjectOfType <MiniGameOnOff>(); theReport = FindObjectOfType <StockReportManager>(); /*그림 및 글 초기화*/ resultItemT.text = "두구두구"; Sprite newSprite = Resources.Load <Sprite>("mystery") as Sprite; resultImage.GetComponent <Image>().sprite = newSprite; //랜덤으로 나올 상품들 result = new List <string>(); string[] randomString = new string[8] { "하트", "꽝", "본전X5", "꽝", "본전X2", "하트", "꽝", "다시하기" }; for (int i = 0; i < ItemCnt; i++) { /*리스트에 0~7의 숫자를 넣는다*/ StartList.Add(i); } for (int i = 0; i < ItemCnt; i++) { /*랜덤 인덱스에 0~7의 숫자를 배정*/ int randomIndex = Random.Range(0, StartList.Count); /*결과리스트에 스타트 리스트에 있는 숫자중 랜덤 인덱스의 위치에 있는 값을 넣는다*/ ResultIndexList.Add(StartList[randomIndex]); /*보여줄 아이템슬롯 0~7번에 랜점으로 배정된 이미지를 넣는다*/ displayItemSolt[i].sprite = itemImage[StartList[randomIndex]]; result.Add(randomString[StartList[randomIndex]]); /*이미 넣은 인덱스는 제거한다, count => 8, 7, 6, ...*/ StartList.RemoveAt(randomIndex); } }
void Start() { playerStat = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerStatManager>(); switch (playerStat.NvOutRun) { case 1: { SoundManager.instance.LoadMusic("F1 Havas Run1", 0.6f); break; } case 2: { SoundManager.instance.LoadMusic("F1 Havas Run 2", 0.6f); break; } } float deltaTextureOffset = material.mainTextureOffset.y; roads.Add(RoadPart); Material tempMaterial = material; int i; Vector3 scale = RoadPart.transform.localScale; for (i = 1; i < roadLenght; i++) { GameObject roadPart = Instantiate(RoadPart, RoadPart.transform.localPosition * i * deltaRoadScale, Quaternion.identity); roadPart.transform.localScale = new Vector3((scale.x /**0.9975f*/) - deltaRoadScale, scale.y, 1.0f); roadPart.GetComponent <UpdateRoadPart>().idRoad = i; roadPart.GetComponent <Renderer>().material = tempMaterial; roadPart.GetComponent <Renderer>().material.mainTextureOffset = Vector2.up * i * deltaTextureOffset; scale = roadPart.transform.localScale; roadPart.transform.SetParent(transform); roadPart.GetComponent <UpdateRoadPart>().idRoad = i; roads.Add(roadPart); } }