void Awake() { highlightBox = transform.Find("chkHighlight").gameObject; playerRigid = GetComponent <Rigidbody>(); nowRot = transform.localRotation; playerCamera = GameObject.Find("Camera").GetComponent <Camera>(); cameraAni = playerCamera.GetComponent <Animator>(); playerAniCon = GetComponent <AnimationController>(); sceneName = SceneManager.GetActiveScene().name; if (sceneName == "ItemCollectScene") { playerSpeed = 3; s_itemBtn = GameObject.Find("itemBtnCanvas/btn_GetItem").GetComponent <ItemBtn>(); canvas = GameObject.Find("Canvas"); Block = null; } else if (sceneName == "GameScene") { DontDestroyOnLoad(transform.parent); GM = GameObject.Find("GameMgr2/itemFieldCntrl").GetComponent <ItemFieldCntrl>(); sockServObj = GameObject.Find("GameMgr2/MatchingCntrl"); playerInfo = sockServObj.GetComponent <GameEnterScript>(); weaponNum = playerInfo.savCharInfo.weapon; spawnInfo = sockServObj.GetComponent <SpawnScript>(); shotMgr = GetComponentInChildren <ShotManager>(); shotMgr.ShotPosChange(weaponNum); shotMgr.point = GameObject.Find("PointPrefab"); shotMgr.point.SetActive(false); StartCoroutine(MoveDelay()); //플레이어의 정보 전송하는 코루틴 hpText = GameObject.Find("Canvas").transform.GetChild(0).GetComponent <Text>(); playerHPBar = GameObject.Find("Canvas").transform.GetChild(3).GetComponent <HpBar>(); Block = GameObject.Find("Canvas").transform.GetChild(4).gameObject; s_itemSpawn = GameObject.Find("itemSpawnArr").GetComponent <ItemSpawn>(); s_hitEffect = GameObject.Find("HitEffect").GetComponent <hitEffect>(); ChinkEffect = GameObject.Find("ChinkEffect"); ItemImg = new GameObject[4]; ItemImg[(int)eITEM.em_HP_POTION] = GameObject.Find("HpPotionImg").gameObject; ItemImg[(int)eITEM.em_SPEED_POTION] = GameObject.Find("SpdPotionImg").gameObject; ItemImg[(int)eITEM.em_DAMAGE_UP_POTIOM] = GameObject.Find("AtkPotionImg").gameObject; ItemImg[(int)eITEM.em_DEFENCE_UP_POTION] = GameObject.Find("DefPotionImg").gameObject; for (int i = 0; i < 4; i++) { ItemImg[i].SetActive(false); } sound = GameObject.Find("GameMgr").GetComponent <BgmController>(); effSound = gameObject.GetComponentInChildren <EffSoundController>(); } }
bool IsLayerChange = false; //layerchage를 했는 지 여부 private void Awake() { IsJump = false; AM = transform.GetComponent <AnimationManager>(); s_itemBtn = GameObject.Find("itemBtnCanvas/btn_GetItem").GetComponent <ItemBtn>(); scene = SceneManager.GetActiveScene(); canvas = GameObject.Find("Canvas"); playerRigid = GetComponent <Rigidbody>(); highlightBox = GameObject.Find("chkHighlight"); nowRot = transform.localRotation; }
void Awake() { highlightBox = transform.Find("chkHighlight").gameObject; playerRigid = GetComponent <Rigidbody>(); nowRot = transform.localRotation; playerCamera = GameObject.Find("Camera").GetComponent <Camera>(); cameraAni = playerCamera.GetComponent <Animator>(); playerAniCon = GetComponent <AnimationController>(); sceneName = SceneManager.GetActiveScene().name; if (sceneName == "ItemCollectScene") { playerSpeed = 3; s_itemBtn = GameObject.Find("itemBtnCanvas/btn_GetItem").GetComponent <ItemBtn>(); canvas = GameObject.Find("Canvas"); block = null; } else if (sceneName == "GameScene") { DontDestroyOnLoad(transform.parent); GM = GameObject.Find("GameMgr2/itemFieldCntrl").GetComponent <ItemFieldCntrl>(); sockServObj = GameObject.Find("GameMgr2/MatchingCntrl"); playerInfo = sockServObj.GetComponent <GameEnterScript>(); weaponNum = playerInfo.savCharInfo.weapon; spawnInfo = sockServObj.GetComponent <SpawnScript>(); usedItemEff = GameObject.Find("usedItemEff").GetComponent <Image>(); usedItemEff.gameObject.SetActive(false); Info = GameObject.Find("Info"); Info.transform.GetChild(weaponNum + 1).gameObject.SetActive(true); shotMgr = GetComponentInChildren <ShotManager>(); shotMgr.ShotPosChange(weaponNum); shotMgr.point = GameObject.Find("PointPrefab"); shotMgr.point.SetActive(false); StartCoroutine(MoveDelay()); //플레이어의 정보 전송하는 코루틴 playerHPBar = GameObject.Find("Canvas/playerHP").GetComponent <HpBar>(); block = GameObject.Find("Canvas/Block").gameObject; block.SetActive(false); s_itemSpawn = GameObject.Find("itemSpawnArr").GetComponent <ItemSpawn>(); s_hitEffect = GameObject.Find("HitEffect").GetComponent <hitEffect>(); ChinkEffect = GameObject.Find("ChinkEffect"); usedItemParticle = transform.Find("ItemEffect").GetComponentInChildren <ParticleSystem>(); usedItemParticleRender = transform.Find("ItemEffect").GetComponentInChildren <ParticleSystemRenderer>(); sound = GameObject.Find("GameMgr").GetComponent <BgmController>(); effSound = gameObject.GetComponentInChildren <EffSoundController>(); } }
public void SaveItemButton(ItemBtn itemButton) { string key = itemButton.itemName; PlayerPrefs.SetInt(key + "_level", itemButton.level); PlayerPrefs.SetInt(key + "_cost", itemButton.currentCost); PlayerPrefs.SetInt(key + "_goldPerSec", itemButton.goldPerSec); if (itemButton.isPurchased == true) { PlayerPrefs.SetInt(key + "_isPurchased", 1); } else { PlayerPrefs.SetInt(key + "_isPurchased", 0); } }
public void LoadItemButton(ItemBtn itemButton) { string key = itemButton.itemName; itemButton.level = PlayerPrefs.GetInt(key + "_level"); itemButton.currentCost = PlayerPrefs.GetInt(key + "_cost", itemButton.startCurrentCost); itemButton.goldPerSec = PlayerPrefs.GetInt(key + "_goldPerSec"); if (PlayerPrefs.GetInt(key + "_isPurchased") == 1) { itemButton.isPurchased = true; } else { itemButton.isPurchased = false; } }
float timer; //제한 시간 타이머 private void Start() { waitImg = GameObject.Find("Canvas/fightGameStartMSG"); waitImg.SetActive(false); itemBtnCanvas = GameObject.Find("itemBtnCanvas"); s_player = GameObject.Find("Player").GetComponent <PlayerScript>(); s_itemBtn = itemBtnCanvas.GetComponentInChildren <ItemBtn>(); s_player.GM = this; s_itemBtn.GM = this; alarmImg = itemBtnCanvas.transform.GetChild(0).GetComponent <RawImage>(); alarmImg.gameObject.SetActive(false); T_timer = GameObject.Find("Canvas/Timer").GetComponent <Text>(); min = 0; timer = 0; GameObject serverObj = GameObject.Find("GameMgr2/MatchingCntrl"); enter = serverObj.GetComponent <GameEnterScript>(); }
float timer; //제한 시간 타이머 private void Awake() { waitImg = GameObject.Find("Canvas/fightGameStartMSG"); waitImg.SetActive(false); itemBtnCanvas = GameObject.Find("itemBtnCanvas"); s_player = GameObject.Find("Player").GetComponent <PlayerCntrl_itemField>(); s_itemBtn = itemBtnCanvas.GetComponentInChildren <ItemBtn>(); s_player.GM = this; s_itemBtn.GM = this; itemBtn = new Button[3]; itemBtn[0] = itemBtnCanvas.transform.GetChild(1).GetChild(0).GetComponent <Button>(); itemBtn[1] = itemBtnCanvas.transform.GetChild(1).GetChild(1).GetComponent <Button>(); itemBtn[2] = itemBtnCanvas.transform.GetChild(1).GetChild(2).GetComponent <Button>(); alarmImg = itemBtnCanvas.transform.GetChild(0).GetComponent <RawImage>(); alarmImg.gameObject.SetActive(false); T_timer = GameObject.Find("Canvas/Timer").GetComponent <Text>(); CPlayerInfo = new PlayerInfo(); min = 0; timer = 0; }