Esempio n. 1
0
 private Block(E_HeroType heroType, E_BlockType type, int x, int y)
     : base(1, 1, WorldAnchor.MiddleCenter)
 {
     this._heroType = heroType;
     this._blockType = type;
     this.x = x;
     this.y = y;
 }
Esempio n. 2
0
        public Generator(E_HeroType heroType)
        {
            this.heroType = heroType;

            var table = TableLoader.GetTable<BlockSpawn>();
            var data = table.GetMany(heroType).Select(x => new KeyValuePair<float, E_BlockType>(x.Value.chance, x.Value.blockType));
            dart = new Dart<E_BlockType>(data);
        }
Esempio n. 3
0
 public Board(Rect boardRect, PuzzlePanel puzzlePanel, E_HeroType heroType, MatchingHandler matchHandler, Handler onMatchStart, Handler onMatchFinish, TimeClient timeClient)
 {
     layout = new PuzzleLayout(boardRect);
     this.puzzlePanel = puzzlePanel;
     this.blocks = TableLoader.GetTable<BlockEntity>().GetMany(heroType).Select(x => x.Value).ToDictionary(x => x.BlockType);
     this.blockGenerator = new Block.Generator(heroType);
     this.matchHandler = matchHandler;
     this.onMatchStart = onMatchStart;
     this.onMatchFinish = onMatchFinish;
     fsm = new FSM("PuzzleBoard.fsm", this);
 }
Esempio n. 4
0
 public void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info)
 {
     if (stream.IsWriting)
     {
         stream.SendNext(type);
         stream.SendNext(name);
     }
     else
     {
         type = (E_HeroType)stream.ReceiveNext();
         name = (string)stream.ReceiveNext();
     }
 }
Esempio n. 5
0
        public void SetKillLog(string killerName, E_HeroType killerType, string victimName, E_HeroType victimType)
        {
            if (killerName == null)
            {
                this.killerName.text    = "";
                this.killerImage.sprite = heroImages[(int)victimType];
                this.killerImage.color  = Color.clear;
            }
            else
            {
                this.killerName.text = killerName;

                this.killerImage.sprite = heroImages[(int)killerType];
            }
            this.victimName.text    = victimName;
            this.victimImage.sprite = heroImages[(int)victimType];
            GameObject.Destroy(this.gameObject, destroyTime);
        }
Esempio n. 6
0
        public static string GetHeroPhotonNetworkInstanciatePath(E_HeroType type)
        {
            string str = "";

            switch (type)
            {
            case E_HeroType.Soldier:
                str = hero_SoldierPath;
                break;

            case E_HeroType.Hook:
                str = hero_HookPath;
                break;

            default:
                Debug.LogError("GetHeroPhotonNetworkInstanciatePath: 넘겨받은 히어로 타입이 적절치 못함.");
                break;
            }
            return(str);
        }
