コード例 #1
0
 public bool canmove = true; //判定人物可以移動
 void Awake()
 {
     if (play_ins == null)
     {
         play_ins = this;
     }
 }
コード例 #2
0
    void Start()
    {
        talk = FindObjectOfType<changtranform>();
        loading = FindObjectOfType<loading>();
        player = FindObjectOfType<Animationcontorler>();

    }
コード例 #3
0
    void Start()
    {
        Canvas        = GameObject.Find("Canvas");
        Loading_panel = Canvas.transform.Find("loading_panel").gameObject;
        loadText      = Loading_panel.transform.GetChild(0).gameObject;
        loadimage     = Loading_panel.transform.GetChild(1).gameObject;
        scene_name    = Loading_panel.transform.GetChild(2).gameObject;
        //
        loadText_text  = loadText.GetComponent <Text>();
        scenename_text = scene_name.GetComponent <Text>();
        //text_Color = loadText.GetComponent<Image>();
        //
        //Loading_panel_Color = Loading_panel.GetComponent<Image>();
        loadimage_image = loadimage.GetComponent <Image>();
        loading_anim    = Loading_panel.GetComponent <Animator>();
        scene_anim      = scenename_text.GetComponent <Animator>();
        //
        T_a = 0;
        loadText_text.color   = new Color(loadText_text.color.r, loadText_text.color.g, loadText_text.color.b, T_a);
        loadimage_image.color = new Color(loadimage_image.color.r, loadimage_image.color.g, loadimage_image.color.b, T_a);

        Debug.Log(scenename_text.color.a);
        loadText.SetActive(false);
        loadimage.SetActive(false);
        //scene_name.SetActive(false);

        scene_txt      = Resources.Load <TextAsset>("scene_name_txt/scene_name_txt");
        player         = Animationcontorler.play_ins.gameObject.GetComponent <Animationcontorler>();
        player.canmove = true;
        time_i         = 0;
        scene_name_t(scene_txt);
    }
コード例 #4
0
 // public int tranform;
 // Use this for initialization
 void Start()
 {
     // select_script = FindObjectOfType<select_script>();
     //select_script = GameObject.Find("talkmanager").GetComponent<select_script>();
     select_script      = this.GetComponent <select_script>();
     Animationcontorler = GameObject.Find("player").GetComponent <Animationcontorler>();
     UsageCase          = GameObject.Find("talkmanager").GetComponent <UsageCase>();
     talk         = NPCcontroller_test.ins.gameObject.GetComponent <NPCcontroller_test>();
     string_where = "該去哪裡呢?";
 }
コード例 #5
0
    // Use this for initialization
    void Start()
    {
        menu_gameobject = GameObject.Find("menu");
        player          = GameObject.Find("player").GetComponent <Animationcontorler>();
        character       = menu_gameobject.transform.GetChild(2).gameObject;
        inventory       = menu_gameobject.transform.GetChild(3).gameObject;
        saveload        = menu_gameobject.transform.GetChild(4).gameObject;
        gameoption      = menu_gameobject.transform.GetChild(5).gameObject;



        menu_gameobject.SetActive(false);
        index        = 0;
        pauseEnabled = false;
    }
コード例 #6
0
ファイル: attack.cs プロジェクト: MikiMina0/TestRS
 // Use this for initialization
 void Start()
 {
     a1          = GetComponent <Animator>();
     T1          = GetComponent <Transform>();
     player      = FindObjectOfType <Animationcontorler>();
     attack_time = 0;
     a1_B        = true;
     a2_B        = false;
     a3_B        = false;
     // a4_B = false;
     a2_finish = false;
     a3_finish = false;
     // a4_finish = false;
     move_bool  = false;
     move_speed = 0;
 }
コード例 #7
0
    void Start()
    {
        b_test     = new bool[24];
        items_ID   = new int[24];
        fade       = GetComponent <fadeinout_public>();
        database   = GetComponent <Itemdata>();
        player     = GameObject.Find("player").GetComponent <Animationcontorler>();
        slotAmount = 24;

        canvas     = GameObject.Find("Canvas");
        menu       = canvas.transform.GetChild(5).gameObject;
        inventory  = menu.transform.GetChild(3).gameObject;
        info_panel = inventory.transform.GetChild(0).gameObject;
        Panel_00   = inventory.transform.GetChild(1).gameObject;
        Panel      = Panel_00.transform.GetChild(0).gameObject;
        select     = Panel.transform.GetChild(0).gameObject;
        selected   = Panel.transform.GetChild(1).gameObject;
        info_text  = info_panel.transform.GetChild(1).gameObject;
        title_text = info_panel.transform.GetChild(0).gameObject;

        panel_image = Panel_00.GetComponent <Image>();
        panel_info  = info_panel.GetComponent <Image>();

        select_tranform = select.GetComponent <RectTransform>();

        /* pauseEnabled = false;
         *       inventory.SetActive(false);
         * Panel.SetActive(false);
         * info_text.SetActive(false);
         * title_text.SetActive(false);*/
        for (int i = 0; i < slotAmount; i++)
        {
            curitems.Add(new Item());
            curslots.Add(Instantiate(inventorySlot));
            curslots[i].GetComponent <slot>().slot_id = i;
            curslots[i].transform.SetParent(Panel.transform);
        }
        selected.SetActive(false);
    }
コード例 #8
0
    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);
    }
コード例 #9
0
    // Use this for initialization
    void Start()
    {
        tt  = 0;
        map = new GameObject[5];
        Animationcontorler = GameObject.Find("player").GetComponent <Animationcontorler>();
        loading            = FindObjectOfType <loading>();
        NPCcontroller_test = NPCcontroller_test.ins.gameObject.GetComponent <NPCcontroller_test>();

        canvas       = GameObject.Find("Canvas");
        select_panel = canvas.transform.Find("selectscene_panel").gameObject;
        select       = select_panel.transform.GetChild(0).gameObject;
        maplist      = select_panel.transform.GetChild(1).gameObject;

        scene_anim  = select_panel.GetComponent <Animator>();
        scene_image = select_panel.GetComponent <Image>();

        /* for (int i = 1; i < 4; i++) {
         *   maplist.transform.GetChild(i).gameObject.SetActive(false);
         * } */
        for (int i = 0; i < 5; i++)
        {
            t = maplist.transform.GetChild(i).gameObject;

            /*  if (t.activeInHierarchy == false)
             * {  */
            map[tt] = maplist.transform.GetChild(i).gameObject;
            map[tt].SetActive(false);
            tt++;
            //}
        }
        map[0].GetComponent <Text>().text = "浮士德";
        //select_panel.SetActive(false);

        k           = 0;
        k2          = 0;
        story_index = 3;
    }
コード例 #10
0
    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
    }