private void Start() { questWrapper = this.GetComponentInParent <QuestWrapper>(); questWrapper.questContainers.Add(this); thisImage = GetComponent <Image>(); this.button = GetComponent <Button>(); }
public void initilize(Player player) { this.player = player; UI = player.getUI(); questGiverObject = player.getQuestInformationData().transform.GetChild(3).GetChild(0).gameObject; img = questGiverObject.GetComponent <Image>(); wrapper = player.getQuestInformationData().questWrapper.GetComponent <QuestWrapper>(); for (int i = 0; i < npcs.Length; i++) { NPCMain main = npcs[i].GetComponent <NPCMain>(); main.uniqueId = i; main.dialogueUI_questDescription = this.dialogueUI_questDescription; main.dialogueUI_questGiverFace = this.dialogueUI_questGiverFace; main.dialogueUI_questGiverName = this.dialogueUI_questGiverName; main.dialogueUI = this.dialogueUI; main.gameObject.SetActive(true); npcMain.Add(main); } }
public override void OnStartLocalPlayer() { if (!isLocalPlayer) { return; } commandManager = new CommandManager(this); for (int i = 0; i < prefabsToRegister.Length; i++) { ClientScene.RegisterPrefab(prefabsToRegister [i]); } ResourceStructure.initilize(); /* * ClientScene.RegisterPrefab((GameObject)Resources.Load("Prefabs/Enemy")); * ClientScene.RegisterPrefab((GameObject)Resources.Load("Particles/Hit")); * ClientScene.RegisterPrefab((GameObject)Resources.Load("Particles/ImpactOnGround")); * ClientScene.RegisterPrefab(skillPrefab); * ClientScene.RegisterPrefab(skillEffectPrefab);*/ //UI UICanvas = GameObject.Find("UI"); login = Tools.findInactiveChild(UICanvas, "Login_UI").GetComponent <Login>(); this.movement = GetComponent <PlayerMovement>(); //skills this.skillUi = Tools.findInactiveChild(UICanvas, "Actionbar_UI").GetComponent <SkillUIManager>(); this.skillUi.init(this); this.skillManager = GetComponent <SkillManager>(); this.skillManager.init(this, getSkillUiManager()); //this.skillTreeUi = GameObject.Find(this.skillTreeUi.name) //network network = GetComponent <playerNetwork>(); network.initialize(this); this.skillTreeUi = Tools.getChild(UICanvas, this.skillTreeUi.name); //chat chat = Tools.getChild(UICanvas, "Chat_UI").GetComponent <Chat>(); chat.setPlayer(this); //inventory this.inventory = this.GetComponent <Inventory> (); this.inventory.init(this); //equip equip = Tools.getChild(UICanvas, "Equipment_UI").GetComponent <EquipmentHandler>(); equip.setEquipmentUI(Tools.getChild(UICanvas, "Equipment_UI")); equip.setPlayer(this); //camera camera = Camera.main; camera.GetComponent <MainCamera> ().player = this.gameObject; camera.GetComponent <MainCamera> ().setState((int)e_cameraStates.DEFAULT); //worlds worlds[0] = GameObject.Find("login_World"); worlds[1] = GameObject.Find("World"); //TempQuestUI GameObject tempQuestUI = Instantiate(this.quest_UI); this.questInformationData = tempQuestUI.GetComponentInChildren <QuestInformationData>(); tempQuestUI.transform.SetParent(this.getUI().transform); tempQuestUI.transform.SetAsLastSibling(); tempQuestUI.SetActive(false); questInformationObject = tempQuestUI; //QuestWrapper questWrapper = getUI().transform.GetChild(getUI().transform.childCount - 1).GetChild(1).GetChild(0).GetComponent <QuestWrapper>(); //UIPlayer this.UIPlayer = Tools.findInactiveChild(UICanvas, "Footer_UI").GetComponent <UIPlayerHandler>(); this.UIPlayer.setPlayer(this); this.UIPlayer.gameObject.SetActive(true); this.UIPlayer.updateInfo(); this.UIActionBar = Tools.findInactiveChild(UICanvas, "Actionbar_UI"); UIActionBar.SetActive(true); this.uiStats = Tools.findInactiveChild(UICanvas, "Stat_UI").GetComponent <UIStats>(); uiStats.gameObject.SetActive(false); Debug.Log("STATS: " + this.stats.s_str); this.UIDeath = Tools.findInactiveChild(this.getUI(), "Death_UI"); this.UIDeath.SetActive(true); this.UIDeath.GetComponent <GraveStone>().player = this; this.UIDeath.SetActive(false); //QuestManager this.npcController = GameObject.FindWithTag("NPCManager").GetComponent <NPCController>(); npcController.initilize(this); identity = this.GetComponent <NetworkIdentity>(); Debug.Log("INFO1!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); }