Exemplo n.º 1
0
    void LevelUP()
    {
        var packet = new BuildingClickRequest( );

        packet.index       = (int)info.index;
        packet.clickAction = ClickAction.BuildingLevelUp;
        packet.SendPacket(true, true);
        tooltipBox.End( );
    }
    public void UnitBuy()
    {
        SoundManager.Instance.play(LoadManager.Instance.GetSFXData(SFXType.Tabsound).clip, AudioSettings.dspTime + Time.deltaTime, 0F, 1F);
        if (info == null)
        {
            return;
        }
        var packet = new BuildingClickRequest();

        packet.index       = (int)info.index;
        packet.clickAction = ClickAction.CharacterHire;
        packet.SendPacket(true);
    }
    public void LevelUp()
    {
        SoundManager.Instance.play(LoadManager.Instance.GetSFXData(SFXType.Tabsound).clip, AudioSettings.dspTime + Time.deltaTime, 0F, 1F);
        if (info == null)
        {
            return;
        }
        var packet = new BuildingClickRequest( );

        packet.index       = (int)info.index;
        packet.clickAction = ClickAction.BuildingLevelUp;
        packet.SendPacket(true, true);
        gameObject.SetActive(false);
    }
Exemplo n.º 4
0
    public override void OnSelect( )
    {
        AudioClip clip = LoadManager.Instance.GetSFXData(SFXType.Coin).clip;

        Audio.play(clip, 1F, 0F, 1F);

        BuildingClickRequest request = new BuildingClickRequest( );

        request.index       = (int)info.index;
        request.clickAction = ClickAction.MainBuildingTakeGold;
        request.value       = 1;
        request.SendPacket(false);

        var sheet  = TableManager.Instance.BuildingTable.MainBuildingInfoSheet;
        var record = BaseTable.Get(sheet, "index", (int)info.index);
        int value  = info.LV * (int)record["nextLV"];

        GamePlayer gamePlayer = GameManager.Instance.LocalPlayer;

        gamePlayer.AddGold(ResourceType.Gold, new BigInteger(value));
        GameManager.Instance.GameMode.CurrentPage.OnUpdate( );
    }