Ejemplo n.º 1
0
    public MenuInGame2(FSM parentFsm, UIManager2 panel1, UIManager2 panel2)
        : base(parentFsm, panel1, panel2, "MenuInGame2.fsm")
    {
        InitUI();

        int stageCode = (int)parentFsm.Variables["stageId"];
    }
Ejemplo n.º 2
0
    public MenuInGame(FSM parentFsm, UIManager2 panel1, UIManager2 panel2)
        : base(parentFsm, panel1, panel2, "MenuInGame.fsm")
    {
        timeClient = TimeManager.Instance.Create();

        InitUI();

        int stageId = (int)parentFsm.Variables["stageId"];

        /*
        // ddong
        if (stageId < 2000)
        {
            stageId += 2000;
        }
        */

        InitStage(stageId, out stageEntity, out gameEntity);

        Rect fieldArea = UI.GetFieldArea();
        field = CreateField(stageEntity, fieldArea, timeClient, fsm);

        // ddong
        int subClassCode = 11;
        int level = 1;
        int trainLevel = 1;

        this.subClassEntity = TableLoader.GetTable<SubClassEntity>().Get(subClassCode);
        ClassLevelEntity levelEntity = TableLoader.GetTable<ClassLevelEntity>().Get(subClassEntity.classCode, level);
        TrainLevelEntity trainLevelEntity = TableLoader.GetTable<TrainLevelEntity>().Get(subClassEntity.classCode, trainLevel);
        FieldObjectEntity objectField = TableLoader.GetTable<FieldObjectEntity>().Get(subClassEntity.objectCode);

        Rect puzzleArea = UI.GetPuzzleArea();
        CreatePuzzle(puzzleArea, timeClient, subClassCode, out puzzleRecord, out puzzlePanel);

        user = CreateUser(stageEntity, UI, fsm);
        heroCharacter = CreateCharacter(objectField, levelEntity, trainLevelEntity, subClassEntity, user, puzzlePanel, itemDropManager, UI.AddBuffIcon, UI.RemoveBuffIcon, fsm);
        itemDropManager = new ConsumableSpawn(stageEntity.gameModeCode, levelEntity.consumableTier);

        Func<float> getLifeDrainRate = (() => gameEntity.defaultHP);
        new PlayerCharacter(user, heroCharacter, getLifeDrainRate, fsm);
        /*
        heroCharacter.Status.RegisterOnChangeEvent(HeroCharacter.Character.HP, OnCharacterHPChanged);
        heroCharacter.Status.RegisterOnChangeEvent(HeroCharacter.Character.HP, UI.ChangeHP);
        heroCharacter.Status.RegisterOnChangeEvent(HeroCharacter.Character.MP, UI.ChangeMana);
        heroCharacter.Status.RegisterOnChangeEvent(HeroCharacter.Character.Armor, UI.ChangeShield);
        */

        UI.InitCommendSlots(fsm, heroCharacter);

        field.AddPlayerCharacter(heroCharacter);
        field.FocusOnForced(heroCharacter, 0);
        puzzlePanel.SetQueue(user.commandQueue);

        var screenPosTable = TableLoader.GetTable<ScreenPositionEntity2>();
        var hpToPos = screenPosTable.Values.Select(x => new KeyValuePair<float, float>(x.hp, x.screenPos));
        convertHPRatioToScreenPos = new RangeConvertor(hpToPos).Convert;

        SetFocusTarget(heroCharacter);
    }
Ejemplo n.º 3
0
    /*WVR_InputId[] buttonIds = new WVR_InputId[]
     * {
     *  WVR_InputId.WVR_InputId_Alias1_Menu,
     *  WVR_InputId.WVR_InputId_Alias1_Grip,
     *  WVR_InputId.WVR_InputId_Alias1_DPad_Left,
     *  WVR_InputId.WVR_InputId_Alias1_DPad_Up,
     *  WVR_InputId.WVR_InputId_Alias1_DPad_Right,
     *  WVR_InputId.WVR_InputId_Alias1_DPad_Down,
     *  WVR_InputId.WVR_InputId_Alias1_Volume_Up,
     *  WVR_InputId.WVR_InputId_Alias1_Volume_Down,
     *  WVR_InputId.WVR_InputId_Alias1_Touchpad,
     *  WVR_InputId.WVR_InputId_Alias1_Trigger,
     *  WVR_InputId.WVR_InputId_Alias1_Digital_Trigger,
     *  WVR_InputId.WVR_InputId_Alias1_System
     * };
     *
     * WVR_InputId[] axisIds = new WVR_InputId[] {
     *  WVR_InputId.WVR_InputId_Alias1_Touchpad,
     *  WVR_InputId.WVR_InputId_Alias1_Trigger
     * };*/

    private void Awake()
    {
        audio          = GetComponent <AudioSource>();
        sel            = GetComponent <SongSelect>();
        prevCount      = danceLights.Length;
        lightsCounter  = 0;
        danceSet[0]    = "isRevR";
        danceSet[1]    = "isRevL";
        danceSet[2]    = "isPointR";
        danceSet[3]    = "isPointL";
        Player         = GameObject.Find("Player").transform;
        Opponent       = GameObject.Find("Dance King").transform;
        oppTarget      = GameObject.Find("opponentPlace").transform;
        danceLights[0] = GameObject.Find("purpLight").GetComponent <Light>();
        danceLights[1] = GameObject.Find("greenLight").GetComponent <Light>();
        danceLights[2] = GameObject.Find("blueLight").GetComponent <Light>();
        animator       = GameObject.Find("Player").GetComponent <Animator>();
        dkAnim         = GameObject.Find("Dance King").GetComponent <Animator>();
        tracker        = GameObject.Find("Player").GetComponent <AudioSource>();
        pm             = GameObject.Find("Player").GetComponent <PlayerMovement>();
        gm             = GameObject.Find("Manager").GetComponent <GameManager>();
        ui             = GameObject.Find("Manager").GetComponent <UIManager2>();
        log            = gm.log;
        plot           = gm.plot;
    }
