Inheritance: MonoBehaviour
Example #1
0
 // Start is called before the first frame update
 void Start()
 {
     rb       = GetComponent <Rigidbody2D>();
     animator = GetComponent <Animator>();
     GameOverText.SetActive(false);
     RestartButton.SetActive(false);
 }
Example #2
0
 private void Start()
 {
     playButton    = new PlayButton(playBtnObj);
     restartButton = new RestartButton(restartBtnObj);
     restartButton.SetActive(Button.ButtonActive.Disabled);
     Time.timeScale = 0;
 }
Example #3
0
    // Use this for initialization
    void Start()
    {
        GameOverText.SetActive(false);
        RestartButton.SetActive(false);

        rig = GetComponent <Rigidbody2D>();
    }
Example #4
0
        /// <summary>
        ///     Jukebox controls
        /// </summary>
        private void HandleJukeboxInput()
        {
            if (DialogManager.Dialogs.Count != 0)
            {
                return;
            }

            if (KeyboardManager.IsUniqueKeyPress(Keys.Z))
            {
                PreviousButton.FireButtonClickEvent();
            }

            if (KeyboardManager.IsUniqueKeyPress(Keys.X))
            {
                RestartButton.FireButtonClickEvent();
                NotificationManager.Show(NotificationLevel.Info, "Restarted track");
            }

            if (KeyboardManager.IsUniqueKeyPress(Keys.C))
            {
                var isPaused = AudioEngine.Track.IsPaused;
                PauseResumeButton.FireButtonClickEvent();
                NotificationManager.Show(NotificationLevel.Info, isPaused ? "Resumed track" : "Paused track");
            }

            if (KeyboardManager.IsUniqueKeyPress(Keys.V))
            {
                NextButton.FireButtonClickEvent();
            }
        }
Example #5
0
    void Update()
    {
        ScoreLeft.text  = "" + scoreLeft;
        ScoreRight.text = "" + scoreRight;

        //ScoreLeft.text = ""+ scoreLeft; //ScoreLeft Metnini güncel skor ile güncelle
        //ScoreRight.text = "" + scoreRight; //ScoreRight Metnini güncel skor ile güncelle
        if (scoreLeft == 10 || scoreRight == 10)
        {
            Time.timeScale = 0f;
            RestartButton.SetActive(true);
            ExitButton.SetActive(true);
            DeveloperText.SetActive(true);
            LoserText.SetActive(true);
            if (scoreRight == 10)
            {
                loserText.text = "Loser: Left Side";
            }
            else if (scoreLeft == 10)
            {
                loserText.text = "Loser: Right Side";
            }
        }

        if (Input.GetKeyDown(KeyCode.Escape))
        {
            Time.timeScale = 0f; //Oyun duraklatıldı
            ResumeButton.SetActive(true);
            ExitButton.SetActive(true);
            RestartButton.SetActive(true);
        }
    }
Example #6
0
 public void OnClickResumeButton()
 {
     Time.timeScale = 1f; //Oyun devam ediyor
     ResumeButton.SetActive(false);
     RestartButton.SetActive(false);
     ExitButton.SetActive(false);
 }
Example #7
0
 public void SetStatus(ActionState state)
 {
     CurrentActionState = state;
     if (state == ActionState.GameOver)
     {
         RestartButton.Show();
     }
 }
Example #8
0
 // Use this for initialization
 void Start()
 {
     RestartButton.SetActive(false);
     PauseButton.SetActive(false);
     NextLevelButton.onClick.AddListener(startNextLevel);
     hide(nextLevelImage);
     Input.multiTouchEnabled = true;
 }
Example #9
0
 protected override void MouseCore(MouseHandlerParams _params)
 {
     RestartButton.Mouse(_params);
     LevelSelectButton.Mouse(_params);
     MainMenuButton.Mouse(_params);
     ExitButton?.Mouse(_params);
     BackButton.Mouse(_params);
 }
Example #10
0
 public void GameOver()
 {
     ChangeState("You Loose!");
     StopGame();
     RestartButton.SetActive(true);
     MenuButton.SetActive(true);
     LevelManager.LevelWon = false;
 }
Example #11
0
 protected override void TouchCore(ref TouchHandlerParams _params)
 {
     RestartButton.Touch(ref _params);
     LevelSelectButton.Touch(ref _params);
     MainMenuButton.Touch(ref _params);
     ExitButton?.Touch(ref _params);
     BackButton.Touch(ref _params);
 }
