Exemplo n.º 1
0
    public void LoadHider()
    {
        allHiders = new List <HiderInfo> ();
        List <TIVInfo> tasks      = FightModel.Instance.fightInfo.task;
        int            hiderCount = 0;
        int            i;

        for (i = 0; i < tasks.Count; i++)
        {
            TIVInfo task = tasks[i];
            if (task.id == 40106)
            {
                hiderCount = (int)task.value;
                break;
            }
        }

        List <Vector2> allFloorPos = FloorModel.Instance.GetAllFloorPos();

        for (i = 0; i < hiderCount; i++)
        {
            if (allFloorPos.Count > 0)
            {
                int     randomIndex = UnityEngine.Random.Range(0, allFloorPos.Count);
                Vector2 floorPos    = allFloorPos [randomIndex];
                allFloorPos.RemoveAt(randomIndex);

                HiderInfo hider = new HiderInfo();
                hider.configId = 40106;
                hider.posX     = (int)floorPos.x;
                hider.posY     = (int)floorPos.y;
                allHiders.Add(hider);
            }
        }
    }
Exemplo n.º 2
0
    public void BackUpUnLock(List <int> unLockIds)
    {
        backUpUnLocks = new List <int>();

        for (int i = 0; i < unLockIds.Count; i++)
        {
            HiderInfo hiderInfo = GetInfoByRunId(unLockIds[i]);
            backUpUnLocks.Add(hiderInfo.configId);
        }
    }
Exemplo n.º 3
0
    public override void ShowList()
    {
        base.ShowList();

        int i;

        for (i = 0; i < HideModel.Instance.allHiders.Count; i++)
        {
            HiderInfo hiderInfo = HideModel.Instance.allHiders[i];
            CreateHiderItem(hiderInfo);
        }
    }
Exemplo n.º 4
0
    public HiderInfo GetInfoByRunId(int runId)
    {
        for (int i = 0; i < allHiders.Count; i++)
        {
            HiderInfo hiderInfo = allHiders[i];

            if (hiderInfo.runId == runId)
            {
                return(hiderInfo);
            }
        }
        return(null);
    }
Exemplo n.º 5
0
    public List <int> UnLock()
    {
        List <int> unLockIds = new List <int>();

        for (int i = 0; i < allHiders.Count; i++)
        {
            HiderInfo hiderInfo = allHiders[i];
            bool      isExpose  = hiderInfo.Expose();
            if (isExpose)
            {
                unLockIds.Add(hiderInfo.runId);
            }
        }
        return(unLockIds);
    }
Exemplo n.º 6
0
    protected GameObject CreateHiderItem(HiderInfo hiderInfo)
    {
        if (hiderInfo.isNull)
        {
            return(null);
        }

        GameObject item = list.NewItem();

        item.name = hiderInfo.posX + "_" + hiderInfo.posY;

        FightHideItem itemCtr = item.AddComponent <FightHideItem>();

        itemCtr.hiderInfo = hiderInfo;
        itemCtr.type      = type;
        itemCtr.icon      = hiderInfo.configId;
        PosMgr.SetFightCellPos(item.transform, hiderInfo.posX, hiderInfo.posY);
        return(item);
    }