Search Unity

Bluescreen on phone

Discussion in 'Editor & General Support' started by sonys222, Sep 7, 2015.

  1. sonys222

    sonys222

    Joined:
    Jun 3, 2015
    Posts:
    32
    Hey guys. I want to create game on Android and when I put this script to the Main camera and start a game I can play, maybe a 10-15 seconds. After this time, displays a bluescreen.

    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4. using System.Collections.Generic;
    5. public class DestroyObjectesNormal : MonoBehaviour
    6. {
    7.    
    8.    public static int myScoreNormal = 10;
    9.    public static int myScoreKubekNormal = 5;
    10.    
    11.    public static int HighscoresNormal=0;
    12.    
    13.    public static bool isDeadNormal=false;
    14.    
    15.    
    16.    public AudioClip shootSound;
    17.    public AudioSource source;  
    18.    
    19.    public float volLowRange = .5f;
    20.    public float volHighRange = 1.0f;        
    21.    
    22.    
    23.    public void awake()
    24.    {
    25.      source = GetComponent<AudioSource>();
    26.    }    
    27.    
    28.    
    29.    /*void OnMouseDown()
    30.    {
    31.      isDead = true;
    32.      Destroy (this.gameObject);
    33.      Scoring ();
    34.    }*/
    35.    
    36.    void Update() {
    37.      
    38.      RaycastHit hit;
    39.      
    40.      
    41.      for (var i = 0; i < Input.touchCount; ++i) {
    42.        Ray ray = Camera.main.ScreenPointToRay (Input.GetTouch (i).position);
    43.        if (Input.GetTouch (i).phase == TouchPhase.Began)
    44.          
    45.        if (Physics.Raycast (ray, out hit) && GameObject.FindGameObjectWithTag ("RollerBallNormal")) {
    46.          Destroy (hit.transform.gameObject);
    47.          ScoringHard();
    48.          isDeadNormal = true;
    49.          
    50.        }
    51.        if (Physics.Raycast (ray, out hit) && GameObject.FindGameObjectWithTag("KubekNormal")) {
    52.          Destroy (hit.transform.gameObject);
    53.          ScoringKubekHard();
    54.          isDeadNormal = true;
    55.          
    56.        }
    57.      }
    58.      
    59.      //if (Input.GetButtonDown ("Fire1")) {
    60.      float vol = Random.Range (volLowRange, volHighRange);
    61.      
    62.      if (isDeadNormal == true) {
    63.        //Scoring();
    64.        
    65.        source.PlayOneShot (shootSound);        
    66.        isDeadNormal = false;    
    67.      }
    68.    }
    69.    
    70.    public void ScoringHard() {
    71.      ScoreManagerNormal.scoreNormal += myScoreNormal;    
    72.    }
    73.    public void ScoringKubekHard () {
    74.      ScoreManagerNormal.scoreNormal += myScoreNormal;    
    75.    }
    76. }
     
  2. Graham-Dunnett

    Graham-Dunnett

    Administrator

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    Your Awake function has a lower-case a, which I think means this function will not execute. (But this might be totally different.)