Beispiel #1
0
    public void Init()
    {
        sp       = GameCore.Instance.Get <ServerPort>();
        replayer = new BattleReplayer();
        GameCore.Instance.Add("Replayer", replayer);
        GameCore.Instance.Room = this;

        OnMessageDirectly("BattleBegin", OnBattleBeginMsg);
        OnMessageDirectly("FF", OnFrameMoveForwardMsg);
        OnMessageDirectly("BattleEnd", OnBattleEndMsg);

        // BufferMessage("SetPath", OnSetPathMsg);
        BufferMessage("CosntructBuildingUnit", OnCosntructBuildingUnitMsg);
        BufferMessage("ConstructCrystalMachine", OnConstructCrystalMachineMsg);
        BufferMessage("ConstructAccessory", OnConstructAccessoryMsg);
        BufferMessage("ReconstructBuilding", OnRecosntructBuildingMsg);
        BufferMessage("CancelBuilding", OnCancelBuildingMsg);
        BufferMessage("DestroyBuilding", OnDestroyBuildingMsg);
        BufferMessage("CheatCode", OnCheatCodeMsg);
        BufferMessage("DropSoldierFromCarrier", OnDropSoldierFromCarrierMsg);
        BufferMessage("AddUnitAt", OnAddUnitAtMsg);
        BufferMessage("PlayerSwitched", OnPlayersSwitchedMsg);
        BufferMessage("AddBattleUnitAt", OnAddBattleUnitAtMsg);
        BufferMessage("AddBattleUnit4TestAnyway", OnAddBattleUnit4TestAnyway);
        BufferMessage("AddBuildingUnit4TestAnyway", OnAddBuildingUnit4TestAnyway);
        BufferMessage("AddSoldierCarrierUnit4TestAnyway", OnAddSoldierCarrierUnit4TestAnyway);
        BufferMessage("Crash", OnCrashMsg);
    }
Beispiel #2
0
 public void ResetAll(bool inReplay)
 {
     br = GameCore.Instance.Get <BattleReplayer>();
     PrograssBar.fillAmount = 0;
     speedUp            = 1;
     br.SpeedUpFactor   = speedUp;
     SpeedUpText.text   = speedUp + "X";
     MC.TurnOnBattleFog = !inReplay;
     gameObject.SetActive(inReplay);
 }