unity5

Open Youtube and Tumblr link in app rather than browser - Unity

倖福魔咒の 提交于 2019-12-24 18:03:21
问题 I've managed to make it so when clicking specific buttons it loads up Facebook, Twitter and Instagram using fb://------ , twitter://---- and instagram://----- , but I can't seem to find one for YouTube or Tumblr. Is there any way to do this? Edit: This is my current code. (Sorry for the slow reply) // Set buttontype in editor depending on which button it is // 0 = facebook, 1 = instagram, 2 = tumblr, 3 = twitter, 4 = youtube public int buttonType; // Web urls - use this for computers or if

Open Youtube and Tumblr link in app rather than browser - Unity

这一生的挚爱 提交于 2019-12-24 18:01:47
问题 I've managed to make it so when clicking specific buttons it loads up Facebook, Twitter and Instagram using fb://------ , twitter://---- and instagram://----- , but I can't seem to find one for YouTube or Tumblr. Is there any way to do this? Edit: This is my current code. (Sorry for the slow reply) // Set buttontype in editor depending on which button it is // 0 = facebook, 1 = instagram, 2 = tumblr, 3 = twitter, 4 = youtube public int buttonType; // Web urls - use this for computers or if

activeSelf return true and gameobject is false

我的未来我决定 提交于 2019-12-24 11:15:45
问题 So i have gameobject called menuView . I created script that toogleGameobject and it is simple - check if it is selfActive , if it is then set to false and if it false then set it to true. Problem is that for some reason it was not working. Then inside that function i set Debug.Log(selfActive) and in my console it returns that it is true but my gameobject is false. Here is image: I am calling script by button and script need parameter gameObject so I assign it through inspector. public void

Get current frame Texture from VideoPlayer

大兔子大兔子 提交于 2019-12-24 09:35:59
问题 It is stated in this post Using new Unity VideoPlayer and VideoClip API to play video that one can "retrieve texture for each frame if needed" What's the proper way to get the current frame as a Texture2D, please? EDIT: After the answer I did this but it's not working: using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Video; public class AverageColorFromTexture : MonoBehaviour { public VideoClip videoToPlay; public Light lSource; private Color

GetComponent not recognising component in Unity JavaScript code

戏子无情 提交于 2019-12-24 08:00:54
问题 I have a code block that starts a timer, enables a script, instantiates, then disables that script (this makes my game mechanic work out). The only issue I'm facing now is my Javascript code isn't recognising a component (triggered) error reads script as undeclared from the public variable (which has been added, and which holds the script). I followed the example that Unity had, and that didn't seem to work out. Any help is appreciated. Here is my code: #pragma strict var enemy : Transform;

Standalone Player command line argument “-adapter” syntax

跟風遠走 提交于 2019-12-24 05:47:29
问题 I need to select the monitor my game is displayed on from the command line for dual monitor systems. If I use the Unity Screen Selector Dialog it gives me the choice of which monitor I want to display the game on when starting the game, and it works fine. When I try loading the game from the command line with the command line argument: "MyGame -adapter 1" or "MyGame -adapter 2" it seems to ignore the argument, and just loads the game on the same monitor every time. Notes: I have a dual

Unity3d script losing AudioClip reference when using AddComponent()

十年热恋 提交于 2019-12-24 00:37:30
问题 I have script (#2) below with a public AudioClip variable. When I 'addComponent', it loses that reference. I've tested manually adding it to an object in the editor, and in that case it works OK. Why does my script added during runtime lose the reference? GameObject 1: has this script (#1) attached void HitByRay() { clock = GameObject.FindGameObjectWithTag("Clock_Arrow").GetComponent<Clock>(); clock.gameObject.AddComponent<Tick_Audio_Script>(); } Which attaches the following script (#2) to

Setting up SourceTree to merge unity3d scenes with UnityYAMLMerge

大憨熊 提交于 2019-12-23 20:34:14
问题 SO I followed the instructions from here and tried to set up a merge for scenes in unity. The instructions about SourceTree are right at the bottom. I added the merge tool provided by unity as a custom merge tool, but when I try to merge a branch that changed the scene into my branch I get a conflict and the merge fails. I'm a total noob at this thing and don't know what to do now. Is it possible to make it automatic or I have to write some stuff in the terminal and if I do what should I

Print message in Unity console when a GameObject hits a trigger? Unity5/2D

烂漫一生 提交于 2019-12-23 17:27:39
问题 I'm working on a "Game" for school, and I need to tally votes. I'm using unity to have characters jump on buttons to count the votes and move on to the next question. This is what I have so far: using UnityEngine; using System.Collections; public class Vote1 : MonoBehaviour { private int vote1; public GameObject hero_1; void Start () { vote1 = 0; } void Update () { } void OnCollisionEnter2D(Collision2D coll) { if (coll.gameObject.tag == "PlayerObject"){ vote1 = vote1 + 1; print("One Vote

How can i parse only the numbers from the string?

霸气de小男生 提交于 2019-12-23 06:13:46
问题 I want that in Rect.rectangles under the transform property instead to have the string "matrix(0.87142591,0.49052715,-0.49052715,0.87142591,0,0)" to have 2 properties like transform and transform1 and each one will have a number for example: transform "0.12345678" transform1 "1.12345678" private void Parse() { XDocument document = XDocument.Load(@"C:\Users\mysvg\Documents\my.svg"); Rect.rectangles = document.Descendants().Where(x => x.Name.LocalName == "rect").Select(x => new Rect() { style =