Ejemplo n.º 4
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
         //Debug.Log("Awake...current level ="+level);
     }
 }
Ejemplo n.º 5
0
    public MenuAdventure(FSM parentFsm, UIManager2 panel1, UIManager2 panel2)
        : base(parentFsm, panel1, panel2, "MenuAdventure.fsm")
    {
        this.parentFsm = parentFsm;

        var stages = TableLoader.GetTable<StageEntity2>().Values;
        this.adventureStages = stages.Where(x => x.gameModeCode == 2);
    }
Ejemplo n.º 6
0
    public MenuBase(FSM parentFsm, UIManager2 panel1, UIManager2 panel2, string fsmPath)
    {
        this.parentFsm = parentFsm;
        this.panel1 = panel1;
        this.panel2 = panel2;

        if (!string.IsNullOrEmpty(fsmPath))
        {
            fsm = new FSM(fsmPath, this);
        }
    }
Ejemplo n.º 7
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Debug.Log("Instance already exists, destroying object!");
         Destroy(this);
     }
 }
Ejemplo n.º 8
0
    public MenuInGame(FSM parentFsm, UIManager2 panel1, UIManager2 panel2)
        : base(parentFsm, panel1, panel2, "MenuInGame.fsm")
    {
        timeClient = TimeManager.Instance.Create();

        InitUI();

        int stageId = (int)parentFsm.Variables["stageId"];
        InitStage(stageId, out stageEntity, out gameEntity);

        Rect fieldArea = UI.GetFieldArea();
        itemDropManager = new ItemDropManager(stageEntity.GameModeType, stageEntity.ConsumableTier);
        field = CreateField(stageEntity, fieldArea, timeClient, itemDropManager, fsm);

        // ddong
        CharacterSelect characterSelect = new CharacterSelect()
        {
            heroLevel = SaveData.level,
            heroId = GetClassCode(SaveData.selectClass),
            equipIds = ArrayTool.Create<int>(),
        };
        this.heroEntity = TableLoader.GetTable<ItemHeroEntity>().Get(characterSelect.heroId);

        Rect puzzleArea = UI.GetPuzzleArea();
        CreatePuzzle(stageEntity, heroEntity.HeroType, puzzleArea, timeClient, out puzzleRecord, out puzzlePanel);

        user = CreateUser(stageEntity, UI, fsm);
        heroCharacter = CreateCharacter(characterSelect, user, puzzlePanel, itemDropManager, UI.AddBuffIcon, UI.RemoveBuffIcon);
        user.SetCharacter(heroCharacter);
        puzzlePanel.SetOwner(heroCharacter);

        Func<float> getLifeDrainRate = (() => gameEntity.DefaultLifeDrainRate + gameEntity.LifeDrainRateIncrease * timeClient.time);
        new PlayerCharacter(user, heroCharacter, getLifeDrainRate, fsm);
        heroCharacter.Status.RegisterOnChangeEvent(HeroCharacter.Character.HP, OnCharacterHPChanged);
        heroCharacter.Status.RegisterOnChangeEvent(HeroCharacter.Character.HP, UI.ChangeHP);
        heroCharacter.Status.RegisterOnChangeEvent(HeroCharacter.Character.MP, UI.ChangeMana);
        heroCharacter.Status.RegisterOnChangeEvent(HeroCharacter.Character.Armor, UI.ChangeShield);

        UI.InitCommendSlots(fsm, heroCharacter);

        field.AddPlayerCharacter(heroCharacter);
        field.FocusOnForced(heroCharacter, 0);
        puzzlePanel.SetQueue(user.commandQueue);

        SetFocusTarget(heroCharacter);

        // ddong
        CutInStarter = StartCutIn;
    }
Ejemplo n.º 9
0
 public void Init(string path, FSM fsm, UIManager2 panel)
 {
     this.path = path;
     this.fsm = fsm;
     this.panel = panel;
 }
Ejemplo n.º 10
0
 public MenuEquip(FSM parentFsm, UIManager2 panel1, UIManager2 panel2)
     : base(parentFsm, panel1, panel2, "MenuEquip.fsm")
 {
 }
Ejemplo n.º 11
0
 // Use this for initialization
 void Start()
 {
     ui2 = GameObject.FindWithTag("ui2").GetComponent <UIManager2>();
 }
Ejemplo n.º 12
0
 public MenuRoot(UIManager2 panel1, UIManager2 panel2)
     : base(null, panel1, panel2, "MenuRoot.fsm")
 {
 }
Ejemplo n.º 13
0
 public MenuAdventure(FSM parentFsm, UIManager2 panel1, UIManager2 panel2)
     : base(parentFsm, panel1, panel2, "MenuAdventure.fsm")
 {
     this.parentFsm = parentFsm;
 }