GC_DEMO define (ProjectBuilder GC_DEMO=1 / -demo) builds GrassCutterDemo.exe for app 5668050 with its own product name, version 0.1-demo and no achievements. Purchases lock after shipping 150 kg; a goal label and a thanks/wishlist card follow. Menu gets a DEMO badge and wishlist button. Store texts (12 languages) and DEMO-badged capsules for the demo page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
45 lines
1.9 KiB
C#
45 lines
1.9 KiB
C#
using System.Collections;
|
|
using UnityEngine;
|
|
|
|
namespace GrassCutter
|
|
{
|
|
public partial class DemoBot
|
|
{
|
|
/// <summary>
|
|
/// -demoend (in a GC_DEMO build): the menu with its wishlist button, the goal on screen, the thank-you screen once
|
|
/// the goal is shipped, and a purchase refused after it.
|
|
/// </summary>
|
|
IEnumerator DemoEndDemo()
|
|
{
|
|
Log($"demo build: {Demo.On}, app {SteamManager.AppId}, version {NetSession.Version}, data {Application.persistentDataPath}");
|
|
BotCapture.From = null;
|
|
yield return new WaitForSeconds(3f);
|
|
yield return Shot("demo_0_menu");
|
|
TeamState.DeleteSave();
|
|
NetSession.Instance.HostLocal();
|
|
while (!Me || !Ts) yield return null;
|
|
yield return new WaitForSeconds(3f);
|
|
Ts.ServerSetMoney(1000d);
|
|
yield return new WaitForSeconds(0.5f);
|
|
yield return Shot("demo_1_goal");
|
|
Ts.BuyToolRpc((byte)ToolId.Scythe);
|
|
yield return new WaitForSeconds(1f);
|
|
Log($"before the goal: scythe bought {(Me.Owns(ToolId.Scythe) ? "yes" : "NO")}, over {Demo.Over}");
|
|
Ts.Shipped.Value = Demo.GoalKg + 3;
|
|
yield return new WaitForSeconds(2f);
|
|
Log($"at the goal: over {Demo.Over}");
|
|
yield return Shot("demo_2_end");
|
|
UIRoot.I.CloseTopModal();
|
|
yield return new WaitForSeconds(0.5f);
|
|
double cash = Ts.Money.Value;
|
|
Ts.BuyToolRpc((byte)ToolId.LongScythe);
|
|
Ts.BuyBeltSlotRpc();
|
|
yield return new WaitForSeconds(1f);
|
|
Log($"after the goal: long scythe {(Me.Owns(ToolId.LongScythe) ? "BOUGHT" : "refused")}, money {cash:0} -> {Ts.Money.Value:0}");
|
|
yield return Shot("demo_3_refused");
|
|
Log("demoend done");
|
|
Application.Quit();
|
|
}
|
|
}
|
|
}
|