Esempio n. 7
0
    public PuzzlePanel(Rect rect, E_HeroType heroType, E_GameModeType gameModeType, PuzzleRecord record, TimeClient timeClient)
    {
        this.timeClient = timeClient;
        this.record = record;

        if (box == null)
        {
            Rect captureRect = new Rect(1000, 1000, PuzzleOption.BlockCountX, PuzzleOption.BlockCountY);
            box = new CameraBox("PuzzleCamera", captureRect, rect, -1, 2, 2, null, CullingLayer, timeClient);
            box.GetLayer(1).coord.SetScale(new Vector3(1, -1, 1));
            box.GetLayer(1).coord.Move(new Vector2(-(PuzzleOption.BlockCountX - 1) / 2f, (PuzzleOption.BlockCountY - 1) / 2f));

            //feverGuageBack
            {
                int layer = LayerMask.NameToLayer("Field");
                camera2 = new CameraBox("PuzzleCamera2", captureRect, rect, -1, 2, 1, null, layer, timeClient);
                feverGuageBack = GameObject.Instantiate(Resources.Load("vfx50021_GUI_Summongauge01")) as GameObject;
                feverGuageBack.transform.parent = camera2.transform;
                GameObjectTool.SetLayerRecursively(feverGuageBack.transform, layer);
                SetFeverGuageRatio(0f);
            }
        }

        board = new Board(rect, this, heroType, OnMatching, OnMatchStart, OnMatchFinish, timeClient);

        AddAction(Action.E_Type.Transform_Attack1,
            delegate(float value, GameInstance firer, string[] param)
            {
                board.ChangeBlock(ArrayTool.Create(E_BlockType.Item, E_BlockType.Gather), E_BlockType.Attack1, OnChangeBlock);
                return new ActionHandler.Result(null, value);
            }
        );
        AddAction(Action.E_Type.Transform_Attack2,
            delegate(float value, GameInstance firer, string[] param)
            {
                board.ChangeBlock(ArrayTool.Create(E_BlockType.Item, E_BlockType.Gather), E_BlockType.Attack2, OnChangeBlock);
                return new ActionHandler.Result(null, value);
            }
        );
        AddAction(Action.E_Type.Remove_Ability,
            delegate(float value, GameInstance firer, string[] param)
            {
                board.RemoveAll(E_BlockType.Ability, OnRemoveBlock);
                return new ActionHandler.Result(null, value);
            }
        );
        AddAction(Action.E_Type.Remove_Defend,
            delegate(float value, GameInstance firer, string[] param)
            {
                board.RemoveAll(E_BlockType.Defend, OnRemoveBlock);
                return new ActionHandler.Result(null, value);
            }
        );
        AddAction(Action.E_Type.Remove_Item,
            delegate(float value, GameInstance firer, string[] param)
            {
                board.RemoveAll(E_BlockType.Item, OnRemoveBlock);
                return new ActionHandler.Result(null, value);
            }
        );
        AddAction(Action.E_Type.Remove_Gather,
            delegate(float value, GameInstance firer, string[] param)
            {
                board.RemoveAll(E_BlockType.Gather, OnRemoveBlock);
                return new ActionHandler.Result(null, value);
            }
        );

        /*
        Stat<BlockSpawn> stat = StatLoader.Instance.GetStatTable<E_GameModeType, BlockSpawn>("GameModeType").Get(gameModeType);
        status = new Status(null, stat, null);
        AddAction(Action.E_Type.Buff,
            delegate(float value, GameInstance firer, string[] param)
            {
                Buff.Handle onBuff = null;
                Buff.Handle onDebuff = null;
                int? buffID = Cast.To<int>(value);
                status.AddBuff(buffID.Value, firer.Stat, onBuff, onDebuff);
                return new ActionHandler.Result(null, value);
            }
        );
        AddAction(Action.E_Type.Shuffle,
            delegate(float value, GameInstance firer, string[] param)
            {
                board.Shuffle();
                return new ActionHandler.Result(null, value);
            }
        );
         * */
    }
Esempio n. 8
0
 public void ShowKillLog(string kn, E_HeroType kt)
 {
     InGameUIManager.Instance.ShowKillLog(kn, kt, playerName, heroType);
 }
Esempio n. 9
0
        public void ShowKillLog(string killerName, E_HeroType killerHeroType, string victimName, E_HeroType victimHeroType)
        {
            GameObject temp = GameObject.Instantiate(killLog, killLogPanel);

            temp.GetComponent <KillLog>().SetKillLog(killerName, killerHeroType, victimName, victimHeroType);
        }
Esempio n. 10
0
 void ShowControlPanel(E_HeroType heroType)
 {
     controlPanelPerHero[(int)heroType].SetActive(true);
 }
Esempio n. 11
0
 // fsm interface
 public void SelectClass(E_HeroType heroType)
 {
     SaveData.selectClass = heroType;
 }
Esempio n. 12
0
    // fsm interface
    public void RefreshPreview(E_HeroType heroType)
    {
        Assert.IsTrue(uiCharacterSelect != null, "ShowClassList must be called before");

        uiCharacterSelect.RefreshPreview(heroType);
    }
Esempio n. 13
0
 static int GetClassCode(E_HeroType heroType)
 {
     var table = TableLoader.GetTable<ItemHeroEntity>();
     var entity = table.Values.Where(x => x.HeroType == heroType).SingleOrDefault();
     Assert.IsTrue(entity != null);
     return entity.ItemID;
 }
Esempio n. 14
0
 static void CreatePuzzle(StageEntity stageEntity, E_HeroType heroType, Rect puzzleArea, TimeClient timeClient, out PuzzleRecord puzzleRecord, out PuzzlePanel puzzlePanel)
 {
     puzzleRecord = new PuzzleRecord();
     puzzlePanel = new PuzzlePanel(puzzleArea, heroType, stageEntity.GameModeType, puzzleRecord, timeClient);
 }