Hot answers tagged

4

Go to the DOTween documentation Scroll down to the Move section. Click on DOJump to expand that explanation. Is that what you're looking for?


3

A UnityEvent, like the Button's OnClick event acts on methods, not on variables. The reason it looks like it's setting variables in the cases you showed is that it's acting on something in C# called a property. That's where you define something like this: int _internalValue; public int exposedValue { get { return _hiddenValue; } set { ...


3

To my knowledge there are no tools, they're completely separate systems. You could reuse the assets and any function calls through the UI etc so it wouldn't be a total redo but you'll have to remake it.


3

I am assuming you are referring to the new GUI system available in the 4.6 beta. If you are already using NGUI on a project I would recommend you just stick with it. While Lyashenko (NGUI creator) did work on UGUI system during his brief stint as a Unity employee the two systems are not identical. Currently there may be a few features NGUI has that may be ...


3

Considering you have a while(true) loop in your code, you're not going to allow the game loop to move to the next frame. You'll need to move to the next frame to update the screen and gather new input. You can use the void Update() method to check for stuff like keyboard input every frame. void Update() { if(Input.GetKeyDown(KeyCode.W) | Input....


2

Unity - not unlike some other game engines - provides as the backbone of its architecture a scene-graph that unifies all aspects of the MVC / MVVM triad. Trying to work around such fundaments of the platform will only cost you more in time than you think you might gain by adapting it to the architectural paradigm you mention... rest assured. Re your ...


2

You can implement your own version of the below. Create a static bool in whatever GUI class you have available to all your scripts. Now, whenever you start a click operation with NGUI, you can set that bool to true. Then simply check to see if the bool is true before doing operations in other scripts. Ideally, if you have access to the NGUI source, this is a ...


1

some special prefabs or gameobjects need a certain parent object. for example any Unity UI object needs to be parented directly or indirectly with canvas object. NGUI is the same and any ui object needs to be parented with object with UIRoot Component with same layer. in new version of ngui its handled but in older versions Unity doesnt know what is the ...


1

In 2018.4 you can edit prefab edit environment in ProjectSettings/Editor


1

Check out UICamera.currentTouch.pos or UICamera.lastTouchPosition in the OnPress method. These will be set, whenever a touch is active, and should provide the necessary information.


1

Found the solution. In the inspector, uncheck Generate Mip Maps and now it will work. I do not know why did Mip Maps affect NGUI however. Either way I've reported this in their support forums.


1

You can achieve this with Maskable UI. See Unity documents for Sprite Masking here or this tutorial here. Also, you can use this paid Unity Asset.


1

I'm not a C# user so the solution is pseudo-code, but it should be relatively trivially translated into actual compiling C# that uses the correct GUI positioning stuff that you need. I just use x and y to denote the position of the current score. Anyways, the important bit here is to keep track of the previous item. string previous = ""; string scores = ...


1

If the MC_StreamingOption doesn't exist at edit time, you can assign the button to another script to hold onto the button on its behalf until it's been spawned and is ready to accept it. // 1) Member variable you can use to store a reference to the button in the Inspector. public UIButton livestreamButton; ... // 2) later, when you spawn the ...


1

It looks the image has Shadow + Outline. For text you should use "NGUI Label" component for gameobject. But there is only 1 effect could be applied to text: Shadow or Outline. I believe you can make new class inherited from UILabel and make Effect field like an array, with multiplied effects. Update: I've found not elegant way how to do it without much pain ...


1

Unity as a built-in Shadow component for UI elements. It's far from perfect but it's a good starting point. Otherwise, you could duplicate the text, attach an outline component to the front text, and change the font color to the background text after moving it a little bit to get your shadow. But I definitively advise you to use TextMeshPro, now free on ...


1

Is the canvas scaler set to Preserve Pixel resolution? I make that mistake sometimes, that's the default and there's a setting for Scale with Screen.


1

Solved a similar issue on Android Unity 5.1.1 by removing and re-importing the actual font file into my project. Also have seen problems when using just the default Arial font face without actually importing my own font asset into the project. Do me a solid and try importing an actual Arial (or any other font for that matter) TTF or OTF into the scene and ...


1

There are two options for you. 1) Keep the image component on the button with a sprite, then set the transparency/alpha on the color to 0. 2) Write a separate script that you attach to a gameobject (Or image/button) that implements the Unity event interface: IPointerClickHandler and inherits from UIBehaviour. IPointerClickHandler is the interface Buttons ...


1

Just set isEnabled of the desired UIButton to false. This will just disable it's collider, and it will still be visible. :-)


1

There are a few values that are crucial to multi-camera rendering in Unity: the culling mask, the clear flags, and the depth value. All three are mentioned in the camera component manual. mainCamera depth is -1, and NGUI Camera depth is 1. Unity draws cameras in ascending order. If you want the NGUI background behind the scene, you should flip those ...


1

As far as I know, Unity sprites supports became available with new NGUI versions (3.x). Previous NGUI was developed before Unity 4.3 with 2D features was available, and old NGUI is not under development for a quite long time. So, you can either move to new NGUI, or go into shaders code and make use of UIPanel alpha values. Maybe you could have a luck and by ...


1

Make sure all NGUI components' layers are the same, like "UI". Attach your UI's NGUI panel with box collider. Add a script "InputManager.cs" and rewrite function GetMouseButton() like: public static bool GetMouseButton(int button) { if (UICamera.hoveredObject == null) { return Input.GetMouseButton(button); } else { // If click/drop ...


Only top voted, non community-wiki answers of a minimum length are eligible