Пример #1
0
    public Vector3 get_slot_position(short flag_index)
    {
        CFlagSlot slot = this.player_flags.Find(obj => obj.is_same(flag_index));

        if (slot == null)
        {
            return(Vector3.zero);
        }

        return(slot.transform.position);
    }
Пример #2
0
    void Awake()
    {
        this.enemy_parent  = transform.FindChild("enemy_parent");
        this.effect_parent = transform.FindChild("effect_parent");

        this.hp_bar = transform.FindChild("red_line").GetComponent <RectTransform>();

        // 플레이어가 터치할 영역의 슬롯을 초기화 한다.
        Transform flag_list = transform.FindChild("flag_list");

        this.player_flags = new List <CFlagSlot>();
        for (int i = 0; i < MAX_PLAYER_SLOTS; ++i)
        {
            CFlagSlot slot =
                flag_list.FindChild(string.Format("button_flag_{0:D2}", (i + 1))).gameObject.AddComponent <CFlagSlot>();
            this.player_flags.Add(slot);
        }


        this.text_level = transform.FindChild("level").GetComponent <Text>();
        transform.FindChild("button_back").GetComponent <Button>().onClick.AddListener(this.on_back);

        reset();
    }