예제 #1
0
    // Use this for initialization
    void Start()
    {
        startTime = DateTime.Now;
        endTime   = DateTime.Now;

        //Application.LoadLevel("MainMenu");

        StartCoroutine(APIManager.PostHandyMDOpened());

        StartCoroutine(APIManager.LoadAndSend());

        Screen.sleepTimeout  = SleepTimeout.NeverSleep;
        AudioListener.volume = PlayerPrefs.GetFloat("Audio Volume", 1.0f);

        GroupManager.main.group["Intro"].Add(this, new GroupDelegator(null, LevelIntro, null));
        GroupManager.main.group["Running"].Add(this);
        GroupManager.main.group["Level Start"].Add(this, new GroupDelegator(null, LevelStart, null));
        GroupManager.main.group["Level Over"].Add(this, new GroupDelegator(null, LevelOver, null));
        GroupManager.main.group["Level Select"].Add(this, new GroupDelegator(null, delegate() { success = true; }, null));

        dialogueOff = false;

#if UNITY_EDITOR
        CheatManager.Initialize();
#endif
    }
예제 #2
0
 void RefreshCheats(object[] args)
 {
     foreach (CheatRow row in cheatGroup.GetComponentsInChildren <CheatRow>())
     {
         row.Setup(row.Key, CheatManager.GetCheatList()[row.Key]);
     }
 }
예제 #3
0
 public void Ini(CheatManager cheatManager)
 {
     this.cheatManager = cheatManager;
     inputField.onEndEdit.AddListener(EndEdit);
     EventSystem.current.SetSelectedGameObject(inputField.gameObject);
     timeScale = TimeManager.GetInstance().TimeScale;
     TimeManager.GetInstance().TimeScale = 0;
     TimeManager.GetInstance().pause     = 0;
 }
예제 #4
0
    public void Start()
    {
        CheatManager.OnCheatsDisabled();

        IsLoading = true;
        SceneManager.Instance.DetachCurrentScene();
        SceneManager.Instance.GetTree().Paused = true;

        Invoke.Instance.Perform(Step);
    }
예제 #5
0
    private void OnCheatsToggled(bool pressed)
    {
        Settings.Instance.CheatsEnabled.Value = pressed;
        if (!pressed)
        {
            CheatManager.OnCheatsDisabled();
        }

        UpdateResetSaveButtonState();
    }
예제 #6
0
    void CreateCheatMenu()
    {
        foreach (KeyValuePair <string, object> row in CheatManager.GetCheatList())
        {
            GameObject cheatRow = Instantiate(sampleRow);
            cheatRow.GetComponent <CheatRow>().Setup(row.Key, row.Value);
            cheatRow.transform.parent     = cheatGroup.transform;
            cheatRow.transform.localScale = sampleRow.transform.localScale;
            cheatRow.SetActive(true);
        }

        Destroy(sampleRow);
    }
예제 #7
0
        public Trainer()
        {
            mainWindow = this;
            InitializeComponent();
            MommyMem     mem     = new MommyMem();
            CheatManager manager = new CheatManager();
            int          x       = 13;
            int          y       = 13;

            foreach (Cheat cheat in manager.cheats)
            {
                cheat.addToggleToWindow(x, y);
                y += 23;
                Console.WriteLine("Added {0} to the UI!", cheat.name);
            }
        }
예제 #8
0
    private void Awake()
    {
#if UNITY_EDITOR
        Destroy(gameObject);
        if (Instance == null)
        {
            Instance = this;
        }
        if (Instance != this)
        {
            Destroy(gameObject);
        }

        Debug.LogError("Quitar los cheats para la build final");
#endif
    }
예제 #9
0
 private void Awake()
 {
     if (!useCheat)
     {
         Destroy(gameObject);
         return;
     }
     // if the singleton hasn't been initialized yet
     if (instance != null && instance != this)
     {
         //Destroy(this.gameObject);
         return;
     }
     instance = this;
     DontDestroyOnLoad(this.gameObject);
     GameManager.GetGameManager.OnReturnMenu += Destroy;
 }
예제 #10
0
    void Start()
    {
        borders = Camera.main.ViewportToWorldPoint(new Vector3(0, 0));
        cheat   = GetComponent <CheatManager>();

        GameManager.Instance.Player = this;

        foreach (var i in bulletStartPos)
        {
            i.SetActive(true);
        }
        bulletStartPosParsed = new Transform[bulletStartPos.Length][];
        for (byte i = 0; i < bulletStartPosParsed.Length; ++i)
        {
            bulletStartPosParsed[i] = bulletStartPos[i].GetComponentsInChildren <Transform>().Skip(1).ToArray();
        }
    }
예제 #11
0
    public void LoadLevelFromMenu()
    {
        var attempt = LoadLevelInput.text.ToLower();

        // cheat code first so it can also be a level - for one off level cheats etc
        CheatManager.TryCheat(attempt);

        if (attempt == "dev")
        {
            Dev();
            return;
        }
        else if (!Levels.Classic.ContainsKey(attempt.ToLower()))
        {
            LoadLevelInput.text = "No such level...";
            return;
        }

        LoadLevelWithNoR(attempt, true);
    }
