Esempio n. 1
0
    // start new playthrough
    public void Init(int level, int checkpointNum)
    {
        PlaythroughData newPlaythrough = new PlaythroughData() { Id = PlaythroughData.Count, Date = DateTime.Now };

        // populate checkpoint data with starting values
        CheckpointData[] cd = CheckpointData.ArrayOf(checkpointNum);
        cd[0].Reached = true;
        newPlaythrough.LevelData.Add(new LevelData() { Id = level, CheckpointData = cd });

        PlaythroughData.Add(newPlaythrough);
    }
 void Awake()
 {
     if (instance)
     {
         GameObject.Destroy(gameObject);
     }
     else
     {
         instance = this;
         GameObject.DontDestroyOnLoad(gameObject);
     }
 }
    void Start()
    {
        PlaythroughData data = GameObject.FindObjectOfType <PlaythroughData>();

        if (data)
        {
            Text   display = GetComponent <Text>();
            string text    = display.text;

            text = text.Replace("{MINUTES}", "" + Mathf.Floor(data.timeSinceGameStart / 60f));
            text = text.Replace("{SECONDS}", "" + Mathf.Floor(data.timeSinceGameStart % 60f));

            display.text = text;
        }
    }
Esempio n. 4
0
        public override void Start()
        {
            if (!BraveRandom.IsInitialized())
            {
                BraveRandom.InitializeRandom();
            }

            // Init DRM Hooks
            Hooks.Init();

            // Init EnemyAPI
            EnemyAPI.Hooks.Init();
            EnemyAPI.Tools.Init();

            // Set Up Commands
            #region Commands
            ETGModConsole.Commands.AddGroup("thesis", args =>
            {
                Log("DR Mod is running and the experiment scenario will be created.\n" +
                    "\tThe following sub-commands are available:\n" +
                    "\t\tdebug - toggles debug messages for the experiment;\n");
            });

            ETGModConsole.Commands.GetGroup("thesis").AddUnit("debug", args =>
            {
                Debug = !Debug;

                Log("DR Mod - Debug messages " + (Debug ? "activated" : "deactivated"));
            });
            #endregion

            this.OverrideQuickStart();

            Controller = ETGModMainBehaviour.Instance
                         .gameObject.AddComponent <DynamicRandomnessController>();

            Data = new PlaythroughData(Order, Time.time);

            Log($"{MOD_NAME} v{VERSION} started successfully.", TEXT_COLOR);

            Log($"Experiment Variant -> {Order}");
        }