Example #12
0
 void OnCollisionEnter2D(Collision2D col)
 {
     if (col.gameObject.tag.Equals("enemy"))
     {
         GameOverText.SetActive(true);
         RestartButton.SetActive(true);
         Destroy(this.gameObject);
     }
 }
Example #13
0
 private void OnCollisionEnter2D(Collision2D collision)
 {
     if (collision.gameObject.tag.Equals("enemy"))
     {
         GameOverText.SetActive(true);
         RestartButton.SetActive(true);
         gameObject.SetActive(false);
     }
 }
Example #14
0
 void CpuLose()
 {
     main.text = "You have defeated me ! I will get you next time... ";
     NextButton.SetActive(false);
     CorrectButton.SetActive(false);
     RestartButton.SetActive(true);
     HigherButton.SetActive(false);
     LowerButton.SetActive(false);
 }
Example #15
0
 public void is_Correct()
 {
     win       = true;
     main.text = "I Guess the Number is : " + guess;
     HigherButton.SetActive(false);
     LowerButton.SetActive(false);
     CorrectButton.SetActive(false);
     RestartButton.SetActive(true);
 }
Example #16
0
 // Use this for initialization
 void Start()
 {
     NodeGenerationScript = NodeGeneratorObject.GetComponent<NodeGeneration>();
     RangeCircleScript = RangeCircleObject.GetComponent<RangeCircle>();
     PlayerScript = PlayerObject.GetComponent<Player>();
     ScoreCounterScript = ScoreCounterObject.GetComponent<ScoreCounter>();
     RestartButtonScript = RestartButtonObject.GetComponent<RestartButton>();
     NeuronLineScript = NeuronLineObject.GetComponent<NeuronLine>();
 }
Example #17
0
        public CrashDialog(Exception ex)
        {
            InitializeComponent();

            RestartButton.Focus(FocusState.Programmatic);
            MoreInfo.Text = ex.Message;

            ProgressRing.Visibility = Visibility.Collapsed;
        }
Example #18
0
 public void reStart()
 {
     GameObject[] Enemy = GameObject.FindGameObjectsWithTag("Enemy");
     for (int i = 0; i < Enemy.Length; i++)
     {
         Destroy(Enemy[i]);
     }
     GameOverImage.SetActive(false);
     RestartButton.SetActive(false);
 }
Example #19
0
 void Welcome()
 {
     main.text = "Pick a Number! Lowest Number is : " + min + " Highest Number is : " + max;
     NextButton.SetActive(true);
     CorrectButton.SetActive(false);
     RestartButton.SetActive(false);
     HigherButton.SetActive(false);
     LowerButton.SetActive(false);
     attempts = 5;
 }
Example #20
0
 // Start is called before the first frame update
 void Start()
 {
     //giving player full lives at start of the game
     health = 3;
     heart1.SetActive(true);
     heart2.SetActive(true);
     heart3.SetActive(true);
     gameOver.SetActive(false);
     playerWin.SetActive(false);
     RestartButton.SetActive(false);
 }
Example #21
0
 void Awake()
 {
     //menuAudio = GetComponent<AudioSource>();
     restartTimer  = menuTimer;
     status_text   = StatusText.GetComponent <Text>();
     pauseLoader   = PauseButton.GetComponent <Transform>().FindChild("pause_Loader").GetComponent <Image>();
     playLoader    = PlayButton.GetComponent <Transform>().FindChild("play_Loader").GetComponent <Image>();
     restartLoader = RestartButton.GetComponent <Transform>().FindChild("restart_Loader").GetComponent <Image>();
     homeLoaderPM  = HomeButtonPM.GetComponent <Transform>().FindChild("home_Loader").GetComponent <Image>();
     homeLoaderGO  = HomeButtonGO.GetComponent <Transform>().FindChild("home_Loader").GetComponent <Image>();
 }