예제 #12
0
    // Start is called before the first frame update
    void Awake()
    {
#if CONSOLE_DEBUG
        if (s_instance == null)
        {
            s_instance = this;
            DontDestroyOnLoad(gameObject);
            m_container?.SetActive(m_consoleEnabled);
            m_cursor          = Instantiate(m_inputText, m_container?.transform);
            m_outputText.text = string.Empty;
            m_inputText.text  = string.Empty;
            CheatManager.GetAllMethodNames(); // used only to init cheat manager, but used later to autocomplete
        }
        else
        {
            Destroy(gameObject);
        }
#else
        Destroy(gameObject);
#endif
    }
예제 #13
0
    private void ExecuteCommand()
    {
        if (string.IsNullOrWhiteSpace(m_inputCommand))
        {
            return;
        }

        Log(m_prefix + m_inputCommand);

        m_currentHistoryIndex = -1;
        m_commandHistory.Add(m_inputCommand);
        if (!CheatManager.Execute(m_inputCommand))
        {
            LogError(CheatManager.ErrorMessage);
        }
        m_inputCommand = string.Empty;

        while (m_commandHistory.Count > MAX_COMMAND_HISTORY)
        {
            m_commandHistory.RemoveAt(0);
        }
    }
예제 #14
0
        /*********
        ** Public methods
        *********/
        /// <summary>The mod entry point, called after the mod is first loaded.</summary>
        /// <param name="helper">Provides simplified APIs for writing mods.</param>
        public override void Entry(IModHelper helper)
        {
            // load config
            this.Config = helper.ReadConfig <ModConfig>();
            this.Monitor.Log($"Started with menu key {this.Config.OpenMenuKey}.");

            // load warps
            try
            {
                this.Warps = helper.Data.ReadJsonFile <ModData>("assets/warps.json");
                if (this.Warps == null)
                {
                    this.Monitor.Log("Some of the mod files are missing (assets/warps.json); try reinstalling this mod.", LogLevel.Error);
                    return;
                }
            }
            catch (Exception ex)
            {
                this.Monitor.Log($"Some of the mod files are broken or corrupted (assets/warps.json); try reinstalling this mod.\n{ex}", LogLevel.Error);
            }

            // load cheats
            this.ResetLocationCache();
            this.Cheats = new CheatManager(this.Config, this.Helper.Reflection, this.Helper.Translation, () => this.Locations.Value, this.Warps);

            // hook events
            helper.Events.Display.Rendered    += this.OnRendered;
            helper.Events.Display.MenuChanged += this.OnMenuChanged;

            helper.Events.GameLoop.ReturnedToTitle += this.OnReturnedToTitle;
            helper.Events.GameLoop.SaveLoaded      += this.OnSaveLoaded;
            helper.Events.GameLoop.UpdateTicked    += this.OnUpdateTicked;

            helper.Events.Input.ButtonPressed  += this.OnButtonPressed;
            helper.Events.Input.ButtonReleased += this.OnButtonReleased;

            helper.Events.World.LocationListChanged += this.OnLocationListChanged;
        }
    // Start is called before the first frame update
    void Start()
    {
        switch (Application.platform)
        {
        case RuntimePlatform.OSXEditor:
        case RuntimePlatform.OSXPlayer:
            shoot = (tag == "Player1_obj" ? "shoot-1-mac" : "shoot-2-mac");
            break;

        case RuntimePlatform.WindowsEditor:
        case RuntimePlatform.WindowsPlayer:
            shoot = (tag == "Player1_obj" ? "shoot-1-pc" : "shoot-2-pc");
            break;

        default:
            Debug.LogError("Mappings not setup for operating systems other than Windows or Mac OS");
            break;
        }
        reloadTimer = 0f;
        bullets     = new List <Bullet>();
        // Start counter at 0, used in RecycleBullets()
        objectPoolCounter = 0;
        // Sets initial state for shooting SM
        state = SHOOT_States.WAIT;

        tc         = GetComponent <TankController>();
        shootSound = GetComponent <AudioSource>();

        GameObject manager = GameObject.Find("GameManager");

        cheater = (manager == null ? null : manager.GetComponent <CheatManager>());
        Assert.IsTrue(cheater != null,
                      "CheatManager couldn't be found from ShootController.\n" +
                      "Does your scene have an object called \"GameManager\"\n" +
                      "and does that object have a CheatManager component?");
    }
예제 #16
0
    void Awake()
    {
        if (instance != null && instance != this)
        {
            Destroy(gameObject);
            return;
        }
        else
        {
            instance = this;
        }

        DontDestroyOnLoad(gameObject);
    }
예제 #17
0
 private void OnSpawnEnemyClicked()
 {
     CheatManager.SpawnEnemy();
 }
예제 #18
0
 private void OnEnteringGame()
 {
     CheatManager.OnCheatsDisabled();
 }
예제 #19
0
 public static void Initialize()
 {
     Instance = new CheatManager();
 }
예제 #20
0
 void Awake()
 {
     m_instance = this;
     InvokeRepeating("HeartFPS", UnityEngine.Random.Range(0, HeartRate), HeartRate);
     //InvokeRepeating("CheckNetWork", 1, 1);
 }
예제 #21
0
 public Core()
 {
     cheatManager = CheatManager.getInstance();
     renderer     = new DefaultRenderer();
 }
예제 #22
0
 private void OnPlayerDivideClicked()
 {
     CheatManager.PlayerDuplication();
 }
예제 #23
0
 private void OnEnteringGame()
 {
     CheatManager.OnCheatsDisabled();
     SaveHelper.ClearLastSaveTime();
 }