unityscript

save and view snapshot image from android device

走远了吗. 提交于 2019-12-25 17:45:01
问题 I'm having a problem with saving image into an android device this is what i did My java class : package com.test.app; import com.unity3d.player.UnityPlayerActivity; import android.os.Bundle; public class MainActivity extends UnityPlayerActivity { protected void onCreate(Bundle myBundle) { super.onCreate(myBundle); } public string GetPath(){ return Environment.getExternalStorageDirectory().toString(); } } in eclipse i made my project as a jar file from project setting --> set as library , got

Rotate object continuously on button click Unity3D

主宰稳场 提交于 2019-12-25 04:33:56
问题 I have a button and a PlayerObject . When I click the button, the object must rotate continuously, and when I click the same button again, the object must stop rotating. Currently, I am using the code given below. It makes the object only rotate once to a certain angle. using UnityEngine; using System.Collections; public class PlayerController : MonoBehaviour { int a=1; public void CubeRotate () { a++; transform.Rotate (new Vector3 (150, 300, 60) * Time.deltaTime); if (a%2==0) { Debug.Log(a);

How to use variables from UnityScript in Boo?

大城市里の小女人 提交于 2019-12-25 04:06:51
问题 I've been trying to implement this but without any success. While I was googling around I saw that this is somehow possible but I can't reach it by myself obviously. This my file tree: |-Game |--Assets |---Animacije |---Skripte |----*BlokSistem.js |---Standard Assets |----*UI.boo |---Prefabs |---Sprites |---Game.unity I want to use variable from BlokSistem.js in UI.boo, but without any success. I want to change one and print another. Here is my code for now (UI.boo): import UnityEngine import

function OnCollisionEnter() not working unity

折月煮酒 提交于 2019-12-25 03:01:05
问题 I am using unityscript and I have no idea why but the OnCollisionEnter Function never calls, even when logging it in unity3d. Is there an alternative or a reason why this is happening? By the way I am trying to use this collision detection function to find out if the Main Camera is touching a wall or anything.done This is exactly what I have done: I created a unityscript file. I replaced all the contents with just: function OnCollisionEnter(theCollision : Collision) { Debug.Log("Hit"); } Now

accessing user documents folder on unity3d

孤街醉人 提交于 2019-12-25 02:38:06
问题 is it possible to get the path to the current user documents folder on Unity3D using UnityScript? I am trying to access it mainly on desktop systems (Windows, Linux or OSX). On mobile systems, Application.persistentDataPath do the trick for me, but for desktop I would like to use the documents folder where the users can see and change the files easily. 回答1: I don't know if Javascript has a way to get Windows special folders, but C# has Environment.GetFolderPath. So one way of doing this is to

Augmented reality application using unity and vuforia

允我心安 提交于 2019-12-24 19:04:47
问题 Good day everyone, I am currently on the process of creating my first AR application using unity and vuforia sdk. I already know some basics of AR that you need an image target to display the 3d object or information associated with the image target. I have this AR spinning cube this sample app works when it found a valid image target and a 3d cube will display and start to spin. My question is while the phone scans for image target there should be a message saying "Scanning for image target"

How to disable LockTexture when I unlock them?

为君一笑 提交于 2019-12-24 00:53:35
问题 I am building a game consisting of 8 levels. I use the following script to switch next level. But when I unlock a level the Lock Texture still remain in the window. I want to remove the lock texture when i unlock a new level. Please help me out. My code is below: LevelIndex = 0; for ( GridIndexB = 0 ; GridIndexB < LevelsGrid.y ; GridIndexB++ ) { for ( GridIndexA = 0 ; GridIndexA < LevelsGrid.x ; GridIndexA++ ) { LevelIndex++; GUI.DrawTexture(Rect( (Screen.width - LevelsGrid.x * (LevelTexture

Loading a .OBJ into Unity at runtime

有些话、适合烂在心里 提交于 2019-12-22 04:38:17
问题 My job is to write a code which loads a .OBJ into Unity in runtime. Unity has provided a sample code in it's wiki page. I used the following code to use the class given in the link: public class Main : MonoBehaviour { // Use this for initialization void Start () { Mesh holderMesh = new Mesh (); ObjImporter newMesh = new ObjImporter(); holderMesh = newMesh.ImportFile("C:/Users/cvpa2/Desktop/ng/output.obj"); } I'm not getting any errors in Unity Monodevelop, but neither is the model loaded.

How to play news in TV when i switch on, using scripting language in Unity3D? [closed]

时间秒杀一切 提交于 2019-12-20 07:55:25
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 years ago . I am new in unity3D. I need to know how can we play news in TV when i switch on using the scripting languages in Unity3D 回答1: You might be interested in MovieTexture. Movie Textures are animated Textures that are created from a video file. By placing a video file in your project's

Unity3D - How to make a texture changing mute button/toggle?

孤人 提交于 2019-12-20 07:27:25
问题 I'm trying to make a mute button for in my android game menu, so when I press the button, the texture changes from a playing speaker symbol to a muted speaker symbol (which I've already made in Photoshop). So when the audio is playing it will have a 'speaker' symbol, but when I press it, it will change to a 'muted speaker' symbol (a speaker with a cross). Thanks in advance, any help is appreciated! 回答1: first we make a maintexture as the texture that is always used and on awake we put our