// Use this for initialization void Start() { a = GameObject.Find("KnockSkillPanel").GetComponent<Skill_Knock>(); b = GetComponent<Text>(); }
void Awake(){ skillTextTyping = GetComponentsInChildren<Text> (); textCheck = (Typing_Input)FindObjectOfType (typeof(Typing_Input)); fire = GetComponent<Skill_Fire> (); ice = GetComponent<Skill_Ice> (); knock = GetComponent<Skill_Knock> (); slow = GetComponent<Skill_Slow> (); heal = GetComponent<Skill_Heal> (); trap = GetComponent<Skill_Trap> (); }
void Start(){ levelUp = GameObject.Find("levelUp"); inventoryFull = GameObject.Find("inventoryFull"); fireNoti = GameObject.Find("fireNoti"); iceNoti = GameObject.Find("iceNoti"); slowNoti = GameObject.Find("slowNoti"); knockNoti = GameObject.Find("knockNoti"); healNoti = GameObject.Find("healNoti"); trapNoti = GameObject.Find("trapNoti"); sameLetterNoti = GameObject.Find("sameLetterNoti"); sameWordNoti = GameObject.Find("sameWordNoti"); oneLetterNoti = GameObject.Find("oneLetterNoti"); levelUpScript = levelUp.GetComponent<NotiController>(); inventoryFullScript = inventoryFull.GetComponent<NotiController>(); fireNotiScript = fireNoti.GetComponent<NotiController>(); iceNotiScript = iceNoti.GetComponent<NotiController>(); slowNotiScript = slowNoti.GetComponent<NotiController>(); knockNotiScript = knockNoti.GetComponent<NotiController>(); healNotiScript = healNoti.GetComponent<NotiController>(); trapNotiScript = trapNoti.GetComponent<NotiController>(); sameLetterNotiScript = sameLetterNoti.GetComponent<NotiController>(); sameWordNotiScript = sameWordNoti.GetComponent<NotiController>(); oneLetterNotiScript = oneLetterNoti.GetComponent<NotiController>(); gameController = GameObject.Find("Game_Controller").GetComponent<Game_Controller>(); noData = GameObject.Find("Nodata"); OptionPanel = GameObject.Find("OptionPanel"); CreditPanel = GameObject.Find("CreditPanel"); DisclaimerPanel = GameObject.Find("DisclaimerPanel"); swordPanel = GameObject.Find("SwordPanel").GetComponent<SwordPanel>(); bowPanel = GameObject.Find("BowPanel").GetComponent<BowPanel>(); clothPanel = GameObject.Find("ClothPanel").GetComponent<ClothPanel>(); bootPanel = GameObject.Find("BootPanel").GetComponent<BootPanel>(); inv = GameObject.Find("Inventory").GetComponent<Inventory>(); TypingProgressDetail = GameObject.Find("TypingProgressDetail").GetComponent<Text>(); currentGameDifficulty = GameObject.Find("currentGameDifficulty").GetComponent<Text>(); characterLevel = GameObject.Find("CharacterLevel").GetComponent<Text>(); characterWorld = GameObject.Find("CharacterWorld").GetComponent<Text>(); characterStory = GameObject.Find("CharacterStory").GetComponent<Text>(); wordDifficultyChar = GameObject.Find("WordDifficultyChar").GetComponent<Text>(); gameDifficultyChar = GameObject.Find("GameDifficultyChar").GetComponent<Text>(); skillFire = GameObject.Find("FireSkillPanel").GetComponent<Skill_Fire>(); skillIce = GameObject.Find("IceSkillPanel").GetComponent<Skill_Ice>(); skillSlow = GameObject.Find("SlowSkillPanel").GetComponent<Skill_Slow>(); skillHeal = GameObject.Find("HealSkillPanel").GetComponent<Skill_Heal>(); skillKnock = GameObject.Find("KnockSkillPanel").GetComponent<Skill_Knock>(); skillTrap = GameObject.Find("TrapSkillPanel").GetComponent<Skill_Trap>(); startPicture = GameObject.Find("StartPicture"); clearButton = GameObject.Find("ClearButton"); playerStatus = GameObject.Find("PlayerStatus"); weaponPanel = GameObject.Find("WeaponPanel"); skillPanel = GameObject.Find("SkillUse"); typingProgressButton = GameObject.Find("TypingProgressButton"); skillButton = GameObject.Find("SkillButton"); inventoryButton = GameObject.Find("InventoryButton"); optionButton = GameObject.Find("Option"); objectivePanel = GameObject.Find("QuestDetail"); newGameButton = GameObject.Find("Start Game"); loadGameButton = GameObject.Find("Load Game"); exitGameButton = GameObject.Find("Exit"); ClearGameScene = GameObject.Find("ClearGameScene"); LoadSaveCloseButton = GameObject.Find("CloseOfLoadSave"); a = GameObject.Find("TextManager").GetComponent<textManager>(); typingProgressMenu = GameObject.Find("TypingProgressPanel"); mainMenu = GameObject.Find("LoadSavePanel"); changeDiffMenu = GameObject.Find("ChangeDifficultyMenu"); LoadScene = GameObject.Find("LoadScene"); loadSceneScript = LoadScene.transform.GetChild(0).GetComponent<Text>().GetComponent<LoadText>(); //checkInLoadText = LoadScene.transform.GetChild(0).GetComponent<Text>().GetComponent<LoadText>().check; SkillToolTip = GameObject.Find("SkillToolTip"); SkillPanel = GameObject.Find("SkillPanel"); detail = GameObject.Find("Detail").GetComponent<Text>(); conversation = GameObject.Find("Conversation"); blackScene = GameObject.Find("BlackScene"); displayGameObj = GameObject.Find("Character"); NPCnameGameObj = GameObject.Find("NPCTitle"); talkGameObj = GameObject.Find("Talk"); continueButton = GameObject.Find("Continue"); choice1 = GameObject.Find("Choice1"); choice2 = GameObject.Find("Choice2"); display = displayGameObj.GetComponent<Image>(); NPCname = NPCnameGameObj.transform.GetChild(0).GetComponent<Text>(); talk = talkGameObj.GetComponent<Text>(); choice1Text = choice1.transform.GetChild(0).GetComponent<Text>(); choice2Text = choice2.transform.GetChild(0).GetComponent<Text>(); levelUp.SetActive(false); inventoryFull.SetActive(false); fireNoti.SetActive(false); iceNoti.SetActive(false); slowNoti.SetActive(false); knockNoti.SetActive(false); healNoti.SetActive(false); trapNoti.SetActive(false); sameLetterNoti.SetActive(false); sameWordNoti.SetActive(false); oneLetterNoti.SetActive(false); noData.SetActive(false); OptionPanel.SetActive(false); DisclaimerPanel.SetActive(false); CreditPanel.SetActive(false); playerStatus.SetActive(false); weaponPanel.SetActive(false); skillPanel.SetActive(false); typingProgressButton.SetActive(false); skillButton.SetActive(false); inventoryButton.SetActive(false); objectivePanel.SetActive(false); clearButton.SetActive(false); ClearGameScene.SetActive(false); typingProgressMenu.SetActive(false); changeDiffMenu.SetActive(false); mainMenu.SetActive(false); blackScene.SetActive(false); displayGameObj.SetActive(false); NPCnameGameObj.SetActive(false); talkGameObj.SetActive(false); continueButton.SetActive(false); choice1.SetActive(false); choice2.SetActive(false); conversation.SetActive(false); SkillPanel.SetActive(false); SkillToolTip.SetActive(false); LoadScene.SetActive(false); playerInThisMap = GameObject.FindGameObjectWithTag ("Player").GetComponent<Player> (); GameObject[] enemySpawn = GameObject.FindGameObjectsWithTag("Enemy"); GameObject[] treasureInMap = GameObject.FindGameObjectsWithTag("Treasure"); foreach(GameObject enemy in enemySpawn){ enemyInThisMap.Add(enemy.GetComponent<Enemy>()); } foreach(GameObject enemy in enemySpawn){ enemy.SetActive(false); } playerInThisMap.gameObject.SetActive(false); foreach (GameObject chest in treasureInMap) { treasureMinigame.Add (chest.GetComponent<Treasure>()); } }