Esempio n. 1
0
    private GameObject CreateFgItem(int posX, int posY, int icon)
    {
        if (icon <= 0)
        {
            CellInfo cell = CellModel.Instance.GetCellByPos(posX - BattleModel.Instance.crtBattle.start_x, -posY + BattleModel.Instance.crtBattle.start_y);
            if (cell != null && cell.config != null)
            {
                if (cell.config.id != 10001)
                {
                    return(null);
                }
                else
                {
                    icon = 10302;
                }
            }
            else
            {
                return(null);
            }
        }

        GameObject item = list.NewItem();

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

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

        itemCtr.type = type;
        itemCtr.icon = icon;
        PosUtil.SetCellPos(item.transform, posX, posY);
        return(item);
    }
Esempio n. 2
0
    private void CreateHiveItem(int posX, int posY, float scale = 1)
    {
        GameObject item = list.NewItem();

        item.name = posX + "_" + posY;
        PosUtil.SetCellPos(item.transform, posX, posY);
        item.transform.localScale = new Vector3(scale, scale, 1);
    }
Esempio n. 3
0
    private void InitView()
    {
        musicMute.isOn = AudioModel.Instance.GetIsMute(false);
        soundMute.isOn = AudioModel.Instance.GetIsMute(true);

        PosUtil.SetCellPos(musicMute.transform, -1, 1);
        PosUtil.SetCellPos(soundMute.transform, 0, 1);
        PosUtil.SetCellPos(sortBtn.transform, -1, 0);
        PosUtil.SetCellPos(reviewBtn.transform, 1, 0);
    }
Esempio n. 4
0
    private void InitHoleList(bool playEffect)
    {
        listHole.ClearList();

        int           i;
        SkillHoleItem findNextOpen = null;

        for (i = 1; i <= SkillTempletModel.MAX_LEVEL; i++)
        {
            GameObject item = listHole.NewItem();
            item.name = skillTempletInfo.config.cellId + "_" + i;

            SkillHoleItem itemCtr = item.GetComponent <SkillHoleItem>();
            itemCtr.skillGroupInfo = skillGroupInfo;
            itemCtr.islock         = false;
            itemCtr.ShowName("");
            itemCtr.waitAnim.enabled = false;
            if (i > skillTempletInfo.lv)
            {
                if (findNextOpen == null)
                {
                    findNextOpen             = itemCtr;
                    itemCtr.waitAnim.enabled = true;
                }
                else
                {
                    itemCtr.islock = true;
                }
            }
            else
            {
                if (i > 1)
                {
                    itemCtr.bombImage.color = ColorUtil.GetColor(ColorUtil.MAP_PASS, 0.9f);
                }
            }

            Vector2 pos = SkillTempletModel.Instance.GetHolePos(i, false, skillTempletInfo.config.dir);
            PosUtil.SetCellPos(item.transform, (int)pos.x, (int)pos.y + 1, 1.1f);

            if (i == 1)
            {
                itemCtr.icon = skillTempletInfo.config.cellId;
                itemCtr.bombImage.gameObject.SetActive(false);
            }
            else if (i == skillTempletInfo.lv && playEffect)
            {
                itemCtr.iconImage.gameObject.SetActive(false);
                GameObject effectPrefab = ResModel.Instance.GetPrefab("effect/" + "effect_fireworks");
                GameObject itemEffect   = GameObject.Instantiate(effectPrefab);
                itemEffect.transform.SetParent(itemCtr.transform, false);
                itemEffect.transform.SetParent(transform, true);
            }
        }
    }
Esempio n. 5
0
    private void CreateItem(SkillSeedInfo seed)
    {
        GameObject item = list.NewItem();

        item.name = "skill_" + seed.runId;
        SkillItem itemCtr = item.GetComponent <SkillItem>();

        itemCtr.icon = seed.GetCellIcon();
        itemCtr.SetHideId(seed.GetHideCellId());
        itemCtr.ShowLock(seed.fobid);
        PosUtil.SetCellPos(item.transform, seed.seed_x, seed.seed_y, 1.0f);
    }
Esempio n. 6
0
    private void CreatTempletItem(SkillGroupInfo info, SkillTempletInfo skillTempletInfo, int index)
    {
        GameObject item = list.NewItem();

        item.name = "skill_" + skillTempletInfo.config.cellId;

        PosUtil.SetCellPos(item.transform, 0, 0);

        SkillTemplet itemCtr = item.GetComponent <SkillTemplet>();

        itemCtr.Init(info, skillTempletInfo);
    }
Esempio n. 7
0
    void Start()
    {
        PlayerModel.Instance.LoadWeaths();
        MapModel.Instance.LoadMaps();
        SkillTempletModel.Instance.LoadSkillTemplets();
        GuideModel.Instance.InitGuide();
        ADModel.Instance.LoadADData();


        PosUtil.SetCellPos(setBtn.transform, 0, -2);

        EventTriggerListener.Get(startBtn.gameObject).onClick = OnClickStart;
        EventTriggerListener.Get(setBtn.gameObject).onClick   = OnSetClick;
    }
