Menú

Mostrar Mensajes

Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.

Mostrar Mensajes Menú

Mensajes - sab

#16
Saludos a todos llevo rato tratando de pasar el valor de una variable de un script a otro (los 2 están en el mismo gameObject -Main Camara-), lo que trato de hacer es asignarle el valor int de "puntuacion" a otra variable int "score", pero no lo logro; using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;public class Timer : MonoBehaviour{
    private int score;
    void Update()
    {
        Puntuacion variable = GetComponent<Puntuacion>();
        score = variable.puntuacion;
 Alguien me puede ayudar en decirme que estoy haciendo mal??? Gracias a todos y saludos!!!!!!!!
#17
General (Antiguo) / Eliminar GameObjects Clones
Marzo 05, 2016, 10:32:55 PM
Muchas Gracias, http://unityspain.com/profile/27312-centauro5legs/?do=hovercard&referrer=http%253A%252F%252Funityspain.com%252Ftopic%252F35301-eliminar-gameobjects-clones%252F" title="Go to Centauro5legs's profile" id="ips_uid_4" style="box-sizing: border-box; color: inherit; text-decoration: none; background-color: transparent;" href="<___base_url___>/profile/27312-centauro5legs/">Centauro5legs, me funcionó de maravilla, no entiendo como no pude solucionar eso antes tan facil que parece, jajajaja... ha claro es por que apenas y entiendo lo que es programar, jajajajaja!!!!!!!
#18
General (Antiguo) / Eliminar GameObjects Clones
Marzo 03, 2016, 05:39:15 AM
Saludos a todos, tengo una pregunta, estoy tratando de eliminar una serie de "gameobject(clone)", al terminar el juego pero no encuentro la manera de hacerlo, ademas me gustaria saber como generarlos dentro de un "gameobject padre", el problema es que los objetos son generados en diferentes lugares "al azar", por lo que no los pude colocar con el transform del objeto padre.
 
 
 

using UnityEngine;
using System.Collections;
public class BubbleController : MonoBehaviour {
    private int type;
    private Vector3 velocity;
    void Start() 
    {
        Vector3 randomPosition = new Vector3(Random.Range(-8f, 8f),-6,);
        Vector3 randomScale = Vector3.one * Random.Range(0.5f, 2f);
        transform.localScale = randomScale;
        transform.position = randomPosition;
        velocity.x = Random.Range (-3, 3);
        velocity.y = Random.Range (0.5f, 4);
        velocity.z = ;
        PonerTipoDeBurbuja();
    }
    public void PonerTipoDeBurbuja ()
    {
        float probability = Random.Range (0f, 1f);
        if (probability >= && probability < 0.65f) 
        {
            type = ;
            GetComponent<SpriteRenderer> ().color = Color.white;
        }
        else if (probability >= 0.65f && probability < 0.9f) 
        {
            type = 1;
            GetComponent<SpriteRenderer> ().color = Color.green;
        }
        else if (probability >= 0.9f) 
        {
            type = 2;
            GetComponent<SpriteRenderer> ().color = Color.magenta;
        }
    }
    void Update () 
    {
        transform.Translate (velocity * Time.deltaTime);
    }
    void OnMouseOver()
    {
        GameObject soundController = GameObject.Find("SoundController");
        soundController.SendMessage("PlayBurbujaSound");
        SumarPuntos (type);
        Destroy (gameObject);
    }
    public void SumarPuntos (int type)
    {
        GameObject scoreController = GameObject.Find("ScoreController");
        switch (type) 
        {
        case :
                // Sumar 1 punto
                scoreController.SendMessage("AgregarPuntos", 1);
            break;
        case 1:
                // Sumar 3 puntos
                scoreController.SendMessage("AgregarPuntos", 3);
                break;
        case 2:
                // Sumar 5 puntos
                scoreController.SendMessage("AgregarPuntos", 5);
                break;
        default:
            break;
        }
    }
}

 
 
#19
gracias iRobb!!!! al menos entonces sé el problema no es este, pero igual y conoces la solución de esto:
 
Cuando pruebo el juego en mi teléfono NO me funcionan los botones de ranking, de google play, ni me muestra un anuncio intersticial (pero en la consola si aparecen) y si me muestra los banners; y en la pc me da los siguientes warning:
 
 



   
       *** [Play Games Plugin DLL] 10/15/15 23:00:11 -06:00 ERROR: ReportScore can only be called after authentication.
      UnityEngine.Debug:LogWarning(Object)
      GooglePlayGames.OurUtils.Logger:e(String) (at Assets/GooglePlayGames/OurUtils/Logger.cs:74)
      GooglePlayGames.PlayGamesPlatform:ReportScore(Int64, String, Action`1) (at Assets/GooglePlayGames/ISocialPlatform/PlayGamesPlatform.cs:716)
      UnityEngine.Social:ReportScore(Int64, String, Action`1)
      Puntuacion:PersonajeHaMuerto(Notification) (at Assets/Scripts/Puntuacion.cs:37)
      UnityEngine.Component:SendMessage(String, Object, SendMessageOptions)
      NotificationCenter:PostNotification(Notification) (at Assets/Scripts/NotificationCenter.cs:91)
      NotificationCenter:PostNotification(Component, String, Object) (at Assets/Scripts/NotificationCenter.cs:70)
      NotificationCenter:PostNotification(Component, String) (at Assets/Scripts/NotificationCenter.cs:69)
      Destructor:OnTriggerEnter2D(Collider2D) (at Assets/Scripts/Destructor.cs:18)
   

[/quote]
 
 
#20
Alguien ha tenido algún problema con estos warning y sabe su solución????, me aparecen al compilar para android  en el unity 5.2.1
 
No me funcionan algunos botones (los botones de Google Play Games), no me funcionan los intersticiales.
 
Gracias por su ayuda!!!!!!!!!!!!
 



   
       
   
   
      Failed to add the asset file size for sharedassets0.resource
      Unit***itor.HostView:OnGUI()
   
   
      Failed to add the asset file size for sharedassets1.resource
      Unit***itor.HostView:OnGUI()
   
   
       
   

[/quote]
 
 
#21
Muchas gracias!!!! iRobb estas en lo correcto ya solucioné el problema!!!!!
#22
Al tratar de compilar me aparecen estos dos errores estoy usando la ultima version de unity y las ultimas versiones del sdk jdk y los plugins, gracias por su ayuda!!!!!!!
 

CommandInvokationFailure: Unable to convert classes into dex format. See the Console for details.
C:/Program Files/Java/jdk1.8.0_60\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Users/SAB/AppData/Local/Android/sdk\tools" -Dfile.encoding=UTF8 -jar "C:\Program Files\Unity\Editor\Data\PlaybackEngines\androidplayer/Tools\sdktools.jar" -
stderr[
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/games/bridge/BuildConfig;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/games/bridge/NativeBridgeActivity;
2 errors; aborting
]
stdout[
processing archive bin\classes.jar...
processing com/unity3d/player/a$1.class...
processing com/unity3d/player/a$2.class...
...
processing android/support/v4/media/TransportMediatorJellybeanMR2$3.class...