// Start is called before the first frame update void Start() { gameManagerScene = GameObject.Find("GameManager").GetComponent <GameManagerScene>(); isOnGround = true; isOnMoving = false; score = 0; //Anirem guardant els punts del jugador gameOver = false; once = true; // isGrenadeReady = true; switchState = 0; //tenim 5 enemics per tan necessitem 5 espais playerDistance = new float[5]; //guardem la posiciĆ³ dels enemics enemyPos = new Vector3[5]; //posem un offset a la llauna perque sempre surti de la ma del jugador powerupOffset = new Vector3(-2.37f, 2.17f, 0.04f); //Posem el valor del array a 100 for (int i = 0; i < playerDistance.Length; i++) { playerDistance[i] = 100f; } //Assignem el valor 99 que no correspon a cap enemic nextEnemyKill = 99; isGrenadeReady = false; //carreguem les opcions del rigidbody playerRb = GetComponent <Rigidbody>(); //carreguem les opcions del animator playerAnim = GetComponent <Animator>(); powerUpController = GameObject.Find("PowerUpController").GetComponent <PowerUpController>(); // rbGrenade = GameObject.Find("Grenade").GetComponent<Rigidbody>(); // grenade = GameObject.Find("Grenade"); //inicialitzem les els components del so playerAudio = GetComponent <AudioSource>(); //declarem les variables del walkaround movingRight = true; //crash 0 - vol dir que estem xocant contra res //crash 1 - Hem xocat anant a la dreta //crash 2 - Hem xocat anant conta la esquerra crash = 0; }
// Start is called before the first frame update void Start() { sentences = new Queue <string>(); gameManagerScene = GameObject.Find("GameManager").GetComponent <GameManagerScene>(); // instruccionsTrigger = GameObject.Find("Manual").GetComponent<InstruccionsTrigger>(); }