Esempio n. 8
0
    private void CreateControlItem(int posX, int posY)
    {
        GameObject item = list.NewItem();

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

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

        PosUtil.SetCellPos(item.transform, posX, posY);
        itemCtr.control_x = posX - BattleModel.Instance.crtBattle.start_x;
        itemCtr.control_y = -posY + BattleModel.Instance.crtBattle.start_y;

        EventTriggerListener.Get(item).onDown  += ItemDownHander;
        EventTriggerListener.Get(item).onEnter += ItemEnterHander;
        //EventTriggerListener.Get(item).onUp += ItemUpHander;
    }
Esempio n. 9
0
    private void CreateSmallItem(SkillGroupInfo skillTempletGroupInfo, int index)
    {
        GameObject item = smallList.NewItem();

        PosUtil.SetCellPos(item.transform, index - 2, -5);

        item.name = "skill_" + skillTempletGroupInfo.GetGroupId();

        SkillSmallItem itemCtr = item.GetComponent <SkillSmallItem>();

        itemCtr.toggle.group          = smallToggleGroup;
        itemCtr.skillTempletGroupInfo = skillTempletGroupInfo;
        itemCtr.ShowName("");
        itemCtr.icon = skillTempletGroupInfo.GetGroupId();
        EventTriggerListener.Get(item).onClick = OnSmallClick;
        itemCtr.selectTempletEvent            += OnSelectTemplet;
    }
Esempio n. 10
0
    private void PlayPutAutoSkill()
    {
        rootAction = new OrderAction();

        WaitActor waitActor = new WaitActor(200);

        rootAction.AddNode(waitActor);

        List <SkillEntityInfo> skillEntitys = SkillModel.Instance.GetNewSkillEntitys();

        fightUI.ShowSkill();


        if (lastTouchCell != null && skillEntitys.Count > 0)
        {
            ParallelAction parallelAction = new ParallelAction();
            int            holdIndex      = 0;
            bool           lastIsHump     = lastTouchCell.IsHump();
            for (int i = 0; i < skillEntitys.Count; i++)
            {
                OrderAction skillOrder = new OrderAction();

                SkillEntityInfo skillEntity = skillEntitys[i];

                Vector2 addPos = new Vector2();

                for (int h = holdIndex; h < 19; h++)
                {
                    Vector2 holePos = FightConst.GetHoleByLevel(h, lastIsHump);

                    Vector2 checkPos = new Vector2(lastTouchCell.posX + holePos.x, lastTouchCell.posY - holePos.y);

                    CellInfo checkCell = CellModel.Instance.GetCellByPos((int)checkPos.x, (int)checkPos.y);

                    if (checkCell != null && checkCell.isBlank)
                    {
                        addPos    = checkPos;
                        holdIndex = h + 1;
                        break;
                    }
                }

                CellInfo addItem = CellModel.Instance.AddItem(skillEntity.seed.config_cell_item.id, (int)addPos.x, (int)addPos.y);

                SkillModel.Instance.ThrowSkillEntity(skillEntity, addItem);

                GameObject itemObj = CreateCellItem(addItem);
                itemObj.transform.SetParent(effectLayer.transform, false);
                Vector2 toPos = PosUtil.GetFightCellPos(addItem.posX, addItem.posY);
                PosUtil.SetCellPos(itemObj.transform, skillEntity.seed.seed_x, skillEntity.seed.seed_y, 1.0f);

                rootAction.AddNode(new PlaySoundActor("Useskill"));

                rootAction.AddNode(new ShowEffectActor(itemObj.transform, "effect_skill_fly"));

                rootAction.AddNode(new MoveActor((RectTransform)itemObj.transform, new Vector3(toPos.x, toPos.y, 0), 1200));

                skillOrder.AddNode(new SetLayerActor(itemObj.transform, transform));
                skillOrder.AddNode(new PlaySoundActor("PutAutoSkill"));
                skillOrder.AddNode(new ClearEffectActor(itemObj.transform, "effect_skill_fly"));
                skillOrder.AddNode(new ScaleActor((RectTransform)itemObj.transform, new Vector3(1.2f, 1.2f, 0), 0.2f));
                skillOrder.AddNode(new ScaleActor((RectTransform)itemObj.transform, new Vector3(1, 1, 0), 0.1f));

                parallelAction.AddNode(skillOrder);
            }
            rootAction.AddNode(parallelAction);
        }

        waitActor = new WaitActor(200);
        rootAction.AddNode(waitActor);
        ExecuteAction(FightStadus.auto_skill);
    }
Esempio n. 11
0
 void Start()
 {
     PosUtil.SetCellPos(closeBtn.transform, 3, 5);
 }