• Advertisement
  • Popular Tags

  • Popular Now

  • Advertisement
  • Similar Content

    • By Kristiyan21
      Hello guys,i am writing this topic to get to the opinion of more people.I have just released my first game for android(worked on it for about 5-6 months in my spare time) i used Unity framework and i am planning to make it a big project but i had to release 1.0 version so i am 100% sure i wouldn't quit the project at some time.What i am asking any of you guys is to give me your opinion about the game. What do you like,what you don't , is the ad too irritating?is the GUI okay?any information you might consider usefull for me would be helpful,thanks in advance!
      the game on google play:
      https://play.google.com/store/apps/details?id=com.KindieGames.PlaneDash
    • By Alexia
      Hi all,
      A small team are currently undertaking a fairly large game project involving multi-playing, taming and other complex game mechanisms.
      We are looking for someone who is experienced in programming a wide range of mechanisms, more information is on our discord server. It is also a learning experience and we wouldn't expect you to know how to do everything we wanted, but just ask that you would be willing to learn how to.
      If you are interested in joining the (rather long term project) just message me and i'll add you on discord.
      Thanks for your time,
      Alexia 
    • By ethancodes
      I've got a custom Brick class. I need at least one other type of Brick subclass, maybe more. These classes should do most of what the Brick class does, but have a bit of modified or added behavior. Normally I would assume inheriting from the Brick class would be the best choice for this, but when I tried to do it I was having some issues because of having to make additional instances of variables referencing manager objects. I'm not sure if I was just doing it wrong, or if maybe inheritance isn't the right solution here. Here is the Brick class:
      using System.Collections; using System.Collections.Generic; using UnityEngine; public class Brick : MonoBehaviour { public AudioClip crack; public Sprite[] hitSprites; public static int breakableCount = 0; public GameObject smoke; private LevelManager levelManager; private int timesHit; private bool isBreakable; private float delay = 1.5f; //Delay till bricks move down 1 row. private float timer = 0; // update ever frame and compare to delay. // Use this for initialization void Start () { isBreakable = (this.tag == "Breakable"); //keep track of breakable bricks if (isBreakable){ breakableCount++; } timesHit = 0; levelManager = GameObject.FindObjectOfType<LevelManager>(); } // Update is called once per frame void Update () { timer += Time.deltaTime; if (timer >= delay) { transform.Translate(0.0f, -1.0f,0.0f); timer = 0; } } void OnCollisionEnter2D (Collision2D collision) { if (collision.gameObject.tag == "EndScreen") { levelManager = GameObject.FindObjectOfType<LevelManager>(); levelManager.LoadLevel("Lose"); } AudioSource.PlayClipAtPoint (crack,transform.position); if (isBreakable) { HandleHits (); } } void HandleHits () { timesHit++; int maxHits = hitSprites.Length + 1; if (timesHit >= maxHits) { breakableCount--; levelManager.BrickDestroyed(); PuffSmoke(); Destroy (gameObject); } else { LoadSprites(); } } void LoadSprites () { int spriteIndex = timesHit - 1; if (hitSprites [spriteIndex] != null) { //if statement keeps it from loading nothing if level designer forgets to assign a sprite this.GetComponent<SpriteRenderer> ().sprite = hitSprites [spriteIndex]; } else { Debug.LogError("Brick sprite missing"); } } void PuffSmoke () { var smokePuff = Instantiate(smoke, transform.position, Quaternion.identity); var effect = smokePuff.GetComponent<ParticleSystem>().main; effect.startColor = GetComponent<SpriteRenderer>().color; } } What I need is for a different kind of brick to destroy all other adjacent bricks when the ball hits it. I considered just adding this functionality in to the brick class, and have it activate based on tags, but that didn't seem like the best solution. I'm open to any ideas. Thanks!
    • By davemacdo
      I'm a formally trained composer (doctorate from Michigan State) who writes what most people would call avant-garde concert music. I love weird abstract projects, and I would like to work with somebody making a weird, abstract, artsy game. 
      You can find more about me and my music on my site. I have worked with acoustic and electronic sounds, including some procedurally generated and interactive computer music. 
      In particular, I would like to work on a project that lets me use Fmod to prepare an adaptive score for a game built on Unity or Unreal. I've been a music professor and would like to get experience working in this medium so that I can be a better mentor for my students. Send me a DM or email <davidjohnmacdonald@gmail.com> if you would like to discuss working on a project together. 
    • By Tuner_z

      Name: One Level: Stickman Jailbreak
      Price: Free
      Developer: RTU Studio
      Platform: Android
      Language: C# (Unity3D)
      Google Play: https://play.google.com/store/apps/details?id=com.RTU.OneLevel
       
      Hello!
      I want to show you my game! "One level: Stickman Jailbreak" is a puzzle game with unusual gameplay where you must help the character to escape from prison. You just need to take the key and get out alive. The game has only one level, and there are many ways to complete it. Not everything is as simple as it might seem at first glance, so there are clues in the game.
       
      Short description:
      Nobody escapes from here!
       
      Description:
      Tommy got into trouble again! Our hero is behind bars. But he's not going to stay in jail for a long time and he decides to escape. Tommy steals a key and gets out of the jail cell. But our friend doesn't go free: Tommy suddenly finds himself in the same room from which he just escaped! The conditions for escaping change every time. In order to go free Tommy will have to solve logical puzzles and you can help him in this!
      At first it will be easy, but the tension will increase, and the tasks will become more complicated with each level. You should use your brain for all 100%, but if your skill is not enough, you can use a hint or ask for help from friends!
      You can solve the puzzles alone or with your friends and spend time well!
       
      Features: 
      Features:
      - 48 unique levels;
      - the game is translated into 10 languages: English, French, German, Spanish, Italian, Portuguese, Russian, Japanese, Chinese, Korean;
      - the function of "help from friend";
      - hints;
      - instructions.
       
      Trailer:
       
      Screenshots:





       
  • Advertisement
  • Advertisement

Need a script for Main Menu buttons

Recommended Posts

Advertisement

So, as I've created some games already in Unity, I will describe simple example of how I'd do it in Unity these days (and most likely will do it next time I'll use Unity for something):

Here is a simple example I put together in few minutes: https://otte.cz/random/MainMenu.rar

Short description: What you need is some GameObject in scene which will have script containing public functions that are handlers for buttons. The class holding these must derive from MonoBehaviour, like the one in the archive:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class MainMenuController : MonoBehaviour
{
    // Function called for button, must have 0 or 1 string argument at most, must be public
    public void NewGameHandler()
    {
        // Load another scene with "Game" name, scenes must be added in Build Settings!
        SceneManager.LoadScene("Game");
    }

    // Function called for button, must have 0 or 1 string argument at most, must be public
    public void QuitHandler()
    {
        // Exit the application
        Application.Quit();
    }
}

Now on the buttons, add a On Click record, where you attach (drag & drop, or just click + select) this game object with above-like MonoBehaviour attached. Next, select (from event drop down) the MonoBehaviour class name and under it there will be a function (NewGameHandler, QuitHandler)... note that the drop down has 2 levels, it is easy to miss it.

It is setup in the project in the archive, so feel free to use anything from it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Advertisement