realidad aumentada
C sharp
Publicado el 3 de Diciembre del 2018 por Roxana
2.632 visualizaciones desde el 3 de Diciembre del 2018
realidad aumentada
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Abecedario : MonoBehaviour {
public Text name_text;
public AudioClip[] clips;
private AudioSource player;
private int index=0;
public Animator anim;
bool aux=true;
// Use this for initialization
void Start () {
player = GetComponent<AudioSource>();
player.clip = clips[index];
anim.GetComponent<Animator> ();
}
// Update is called once per frame
void Update()
{
if (player.isPlaying)
{
anim.Play("Zoom");
}
else
{
anim.Play("None");
aux = true;
}
}
public void PrintLetterA () {
if(aux)
{
aux = false;
print("A");
name_text.text = "A";
if (CheckNullSong()) return;
player.Play();
}//end if
}
public void PrintLetterB () {
if (aux) {
print ("B");
name_text.text = "B";
if (CheckNullSong ())
return;
player.Play ();
}
}
public void PrintLetterC(){
if (aux) {
print ("C");
name_text.text = "C";
if (CheckNullSong ())
return;
player.Play ();
}
}
public void PrintLetterD()
{
if (aux) {
print ("D");
name_text.text = "D";
if (CheckNullSong ())
return;
player.Play ();
}
}
public void PrintLetterE()
{
if (aux) {
print ("E");
name_text.text = "E";
if (CheckNullSong ())
return;
player.Play ();
}
}
public void PrintLetterF()
{
if (aux) {
print ("F");
name_text.text = "F";
if (CheckNullSong ())
return;
player.Play ();
}
}
public void PrintLetterG()
{
if (aux) {
print ("G");
name_text.text = "G";
if (CheckNullSong ())
return;
player.Play ();
}
}
public void PrintLetterH()
{
if (aux) {
print ("H");
name_text.text = "H";
if (CheckNullSong ())
return;
player.Play ();
}
}
public void PrintLetterI()
{
if (aux) {
print ("I");
name_text.text = "I";
if (CheckNullSong ())
return;
player.Play ();
}
}
public void PrintLetterJ()
{
if (aux) {
print ("J");
name_text.text = "J";
if (CheckNullSong ())
return;
player.Play ();
}
}
public void PrintLetterK()
{
if (aux) {
print ("K");
name_text.text = "K";
if (CheckNullSong ())
return;
player.Play ();
}
}
public void PrintLetterL()
{
if (aux) {
print ("L");
name_text.text = "L";
if (CheckNullSong ())
return;
player.Play ();
}
}
public void PrintLetterM()
{
if (aux) {
print ("M");
name_text.text = "M";
if (CheckNullSong ())
return;
player.Play ();
}
}
public void PrintLetterN()
{
if (aux) {
print ("N");
name_text.text = "N";
if (CheckNullSong ())
return;
player.Play ();
}
}
public void PrintLetterÑ()
{
if (aux) {
print ("Ñ");
name_text.text = "Ñ";
if (CheckNullSong ())
return;
player.Play ();
}
}
public void PrintLetterO()
{
if (aux) {
print ("O");
name_text.text = "O";
if (CheckNullSong ())
return;
player.Play ();
}
}
public void PrintLetterP()
{
if (aux) {
print ("P");
name_text.text = "P";
if (CheckNullSong ())
return;
player.Play ();
}
}
public void PrintLetterQ()
{
if (aux) {
print ("Q");
name_text.text = "Q";
if (CheckNullSong ())
return;
player.Play ();
}
}
public void PrintLetterR()
{
if (aux) {
print ("R");
name_text.text = "R";
if (CheckNullSong ())
return;
player.Play ();
}
}
public void PrintLetterS()
{
if (aux) {
print ("S");
name_text.text = "S";
if (CheckNullSong ())
return;
player.Play ();
}
}
public void PrintLetterT()
{
if (aux) {
print ("T");
name_text.text = "T";
if (CheckNullSong ())
return;
player.Play ();
}
}
public void PrintLetterU()
{
if (aux) {
print ("U");
name_text.text = "U";
if (CheckNullSong ())
return;
player.Play ();
}
}
public void PrintLetterV()
{
if (aux) {
print ("V");
name_text.text = "V";
if (CheckNullSong ())
return;
player.Play ();
}
}
public void PrintLetterW()
{
if (aux) {
print ("W");
name_text.text = "W";
if (CheckNullSong ())
return;
player.Play ();
}
}
public void PrintLetterX()
{
if (aux) {
print ("X");
name_text.text = "X";
if (CheckNullSong ())
return;
player.Play ();
}
}
public void PrintLetterY()
{
if (aux) {
print ("Y");
name_text.text = "Y";
if (CheckNullSong ())
return;
player.Play ();
}
}
public void PrintLetterZ()
{
if (aux) {
print ("Z");
name_text.text = "Z";
if (CheckNullSong ())
return;
player.Play ();
}
}
bool CheckNullSong()
{
if (player.clip == null)
{
Debug.Log("Null Song");
return true;
}//End If
return false;
}
}
Comentarios sobre la versión: 1.0 (1)
{
}
}