Example #22
0
 void Start()
 {
     Assert.IsNotNull(landButton);
     Assert.IsNotNull(restartButton);
     Assert.IsNotNull(leaveButton);
     sLeaveButton   = leaveButton.GetComponent <LeaveButton>();
     sRestartButton = restartButton.GetComponent <RestartButton>();
     sLandButton    = landButton.GetComponent <LandButton>();
     mainMenuOn     = false;
     showAllMainMenuElements(false);
 }
    void Start()
    {
        helicopter = GameObject.FindWithTag("Player");

        RestartButton.SetActive(false);
        StoreButton.SetActive(false);
        AdButton.SetActive(false);

        text       = GetComponent <Text>();
        text.color = new Color(0, 0, 0, 0);
    }
 public void SetDisable()
 {
     helicopter = GameObject.FindWithTag("Player");
     if (helicopter != null)
     {
         RestartButton.SetActive(false);
         StoreButton.SetActive(false);
         AdButton.SetActive(false);
         text.color = new Color(0, 0, 0, 0);
     }
 }
Example #25
0
 public void UpdateGuess()
 {
     if (attempts != 0)
     {
         main.text = "Is it ? " + guess + " Or click higher or lower ?";
         NextButton.SetActive(false);
         RestartButton.SetActive(false);
         CorrectButton.SetActive(true);
         HigherButton.SetActive(true);
         LowerButton.SetActive(true);
     }
 }
Example #26
0
 public void gameEnd()
 {
     StartButton.SetActive(false);
     RestartButton.SetActive(true);
     QuitButton.SetActive(true);
     gameActiveState = false;
     PauseButton.SetActive(false);
     if (((int)(GameObject.FindWithTag("Player").transform.position.z - 18) / 10) >= boundaryScore)
     {
         show(nextLevelImage);
     }
 }
Example #27
0
 private void RestartButton_Click_1(object sender, EventArgs e)
 {
     resetSeenJokes();
     RestartButton.Hide();
     JokeResult.Show();
     Notification.Text = "";
     JokeResult.Text   = "Prepare for LULZ.";
     JokeButton.Show();
     Like.Show();
     Dislike.Show();
     Settings.Default.CurrentJoke = 0;
     Settings.Default.Save();
 }
Example #28
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
     CanvasState.SetActive(false);
     RestartButton.SetActive(false);
     MenuButton.SetActive(false);
 }
Example #29
0
    // Update is called once per frame
    void Update()
    {
        if (health > 4)
        {
            health = 3;
        }

        //what to do when each life is lost
        switch (health)
        {
        //special case when player wins
        case 4:
            PauseButton.SetActive(false);
            playerWin.SetActive(true);
            RestartButton.SetActive(true);
            Time.timeScale = 0;
            break;

        case 3:
            heart1.SetActive(true);
            heart2.SetActive(true);
            heart3.SetActive(true);
            break;

        case 2:
            heart1.SetActive(true);
            heart2.SetActive(true);
            heart3.SetActive(false);
            break;

        case 1:
            heart1.SetActive(true);
            heart2.SetActive(false);
            heart3.SetActive(false);
            break;

        //game over
        case 0:
            heart1.SetActive(false);
            heart2.SetActive(false);
            heart3.SetActive(false);
            PauseButton.SetActive(false);
            gameOver.SetActive(true);
            RestartButton.SetActive(true);
            Time.timeScale = 0;
            break;
        }
    }
Example #30
0
    /*
     *
     *
     *
     */

    private void OnTriggerEnter2D(Collider2D collision)
    {
        Debug.Log("Death");
        RestartButton.Show();

        //GetComponentInChildren<ParticleSystem>().Play();
        death_particle.Play();

        StopToEnemy();
        StopToPlayer();

        //Time.timeScale = 0f;

        GetComponent <AudioSource>().Play();
        GameObject.Find("BGM").GetComponent <AudioSource>().Stop();
    }
Example #31
0
    /// <summary>
    /// Destroys a life.
    /// </summary>
    public void DestroyTheLife()
    {
        if (Controller.GameActive)
        {
            StartCoroutine(UpdateTheHealthUi(Controller.Lifes));
            Controller.Lifes--;
            if (Controller.Lifes <= 0)
            {
                GameObject.Find("Canvas/EndUi").GetComponent <Animator>().Play("EndUi");
                RestartButton.EnableTheButton();
                SetBest();

                Controller.GameActive = false;
            }
        }
    }
 void ShareButtonCallback()
 {
     if (!introDone)
         return;
     pressedButton = RestartButton.share;
     Outro();
 }
 void RestartButtonCallback()
 {
     if (!introDone)
         return;
     //Debug.Log("restart pressed");
     pressedButton = RestartButton.restart;
     Outro();
 }
 void VideoButtonCallback()
 {
     if (!introDone)
         return;
     pressedButton = RestartButton.video;
     Outro();
 }