Professional Documents
Culture Documents
Ejercicio1 Monobehaviour: Using Using Public Class Int Int Bool Void If True
Ejercicio1 Monobehaviour: Using Using Public Class Int Int Bool Void If True
using System.Collections;
public class Ejercicio1 : MonoBehaviour {
int health = 30;
int powerUps = 2;
bool isPowerUpActive;
// Use this for initialization
void Start () {
if (health <= 30 && powerUps > 0){
powerUps--;
isPowerUpActive = true;
}
Debug.Log("PowerUpActive " + isPowerUpActive + " PowerUps " + powerUps);
}
using UnityEngine;
using System.Collections;
public class Ejercicio2 : MonoBehaviour {
int life = 10;
int coins = 0;
// Use this for initialization
void Start () {
for (int i = 0; i < 10; i++) {
coins++;
}
using UnityEngine;
using System.Collections;
public class Ejercicio3 : MonoBehaviour {
int a = 2;
int b = 9;
// Use this for initialization
void Start () {
while(a % b != 0 ) {
Debug.Log("a no es divisible entre b");
a++;
}
}