void Start() { oscController = OSCController.Instance; scoreText = scoreObject.GetComponent <TextMeshPro>(); scoreText.alpha = 0.0f; scoreText.DOFade(1.0f, 5.0f); pastTime = 0.0f; dispScore = 0; _disposableScore = oscController.OnScoreShowSignal.Subscribe(score => { showScore(score); }); _disposableRank = oscController.OnRankShowSignal.Subscribe(rank => { showRank(rank); }); foreach (Transform child in rankObject.transform) { child.gameObject.SetActive(false); master.transform.DOScale(new Vector3(0f, 0.5f, 0.5f), 0f); shirouto.transform.DOScale(new Vector3(0f, 0.5f, 0.5f), 0f); legend.transform.DOScale(new Vector3(0f, 0.5f, 0.5f), 0f); ace.transform.DOScale(new Vector3(0f, 0.5f, 0.5f), 0f); } }
void Start() { fiteffect1 = (GameObject)Resources.Load("effects/hit5"); fiteffect2 = (GameObject)Resources.Load("effects/hit"); fiteffect3 = (GameObject)Resources.Load("effects/hit1"); fiteffect4 = (GameObject)Resources.Load("effects/hit2"); pastTime = 0; oscController = OSCController.Instance; beforeRotation = Quaternion.Euler(new Vector3(0, 0, 110)); activeRotation = Quaternion.Euler(new Vector3(0, 0, 0)); afterRotation = Quaternion.Euler(new Vector3(0, 0, -110)); showDuration = 300; hitAnimationDuration = 300; transform.rotation = beforeRotation; _disposable = oscController.OnShowSignal.Subscribe(duration => { // print("show start. duration=" + duration); pastTime = 0; resetCoroutine(); activate(duration); }); if (SettingController.isAutoMode) { StartCoroutine(autoMode()); } }
void Start() { isActive = false; oscController = OSCController.Instance; item1.SetActive(false); powerUp.transform.DOScale(new Vector3(0, 1, 1), 0f); audioSource = gameObject.GetComponent <AudioSource>(); audioSource.clip = itemgetSE; itemget = (GameObject)Resources.Load("effects/itemget"); // Cubeプレハブを元に、インスタンスを生成、 _disposable = oscController.OnItemShowSignal.Subscribe(signals => { item1.SetActive(false); resetCoroutine(); activate(signals); }); }
// Start is called before the first frame update void Start() { returnButton = GameObject.Find("ReturnButton"); returnButton.SetActive(false); stateImage = GameObject.Find("StringImage").GetComponent <Image>(); stateImage.sprite = stateStringTexture[0]; oscController = GameObject.Find("OSCManager").GetComponent <OSCController>(); }
// Use this for initialization void Start() { digitalButtons = GetComponent <DigitalButtonManager>(); physicalButtons = GetComponent <PhysicalButtonManager>(); state = "none"; StartCoroutine(WaitToTrigger("Start", 1.0f)); // wait for everything to load osc = GameObject.Find("OSCMain").GetComponent <OSCController>(); }
// Start is called before the first frame update void Start() { MainGameController.setIsFinish(false); nextButton.SetActive(false); priceText.SetActive(false); sentence.SetActive(false); price = MainGameController.getTotalPrice(); Invoke("Appear", 0.40f); Invoke("Delete", 4.10f); oscController = GameObject.Find("OSCManager").GetComponent <OSCController>(); }
// Start is called before the first frame update void Start() { addressInput = GameObject.Find("IPAdressInputField").GetComponent <InputField>(); outGoingInput = GameObject.Find("OutGoingPortInputField").GetComponent <InputField>(); inComingInput = GameObject.Find("InComingPortInputField").GetComponent <InputField>(); debugCanvas = GameObject.Find("DebugCanvas"); //debugCanvas.SetActive(debugMode); osc = GameObject.Find("OSCManager").GetComponent <OSCController>(); GameObject tempG0 = GameObject.Find("IPAdressInputField"); }
void OnEnable() { Pupilometry.DataChanged += OnPupilometryDataChanged; Debug.Assert(videoPlayersWithCallbacksRegistered.Count == 0); OSCController controller = GetComponent <OSCController>(); for (int i = 0; i < controller.videoPlayers.Length; i++) { controller.videoPlayers[i].prepareCompleted += OnVideoPlayerPrepared; controller.videoPlayers[i].sendFrameReadyEvents = true; controller.videoPlayers[i].frameReady += OnVideoPlayerFrameReady; videoPlayersWithCallbacksRegistered.Add(controller.videoPlayers[i]); } }
void Start() { things = new Dictionary <string, GameObject> (); string thingsPath = "Assets/Resources/Things"; //string shaderPath = "Assets/Resources/Shader"; DirectoryInfo dir = new DirectoryInfo(thingsPath); FileInfo[] info = dir.GetFiles("*.prefab"); foreach (FileInfo f in info) { string key = f.Name.Replace(".prefab", string.Empty); GameObject value = Resources.Load("Things/" + key, typeof(GameObject)) as GameObject; if (value != null) { things.Add(key, value); Debug.Log(key, value); } else { Debug.Log("couldnt load object: " + key); } } osc_controller = GameObject.Find("OSCController").GetComponent <OSCController>(); osc_controller.onMsg += (msg) => { //print (msg.Data[1].ToString()); var thing_str = msg.Data [1].ToString(); var pos = new Vector3((float)msg.Data[2], (float)msg.Data[3], (float)msg.Data[4]); var dur = (float)msg.Data[5]; var twist = (float)msg.Data[6]; GameObject thing = things[thing_str]; if (0 < twist) { ApplyShader(thing, "Custom/Twist", twist); } AppendItem(thing, pos, dur); }; }
void Start() { _path = Application.persistentDataPath + "/initial.conf"; Debug.Log (_path); io = new IO (); cont = gameObject.AddComponent<OSCController> (); //pantallaShot.SetActive (false); //Valores iniciales if(File.Exists(_path)) { //Leemos el archivo. los datos estan separados por # string data = io.Read(Application.persistentDataPath + "/initial.conf"); string [] datos = data.Split('#'); Debug.Log("tamaño array: " + datos.Length); IP.text = datos[0]; PORT.text = datos[1]; TAG.text = datos[2]; } }
private void Awake() { if (!created) { DontDestroyOnLoad(this.gameObject); created = true; } if (instance == null) { instance = this; } else if (instance != null) { Debug.LogWarning("More than 1 instance of OSCController is detected, deleting..."); Destroy(gameObject); } ip = LocalIPAddress(); }
private void CommitChanges() { OSCController oscc = GameObject.Find("OSCController").GetComponent <OSCController>(); oscc.ServerIP = serverIP; oscc.Port = int.Parse(portString); oscc.SendToLocalhostToo = sendToLocalhostToo; oscc.Connect(); GameObject.Find("LGeneratorScaler").GetComponent <LGeneratorScaler>().Active = fitToScreen; LTestGenerator lgen = GameObject.Find("LGenerator").GetComponent <LTestGenerator>(); lgen.DynamicsToSize = dynamicsToSize; lgen.ConnectionSpheres = connectionSpheres; lgen.HideCubes = hideCubes; lgen.HideConnections = hideConnections; lgen.HideDynamics = hideDynamics; lgen.Generate(); GameObject.Find("Persistence").GetComponent <Persistence>().Save(); }
void Awake() { oscController = GetComponent <OSCController>(); }
// Use this for initialization void Start() { osc = GameObject.Find("OSCMain").GetComponent <OSCController> (); }
// Start is called before the first frame update void Start() { osc = GetComponent <OSCController>(); }
void Start() { LoadConf.loadFromFile(delegate { if(LoadConf.tag==null){ Application.LoadLevel(configScene); } //Fuerza variables para probar categoriass //LoadConf.tag="co2"; //LoadConf.changeConf(LoadConf.tag); //------// //activa todos los elementos para evitar crasheo for (int i=0; i<screens.Length; i++) { screens[i].SetActive(true); } //genera num aleatorio para generar elemento que se lanza a mural random_element= UnityEngine.Random.Range(1,LoadConf.wall_elements); s_r_e=random_element.ToString(); string sendtowall_text="instruccion_lanza"; string congrats_text="texto_final"; //if(random_element<10) s_r_e="0"+s_r_e; string s_r_e_init="01"; if(LoadConf.tag=="residuos"){ int random_draw=1; //si lanza flor if(random_element==1) random_draw=UnityEngine.Random.Range(1,5); if(random_element==2) random_draw=UnityEngine.Random.Range(1,3); if(random_element==3) random_draw=UnityEngine.Random.Range(1,8); s_r_e+="_"+random_draw.ToString(); sendtowall_text+="_"+random_element.ToString(); congrats_text+="_"+random_element.ToString(); s_r_e_init+="_1"; } /* Abre Sprites*/ //inicio de app GameObject.Find("title/TouchButton/Title_text").GetComponent<Text>().color=LoadConf.color; GameObject.Find("title/TouchButton/TouchImage").GetComponent<Image>().sprite=Resources.Load<Sprite>(LoadConf.tag+"/boton_standby_off"); GameObject.Find("title/TouchButton/avatar").GetComponent<Image>().sprite=Resources.Load<Sprite>(LoadConf.tag+"/avatar/"+s_r_e_init); //seccion de preguntas GameObject.Find("pregunta").GetComponent<Text>().color=LoadConf.color; //seccion commitment GameObject.Find("commitment/Button/avatar").GetComponent<Image>().sprite=Resources.Load<Sprite>(LoadConf.tag+"/avatar/"+s_r_e); //GameObject.Find("commitment/Button/text").GetComponent<Image>().sprite=Resources.Load<Sprite>(LoadConf.tag+"/compromiso_1_off"); GameObject.Find("commitment/Button/frame").GetComponent<Image>().sprite=Resources.Load<Sprite>(LoadConf.tag+"/fondo_objetomural"); //sendtowall GameObject.Find("sendtowall/Button/avatar").GetComponent<Image>().sprite=Resources.Load<Sprite>(LoadConf.tag+"/avatar/"+s_r_e); GameObject.Find("sendtowall/Button/frame").GetComponent<Image>().sprite=Resources.Load<Sprite>(LoadConf.tag+"/fondo_objetomural"); GameObject.Find("sendtowall/Button/row").GetComponent<Image>().sprite=Resources.Load<Sprite>(LoadConf.tag+"/flecha_lanza"); GameObject.Find("sendtowall/Button/inst").GetComponent<Image>().sprite=Resources.Load<Sprite>(LoadConf.tag+"/"+sendtowall_text); //ending GameObject.Find("ending/Button/congrats").GetComponent<Text>().color=LoadConf.color; GameObject.Find("ending/Button/ecoimg").GetComponent<Image>().sprite=Resources.Load<Sprite>(LoadConf.tag+"/imagen_ultima_pant"); GameObject.Find("ending/Button/final_text").GetComponent<Image>().sprite=Resources.Load<Sprite>(LoadConf.tag+"/"+congrats_text); /*Termina de abrir Sprites */ select_category = LoadConf.tag; Debug.Log(LoadConf.long_tag); osc = gameObject.AddComponent<OSCController>(); osc.INIT("vvvv", LoadConf.ip, int.Parse(LoadConf.port),LoadConf.long_tag); questions = DecodeQuestions.LoadQuestions (select_category); questions_size = questions.Count; //para mandar sin el 01 02 etc la variable s_r_e=random_element.ToString(); nextQuestion (); }); }