void Start() { golpear = new Golpear(); pistola = new Pistola(); #region Instanciamiento de Clases y Variables Tipo_Arma = golpear.getGolpear(); //Definir arma por defecto movimiento = new Movimiento(Velocidad_EjeX, Velocidad_EjeY, this.transform); //La clase movimiento necesita las velocidades del eje X e Y y el transform ataque_Alessio = new Ataque_Alessio(); ataque_Alessio.setAtaque_Alessio(Prefab_Bala, Prefab_Golpe, Empty_Alessio, Tipo_Arma); //Le damos los datos al ataque de Alessio #endregion }
void Start() { armas = CambioDeArma.FindObjectOfType <CambioDeArma> (); pistola = Pistola.FindObjectOfType <Pistola> (); fusil = Fusil.FindObjectOfType <Fusil> (); escala=transform.localScale.x; rigidbody = GetComponent<Rigidbody2D>(); hormigaEscala.SetActive (false); hormigaCamina.SetActive (true); manoDispara = GameObject.Find ("Mano Dispara"); }
public void ResumeGame() { Time.timeScale = 1; pauseButton.SetActive(true); pauseMenu.SetActive(false); Pistola pistola = player.GetComponent <Pistola>(); if (pistola) { pistola.enabled = true; } player.GetComponent <PlayerController>().enabled = true; }
public void SetPlayer(GameObject player) { if (player.GetComponent <PlayerController>()) { Debug.Log("PlayerSet"); player_ = player; scriptPistola = player_.GetComponent <Pistola>(); scriptPC = player_.GetComponent <PlayerController>(); } else { Debug.LogWarning("No PlayerController Found on " + this); } }
void OnTriggerEnter(Collider other) { if (other.tag == "Pistola") { pistola = other.gameObject.GetComponent <Pistola>(); Agarrar_Pistola(); } if (other.tag == "Suelo") { rigiBody = GetComponent <Rigidbody>(); rigiBody.velocity = new Vector3(0, 0, 0); rigiBody.useGravity = false; } }
public void Die() { if (!GameManager.gmInstance_.TGM) { Pistola pistola = GetComponent <Pistola>(); gameObject.GetComponent <SpriteRenderer>().color = Color.gray; walking.Stop(); if (pistola) { pistola.enabled = false; } enabled = false; walking.loop = false; walking.clip = SoundManager.smInstance_.GetClip(SoundManager.FXSounds.PLAYER_DEATH); StartCoroutine(PlayerDeathSound()); } }
void Start() { gun = GetComponent <Pistola>(); rb = GetComponent <Rigidbody2D>(); daga = GetComponentInChildren <Daga>(); walking = GetComponent <AudioSource>(); black.SetActive(true); timeCD = Time.time; if (GameManager.gmInstance_ != null) { GameManager.gmInstance_.SetPlayer(gameObject); fov = GameManager.gmInstance_.createFieldofView(); fov.name = "FieldOfView" + name; fov.SetInstance(limit, fovSet); } else { Debug.LogError("Warnign GameManager was null when trying to access it from " + this); } }
void Start() { player = GetComponentInParent <PlayerController>(); pistola = GetComponentInParent <Pistola>(); beginSize = transform.localScale.x; mesh = GetComponent <MeshRenderer>(); source = GetComponent <AudioSource>(); if (GameManager.gmInstance_) { cam = GameManager.gmInstance_.GetCamera(); if (cam) { ortSize = cam.orthographicSize; } } else { Debug.LogError("Warning no GameManager found"); enabled = false; return; } if (SoundManager.smInstance_) { clips[0] = SoundManager.smInstance_.GetClip(SoundManager.FXSounds.PULSE_START); clips[1] = SoundManager.smInstance_.GetClip(SoundManager.FXSounds.PULSE_MID); clips[2] = SoundManager.smInstance_.GetClip(SoundManager.FXSounds.PULSE_END); } else { Debug.LogError("Warning no SoundManager found"); enabled = false; return; } if (player && pistola && mesh) { speed = player.GetSpeed(); mesh.enabled = false; } else { Debug.LogError("Warning no PlayerController or Gun found on " + this); enabled = false; return; } }
void Start() { pistolaEnemigo = new Pistola(); disparoEnemigo = new Disparar(Prefab_Bala, Empty_Rufianes, pistolaEnemigo.getPistola()); }