// Use this for initialization
    void Start()
    {
        thisTransform = transform;
        gun = thisTransform.FindChild( "Gun");
        grenades = thisTransform.FindChild( "Grenades");
        attackUser = GetComponent<AttackUser>();

        // Se inicializa el LineRenderer.
        sightLineShot = gun.gameObject.AddComponent<LineRenderer>();
        sightLineShot.material = new Material(Shader.Find("Particles/Additive"));
        sightLineBomb = grenades.gameObject.AddComponent<LineRenderer>();
        sightLineBomb.material = new Material(Shader.Find("Particles/Additive"));

        // Se inicializa el LineRenderer para los disparos
        Color startColor = Color.red;
        Color endColor = Color.yellow;
        startColor.a = 1;
        endColor.a = 0;
        sightLineShot.SetColors(startColor, endColor);
        sightLineShot.SetWidth(0.2f, 0.2f);

        // Se inicializa el LineRenderer para las bombas
        startColor = Color.yellow;
        endColor = Color.white;
        startColor.a = 1;
        endColor.a = 0;
        sightLineBomb.SetColors(startColor, endColor);
        sightLineBomb.SetWidth(0.1f, 0.1f);

        bSimulateBomb = false;
        bSimulateShot = false;
    }
    // Use this for initialization
    void Start()
    {
        stage = GameObject.Find( "Floor").GetComponent<Stage>();
        GameObject objUser = GameObject.Find( "User");
        statusUser = objUser.GetComponent<StatusUser>();
        motionUser = objUser.GetComponent<MotionUser>();
        attackUser = objUser.GetComponent<AttackUser>();
        motionCamera = Camera.mainCamera.GetComponent<MotionCamera>();

        // Se calcula la relación entre la resolución virtual de referencia y la resolución actual de pantalla
        fRatioX = Screen.width * 1.0f / iWidthScreen;
        fRatioY = Screen.height * 1.0f / iHeightScreen;

        // Se crea la barra de energía y se inicializan los parámetros relacionados.
        barUserEnergy = UIStateSprite.create( "Energy.png", 0, 0);
        barUserEnergy.hidden = false;
        barGunEnergy = UIStateSprite.create( "Level.png", 0, 0);
        barGunEnergy.hidden = false;
        textKilled = new UIText( "prototype", "prototype.png");
        textEnemies = new UIText( "prototype", "prototype.png");
        textRecord = new UIText( "prototype", "prototype.png");
        textEnemiesInstance = textEnemies.addTextInstance( "Enemigos: 0", iXTextEnemies * fRatioX, iYTextEnemies * fRatioY, 0.8f, 1, Color.green);
        textKilledInstance = textKilled.addTextInstance( "Asesinatos: 0", iXTextKilled * fRatioX, iYTextKilled * fRatioY, 0.8f, 1, Color.red);
        textRecordInstance = textRecord.addTextInstance( "Record: " + PlayerPrefs.GetInt( "Record", 0),
                                                         iXTextRecord * fRatioX, iYTextRecord * fRatioY, 0.8f, 1, Color.black);
        buttonPersp = UIButton.create( "emptyUp.png", "emptyDown.png", 0, 0);
        buttonPersp.hidden = false;
        textPersp = new UIText( "prototype", "prototype.png");
        textPerspInstance = textPersp.addTextInstance( motionCamera.strCameraPersp, iXTextPersp * fRatioX, iYTextPersp * fRatioY, 0.9f, 1, Color.blue);
    }