Exemple #1
0
    public void Init(eTeam team = eTeam.PLAYER)
    #region Function Content
    {
        _equipedItems = new int[4];
        _team         = team;

        InitData();

        ItemList itemList = Manager.Get <GameManager>().itemList;

        _equipedItems[0] = itemList.CodeSearch(GameItem.eCodeType.Helmet, 0);
        _equipedItems[1] = itemList.CodeSearch(GameItem.eCodeType.Bodyarmour, 0);
    }
Exemple #2
0
    private void Awake()
    {
        GetComponent <FieldObject>()._team = _isPlayer ? eTeam.PLAYER : eTeam.ENEMY;

        StartCoroutine(UpdateSpawnObject());

        // Test
        if (!_isPlayer)
        {
            ItemList itemList = Manager.Get <GameManager>().itemList;

            // Test
            _teamUnits = new Team();
            _teamUnits.Init(eTeam.ENEMY);

            int[] items = new int[4];
            items[0] = itemList.CodeSearch(GameItem.eCodeType.Helmet, 1);
            items[1] = itemList.CodeSearch(GameItem.eCodeType.Bodyarmour, 1);
            items[3] = itemList.CodeSearch(GameItem.eCodeType.Weapon, 3);
            _teamUnits.SetEquipedItems(0, items);
            _teamUnits.GetUnit(0).UpdateItems();

            items    = new int[4];
            items[0] = itemList.CodeSearch(GameItem.eCodeType.Helmet, 2);
            items[1] = itemList.CodeSearch(GameItem.eCodeType.Bodyarmour, 2);
            items[3] = itemList.CodeSearch(GameItem.eCodeType.Weapon, 4);
            _teamUnits.SetEquipedItems(1, items);
            _teamUnits.GetUnit(1).UpdateItems();

            items    = new int[4];
            items[0] = itemList.CodeSearch(GameItem.eCodeType.Helmet, 3);
            items[1] = itemList.CodeSearch(GameItem.eCodeType.Bodyarmour, 3);
            items[2] = 303;
            items[3] = 303;
            _teamUnits.SetEquipedItems(2, items);
            _teamUnits.GetUnit(2).UpdateItems();
        }
    }
Exemple #3
0
    // ChoiceUnit
    private void UpdateChoiceUnitUI(int index = -1)
    {
        int selectUnitNum = index == -1 ? _curSelectUnitNum : index;

        UnitStatus unit       = _teams[_curSelectTeamName].GetUnit(selectUnitNum);
        GameObject iconObject = _unitSlots[selectUnitNum].transform.GetChild(1).gameObject;

        RawImage rawImage;

        if ((rawImage = _unitSlots[selectUnitNum].transform.GetChild(0).GetChild(0).GetComponent <RawImage>()))
        {
        }
        else
        {
            LogMessage.Log("UpdateChoiceUnitUI : Unit RawImage Load Error"); return;
        }

        UnitIconManager.Reset(iconObject);

        ItemList itemList = Manager.Get <GameManager>().itemList;

        if ((unit._equipedItems[0] == 0 && unit._equipedItems[1] == 0) ||
            (unit._equipedItems[0] == itemList.CodeSearch(GameItem.eCodeType.Helmet, 0) && unit._equipedItems[1] == itemList.CodeSearch(GameItem.eCodeType.Bodyarmour, 0)))
        { // 알몸 상태 혹은 초기화가 안된상태 = _UnitAddImage.texture
            rawImage.texture = _UnitAddImage.texture;
            rawImage.SetNativeSize();
        }
        else
        {
            _unitPhoto.UpdateTexture(ref rawImage, unit._equipedItems);

            UnitIconManager.Update(iconObject, unit._equipedItems[0]);

            StartCoroutine(UnitTextureWaiting(rawImage));
        }
    }