void Awake() { canvas = GameObject.Find("Canvas"); panel = canvas.transform.Find("Panel").gameObject; NPC = panel.transform.GetChild(1).gameObject; NPC_big = panel.transform.GetChild(2).gameObject; Player = panel.transform.GetChild(3).gameObject; anim_NPC = NPC.GetComponent <Animator>(); anim_Player = Player.GetComponent <Animator>(); anim_NPC_big = NPC.GetComponent <Animator>(); play_check = FindObjectOfType <DialogueHolder_player>(); }
// Use this for initialization void Start() { canvas = GameObject.Find("Canvas"); panel = canvas.transform.Find("Panel").gameObject; nametext = panel.transform.GetChild(5).gameObject; o = panel.transform.GetChild(0).gameObject; N = panel.transform.GetChild(1).gameObject; N_big = panel.transform.GetChild(2).gameObject; P = panel.transform.GetChild(3).gameObject; Text = panel.transform.GetChild(4).gameObject; P_C = o.GetComponent <Image>(); N_C = N.GetComponent <Image>(); N_B_C = N_big.GetComponent <Image>(); P_P_C = P.GetComponent <Image>(); N_vector = N.GetComponent <RectTransform>(); N_B_vector = N_big.GetComponent <RectTransform>(); P_vector = P.GetComponent <RectTransform>(); Text_T = Text.GetComponent <Text>(); Text_name = nametext.GetComponent <Text>(); // mys = FindObjectOfType<ES_MessageSystem>(); NPC = FindObjectOfType <NPCcontroller_test>(); player = FindObjectOfType <DialogueHolder_player>(); P_C_a = 0; //立繪移動 N_a = -171; N_B_a = -137; P_a = 155; // P_C.color = new Color(P_C.color.r, P_C.color.g, P_C.color.b, P_C_a); N_C.color = new Color(N_C.color.r, N_C.color.g, N_C.color.b, P_C_a); N_B_C.color = new Color(N_B_C.color.r, N_B_C.color.g, N_B_C.color.b, 0); P_P_C.color = new Color(P_P_C.color.r, P_P_C.color.g, P_P_C.color.b, P_C_a); Text_T.color = new Color(Text_T.color.r, Text_T.color.g, Text_T.color.b, P_C_a); Text_name.color = new Color(Text_name.color.r, Text_name.color.g, Text_name.color.b, P_C_a); N_vector.anchoredPosition = new Vector2(N_a, N_vector.anchoredPosition.y); //-157 73 N_B_vector.anchoredPosition = new Vector2(N_B_a, N_B_vector.anchoredPosition.y); P_vector.anchoredPosition = new Vector2(P_a, P_vector.anchoredPosition.y); //142 60 }
void Start() { canvas = GameObject.Find("Canvas"); selectscene_panel = canvas.transform.Find("selectscene_panel").gameObject; panel = canvas.transform.Find("Panel").gameObject; NPC_2D = panel.transform.GetChild(1).gameObject; NPC_2D_big = panel.transform.GetChild(2).gameObject; Player_2D = panel.transform.GetChild(3).gameObject; nametext = panel.transform.GetChild(6).gameObject; text_word = panel.transform.GetChild(4).gameObject.GetComponent <Text>(); DialogueHolder_NPC = FindObjectOfType <DialogueHolder_NPC>(); //NPC_change=NPC_2D; //-------------------- NPC_image = NPC_2D.GetComponent <Image>(); NPC_B_image = NPC_2D_big.GetComponent <Image>(); NPC_anim = NPC_2D.GetComponent <Animator>(); NPC_B_anim = NPC_2D_big.GetComponent <Animator>(); //--------------------- UC = this.GetComponent <UsageCase>(); msgSys = this.GetComponent <ES_MessageSystem>(); player = FindObjectOfType <Animationcontorler>(); NPC = FindObjectOfType <DialogueHolder_player>(); if (panel != null) { panel.SetActive(false); selectscene_panel.SetActive(false); } else { Debug.Log("F**k!"); } time_i = 0; // Player_2D.SetActive(false); // NPC_2D.SetActive(false); fade_P = true; NPC_2D_big.SetActive(false); }
void Start() { // story_number_assign=new int[story_count]; player = FindObjectOfType <Animationcontorler>(); player_check = GameObject.Find("player").gameObject.transform.GetChild(0).gameObject.GetComponent <DialogueHolder_player>(); talk = NPCcontroller_test.ins.gameObject.GetComponent <NPCcontroller_test>(); msgSys = GameObject.Find("talkmanager").GetComponent <ES_MessageSystem>(); option_0 = GameObject.Find("talkmanager").GetComponent <option>(); // pass_text=this.GetComponent<test>(); // M = Resources.Load <Sprite>("NPC/mom_idle_257x396_00"); Flower = Resources.Load <Sprite>("NPC/flower_idle_257x396_anim_00"); // Fu2 = Resources.Load<Sprite>("NPC/FU_character_0"); // M_anim = Resources.Load <RuntimeAnimatorController>("animator/mon_combine_257x396"); Flower_anim = Resources.Load <RuntimeAnimatorController>("animator/flower_anim_257x396"); Fu2_anim = Resources.Load <RuntimeAnimatorController>("animator/FU2_anim"); // txt_mom = Resources.Load <TextAsset>("txt/ui2"); txt_flower = Resources.Load <TextAsset>("txt/ui_flower"); txt_Fu2 = Resources.Load <TextAsset>("txt/ui_Fu2"); txt_TV = Resources.Load <TextAsset>("txt/ui_TV"); txt_book = Resources.Load <TextAsset>("txt/ui_book"); txt_fish = Resources.Load <TextAsset>("txt/ui_fish"); //一開始先用程式打好資料放在格子裡面 if (who == "NPC_mom") { anim = M_anim; cha = M; txt = txt_mom; } else if (who == "NPC_flower") { anim = Flower_anim; cha = Flower; txt = txt_flower; } else if (who == "NPC_fu2") { anim = Fu2_anim; cha = Fu2; txt = txt_Fu2; } else if (who == "TV") { //anim=Flower_anim; // cha=Flower; txt = txt_TV; } else if (who == "book") { txt = txt_book; } else if (who == "fish") { txt = txt_fish; } story_check = new bool[5]; check_big_image(); pass_test(txt);//用box,遇到誰,誰的資料就會轉換 輸出log }