Inheritance: MonoBehaviour
Ejemplo n.º 1
0
 private void OnPlayerDeath()
 {
     if (ResetGame != null)
     {
         ResetGame.Invoke();
     }
 }
Ejemplo n.º 2
0
    public void Start()
    {
        inputManager        = GetComponent <InputManager>();
        uiController        = GetComponent <UIController>();
        stateMachineManager = GetComponent <StateMachineManager>();
        gameMath            = GetComponent <GameMath>();
        timeCalculations    = GetComponent <TimeCalculations>();
        save      = GetComponent <Save>();
        load      = GetComponent <Load>();
        player    = GetComponent <Player>();
        resetGame = GetComponent <ResetGame>();

        if (PlayerPrefs.GetInt("CheckIfGameIsSaved") == 1)
        {
            load.LoadGameState();
            uiController.UIControllerUpdate();
            gameMath.GetingGameState();
            gameMath.CalculateLoadGameState();
            CallingGameMathForHungerAndHappienessLoss();
        }

        if (PlayerPrefs.GetInt("OrginalStartBool") == 1)
        {
            load.LoadOrignalGameDate();
        }

        if (PlayerPrefs.GetInt("CheckIfGameIsSaved") != 1)
        {
            SetGameStart();
        }
    }
Ejemplo n.º 3
0
 public void BackButton()
 {
     fader.gameObject.SetActive(true);
     fader.DOColor(Color.black, 2f).onComplete = () =>
     {
         mainMenuPanel.gameObject.SetActive(true);
         mainMenuPanel.alpha = 1;
         ResetGame?.Invoke();
     };
 }
Ejemplo n.º 4
0
        //Open
        public Client(Player a, GetPlayerMove b, FindMatch c, RichTextBox d, ResetGame e, MainForm f)
        {
            player = a;
            wc     = new WebClient();

            mainform      = f;
            getplayermove = b;
            findmatch     = c;
            output        = d;
            resetgame     = e;

            MatchFinder = new Thread(FindQueue);
            MoveFinder  = new Thread(GetOpponentMove);
        }
Ejemplo n.º 5
0
        //LOAD
        private void NewForm_Load(object sender, EventArgs e)
        {
            graphics      = Screen.CreateGraphics();
            unitdestroly  = OnUnitDestroly;
            sakkfor       = OnSakkFor;
            findmatch     = MatchFound;
            getplayermove = OppMove;
            resetgame     = Reset;
            endform       = new GEndForm(this);
            label5.Text  += version;

            this.Opacity = 0;
            nameinput    = new Chess.NameInput(this);
            nameinput.Show();
        }
Ejemplo n.º 6
0
    private void Start()
    {
        tiles = new Dictionary <Vector2, Tile>();

        resetGame += ResetBoard;
        resetGame();

        display.gameObject.SetActive(false);
        attackButton.SetActive(false);

        shop.SetupShop(teams);
        shop.HideShop();
        shop.unitBought += UpdateUI;

        UpdateUI();
    }
Ejemplo n.º 7
0
    private void Awake()
    {
        int gameStatusCount = FindObjectsOfType <GameStatus>().Length;

        if (gameStatusCount > 1)
        {
            Destroy(gameObject);
            return;
        }
        else
        {
            DontDestroyOnLoad(gameObject);
            ResetGame.RegisterListener(onGameRestart);
            BlockDespawn.RegisterListener(OnBlockDespawn);
            SceneManager.sceneLoaded += onSceneLoaded;
        }
    }
Ejemplo n.º 8
0
 public MapViewModel()
 {
     PlayerData         = new PlayerDataModel(100, 200);
     this.simpleCommand = new SimpleCommand(this);
     this.towerCommand  = new PlaceTowerCommand(this);
     this.resetGame     = new ResetGame(this);
     //Creates tick object
     Tick = new TickTimer(this);
     LoadRoute();
     StartGame();
     //Adds debug enemy
     //Starts game
     RoutedEvent[] events = EventManager.GetRoutedEvents();
     TowerHover.TowerHoverVisibillity = 0.0;
     for (int i = 0; i < 5; i++)
     {
         GenerateRockFormations();
     }
 }
Ejemplo n.º 9
0
        public Table(Graphics a, Player b, Player c, RichTextBox d, UnitDestroly e, SakkFor f, ResetGame g)
        {
            //Get Grap Create Recs
            output    = d;
            resetgame = g;

            graphics = a;

            unitdestroly = e;
            sakkfordel   = f;
            //Add Players
            players.Add(b); players.Add(c);

            //Readin Files
            figures = GetFiguresIMG();

            //Setup Table
            units = SetUpTable();
            Show();
        }
Ejemplo n.º 10
0
 private void Awake()
 {
     instance = this;
 }
Ejemplo n.º 11
0
 private void btnResetGame_Click(object sender, RoutedEventArgs e)
 {
     ResetGame?.Invoke(this, EventArgs.Empty);
 }
Ejemplo n.º 12
0
 void Start()
 {
     res = gm.GetComponent <ResetGame>();
 }
Ejemplo n.º 13
0
 /// <summary>
 ///		lanza el evento de reset
 /// </summary>
 internal void RaiseEventReset()
 {
     ResetGame?.Invoke(this, EventArgs.Empty);
 }
Ejemplo n.º 14
0
 private void button1_Click(object sender, EventArgs e)
 {
     ResetGame?.Invoke();
 }
Ejemplo n.º 15
0
 private void onGameRestart(ResetGame info)
 {
     //Destroy itself. Reloading the scene should then recreate it with initial values.
     Destroy(gameObject);
 }
Ejemplo n.º 16
0
 /// <summary>
 ///		lanza el evento de reset
 /// </summary>
 private void RaiseEventReset()
 {
     ResetGame?.Invoke(this, EventArgs.Empty);
 }
Ejemplo n.º 17
0
 protected virtual void OnResetGame()
 {
     ResetGame?.Invoke();
 }
Ejemplo n.º 18
0
 private void OnDisable()
 {
     ResetGame.UnregisterListener(onGameRestart);
     BlockDespawn.UnregisterListener(OnBlockDespawn);
     SceneManager.sceneLoaded -= onSceneLoaded;
 }