void Start() { rd = GetComponent <Rigidbody2D>(); anim = GetComponent <Animator>(); this.gameObject.name = NameGameObject; this.gameObject.tag = Tag; this.gameObject.layer = layer; ScoreHolderGameObject = GameObject.Find("ScoreHolderGameObject"); score = ScoreHolderGameObject.GetComponent <ScoreHolder>(); soundManagement = GameObject.Find("GameplaySoundManagementGameObject"); gs = soundManagement.GetComponent <GameplaySoundMangement>(); ruleAndUi = GameObject.Find("GamePlayUIandRuleManagement").GetComponent <OptionSetting>(); ResourcesMoney = GameObject.Find("ResourcesMoney").GetComponent <Text>(); MoneyText = GameObject.Find("MoneyText").GetComponent <Text>(); if (GameObject.Find(NameGameObject + "/arm_1/sword_swordman") != null) { GameObject.Find(NameGameObject + "/arm_1/sword_swordman").tag = SwordTag; GameObject.Find(NameGameObject + "/arm_1/sword_swordman").layer = layer; } if (GameObject.Find(NameGameObject + "/arm_1/Flag/flag_flagger") != null) { SpriteRenderer render = GameObject.Find(NameGameObject + "/arm_1/Flag/flag_flagger").GetComponent <SpriteRenderer>(); if (side == "Player") { render.color = SetColor(ruleAndUi.colorForPlayer); } else if (side == "Enemy") { render.color = SetColor(ruleAndUi.colorForEnemy); } } if (GameObject.Find(NameGameObject + "/head/helm_swordman") != null) { SpriteRenderer render = GameObject.Find(NameGameObject + "/head/helm_swordman").GetComponent <SpriteRenderer>(); if (side == "Player") { render.color = SetColor(ruleAndUi.colorForPlayer); } else if (side == "Enemy") { render.color = SetColor(ruleAndUi.colorForEnemy); } } HP = HP + ruleAndUi.GetPlushHP(); }
// Use this for initialization void Start() { ResourcesMoney = GameObject.Find("ResourcesMoney").GetComponent <Text>(); MoneyText = GameObject.Find("MoneyText").GetComponent <Text>(); animCannonItself = CannonItself.GetComponent <Animator>(); soundManagement = GameObject.Find("GameplaySoundManagementGameObject"); gs = soundManagement.GetComponent <GameplaySoundMangement>(); ruleAndUi = GameObject.Find("GamePlayUIandRuleManagement").GetComponent <OptionSetting>(); }
// Use this for initialization void Start() { ResourcesMoney = GameObject.Find("ResourcesMoney").GetComponent <Text>(); MoneyText = GameObject.Find("MoneyText").GetComponent <Text>(); ScoreHolderGameObject = GameObject.Find("ScoreHolderGameObject"); score = ScoreHolderGameObject.GetComponent <ScoreHolder>(); soundManagement = GameObject.Find("GameplaySoundManagementGameObject"); gs = soundManagement.GetComponent <GameplaySoundMangement>(); ruleAndUi = GameObject.Find("GamePlayUIandRuleManagement").GetComponent <OptionSetting>(); SpawnRate = SpawnRate + ruleAndUi.GetSpawnRate(); }
// Use this for initialization void Start() { rd = this.gameObject.GetComponent <Rigidbody2D>(); anim = this.gameObject.GetComponent <Animator>(); sprt = this.gameObject.GetComponent <SpriteRenderer>(); this.gameObject.layer = 14; this.gameObject.name = NameGameObject; ResourcesMoney = GameObject.Find("ResourcesMoney").GetComponent <Text>(); findMineFlag = GameObject.Find(NameGameObject + "/Flag/flag_flagger"); flagColor = findMineFlag.GetComponent <SpriteRenderer>(); soundManagement = GameObject.Find("GameplaySoundManagementGameObject"); gs = soundManagement.GetComponent <GameplaySoundMangement>(); sprt.sprite = Random.Range(1, 5) == 1 ? mine1 : Random.Range(1, 5) == 2 ? mine2 : Random.Range(1, 5) == 3 ? mine3 : Random.Range(1, 5) == 4 ? mine4 : mine5; ruleAndUi = GameObject.Find("GamePlayUIandRuleManagement").GetComponent <OptionSetting>(); }