Example #1
0
    // UI codes which should not be here
    //   public GameObject Enemy_info_HUD;
    //public GameObject Char_detailed_info_hud;
    //   Text _enemy_name;
    //Text _char_detail_info;

    // Use this for initialization
    void Start()
    {
        _fire_cd = fire_cd;
        map_ctr  = map_tiles.GetComponent <Map_Control>();
        turn_ctr = turn_control.GetComponent <Turn_Control>();

        KeyValuePair <float, float> XYpos = new KeyValuePair <float, float>(currentPos % map_ctr.map_size,
                                                                            currentPos / map_ctr.map_size);

        transform.position = new Vector3(-5f + XYpos.Key * 0.5f + XYpos.Value * 0.5f,
                                         0 + XYpos.Key * (0.25f) + XYpos.Value * (-0.25f),
                                         0 + XYpos.Key * (0.01f) + XYpos.Value * (-0.01f));

        //GameObject IngameUI = turn_ctr.UI.gameObject;

        //GameObject MoveOver_Char_info = IngameUI.gameObject.transform.FindChild


        //      GameObject selected_Enemy_name = Enemy_info_HUD.transform.Find("Enemy_avatar_back/Text").gameObject;
        //      _enemy_name = selected_Enemy_name.GetComponent<Text>();
        //      Enemy_info_HUD.SetActive(false);

        //GameObject Mouse_over_Char_name = Char_detailed_info_hud.transform.Find("Char_avatar_back/Text").gameObject;
        //_char_detail_info = Mouse_over_Char_name.GetComponent<Text>();
        //Char_detailed_info_hud.SetActive(false);

        UI_ctr = turn_control.GetComponent <Turn_Control>().UI.GetComponent <InGameUI>();
    }
Example #2
0
    // Use this for initialization
    void Start()
    {
        DialogueManager.gameObject.SetActive(true);

        dm = DialogueManager.GetComponent <DialogueManager>();
        mc = MapController.GetComponent <Map_Control>();
        tc = TurnController.GetComponent <Turn_Control>();
        ui = InGameUI.GetComponent <InGameUI>();

        prev_turn_count = 1;
        curt_turn_count = mc.turn_count;

        //if (Level == 1)
        //{
        //    InGameHUD = InGameUI.transform.GetChild(4).gameObject;
        //    InGameHUD.transform.GetChild(0).gameObject.SetActive(false);
        //    InGameHUD.transform.GetChild(1).gameObject.SetActive(false);
        //    InGameHUD.transform.GetChild(2).gameObject.SetActive(false);
        //}
    }
    List <int> enemyBlockPos = new List <int>();   //for exit



    // Use this for initialization

    void Awake()
    {
        map     = Instantiate(map_prefab);
        UI      = Instantiate(UI_prefab);
        Turn    = Instantiate(Turn_prefab);
        WLcheck = Instantiate(WLcheck_prefab);

        _rdsGeneEnemy = rdsGeneEnemy;


        //LevelManager = Instantiate(LevelManager_prefab);
        //Dialogue = Instantiate(Dialogue_prefab);
        //Dialogue.transform.SetParent(UI.transform);
        //Dialogue.GetComponent<RectTransform>().anchoredPosition = new Vector2(0, 0);
        //Debug.Log(UI.GetComponent<RectTransform>().rect);
        //Dialogue.transform.GetChild(0).gameObject.GetComponent<RectTransform>().rect.Set(0,0,UI.GetComponent<Rect>().width,
        //UI.GetComponent<Rect>().height);
        //for (int i = 0; i < Dialogue.transform.childCount;++i)
        //Dialogue.transform.GetChild(0).GetComponent<RectTransform>().sizeDelta = new Vector2(UI.GetComponent<RectTransform>().rect.width,UI.GetComponent<RectTransform>().rect.height);
        //Dialogue.transform.localScale = new Vector3(1, 1, 1);

        map_ctr     = map.GetComponent <Map_Control>();
        UI_ctr      = UI.GetComponent <InGameUI>();
        Turn_ctr    = Turn.GetComponent <Turn_Control>();
        WLcheck_ctr = WLcheck.GetComponent <WinLoseCheck>();
        //level_ctr = LevelManager.GetComponent<LevelManager>();
        //dialogue_ctr = Dialogue.GetComponent<DialogueManager>();

        //director = timeline.GetComponent<PlayableDirector>();
        //PlayableAsset playable = director.playableAsset;
        //TimelineAsset timelineAsset = (TimelineAsset)playable;
        //TrackAsset UItrack = timelineAsset.GetOutputTrack(6);
        //director.SetGenericBinding(UItrack, UI);
        //director.Play();

        LevelStart();



        UI.SetActive(false);
    }