// Start is called before the first frame update void Start() { shootingManager = GetComponent <ShootingManager>(); currentIndex = 0; cambiaArma(currentIndex); armaGrande = false; player = GetComponent <PlayerControllerFPS>(); }
private void Awake() { isActive = IsActive; lives = MaximumLives; self = transform; selfShootingManager = GetComponent <ShootingManager>(); }
void Start() { spawnGrid(); shootingmanager = gameObject.GetComponent <ShootingManager> (); shootingmanager.Initiate(); movementmanager = gameObject.GetComponent <MovementManager> (); movementmanager.initiate(Vector3.right); }
// Start is called before the first frame update void Start() { player = GameObject.FindGameObjectWithTag("Player"); playerLife = player.GetComponent <PlayerDataLife>(); shotMan = player.GetComponent <ShootingManager>(); armaActual = shotMan.weaponActived; granadasGunController = shotMan.granades.GetComponent <GunController>(); colorLife = 0; putColorLife(0); }
void Awake() { if(!instance || instance == this) { instance = this; } else { Destroy(this); } }
void Start() { center = transform.position; Radius = 5f; ChickenWave = 0; ChickenCount = 3; numberOfDogs = 0; rigthHunterShooting = rightHunter.GetComponent <ShootingManager>(); leftHunterShooting = leftHunter.GetComponent <ShootingManager>(); rigthHunterMovement = rightHunter.GetComponent <HuntersMovement>(); leftHunterMovement = leftHunter.GetComponent <HuntersMovement>(); }
public void BuildRandomStarSystem(StarBase star, List <PlanetsBuildData> planets) { #region Inst Star GameObject starTmp = Instantiate(star.gameObject, Vector3.zero, Quaternion.identity); starTmp.transform.SetParent(gameObject.transform); #endregion #region Inst Planet planets.ForEach(x => { GameObject planetTmp = Instantiate(x.planet.gameObject, x.position, Quaternion.identity); planetTmp.transform.SetParent(gameObject.transform); OrbitalAroundHeandler orbitalScript = planetTmp.GetComponent <OrbitalAroundHeandler>(); if (orbitalScript != null) { orbitalScript.orbitingAround = starTmp; if (solarSystemDataSource == SolarSystemDataSource.Generate) { float coef = Vector3.Distance(planetTmp.transform.position, starTmp.transform.position); if (coef < 1) { coef = 1; } float orbitalSpeed = 60 / coef; orbitalScript.orbitalSpeed = Random.value == 0 ? -orbitalSpeed : orbitalSpeed; } else { //TODO Set orbital speed from save file } } ShootingManager shoot = planetTmp.GetComponent <ShootingManager>(); if (shoot != null) { if (allWeapons.Count > 0) { shoot.awalibleWeapons.Clear(); shoot.awalibleWeapons.Add(allWeapons[Random.Range(0, allWeapons.Count)]); } } }); #endregion }
private void Start() { shootingManager = FindObjectOfType <ShootingManager>().GetComponent <ShootingManager>(); //gunsInHand = new GameObject[4] /*{ laserInHand, pistolInHand, circleInHand, rocketInHand}*/; guns = new bool[4] { laserGun = false, pistolGun = false, circleGun = false, rocketGun = false }; for (int i = 0; i < guns.Length; i++) { guns[i] = false; } readyToShoot = new bool[4] { laserReadyToShoot, pistolReadyToShoot, circleReadyToShoot, rocketReadyToShoot }; for (int i = 0; i < readyToShoot.Length; i++) { readyToShoot[i] = false; } }
protected override void OnUpdate() { if (m_shootManager == null) { m_shootManager = ShootingManager.Instance; } if (m_shootManager == null) { return; } m_timer -= Time.deltaTime; if (m_timer <= 0) { m_timer = 1f / m_shootManager.shootPerSeconds; if (Input.GetKey(KeyCode.Space)) { NativeArray <Entity> entities = new NativeArray <Entity>(m_shootManager.shootCount * m_shootManager.shootCount, Allocator.Temp); m_entityManager.CreateEntity(m_entityArchetype, entities); for (int i = 0; i < entities.Length; i++) { m_entityManager.SetComponentData(entities[i], new Translation { Value = m_shootManager.shootPosition.position }); m_entityManager.SetComponentData(entities[i], new Rotation { Value = Quaternion.Euler(m_shootManager.shootPosition.forward + Vector3.forward * -90) }); m_entityManager.SetSharedComponentData(entities[i], new RenderMesh { mesh = m_shootManager.mesh, material = m_shootManager.material }); m_entityManager.SetComponentData(entities[i], new Bullet { direction = Quaternion.Euler(0, i % m_shootManager.shootCount * m_shootManager.shootAngle, i / m_shootManager.shootCount * m_shootManager.shootAngle) * m_shootManager.shootPosition.forward, speed = 50f }); } } } }
void Start() { spawnPos = transform.position; // Set To Same Position as THIS Object shootingManager = FindObjectOfType <ShootingManager> (); gameManager = FindObjectOfType <GameManager> (); }
public static void Wipe() { ShootingManager.instance = null; }
// Update is called once per frame void Update() { cdbarScript = FindObjectOfType <CDBarScript>().GetComponent <CDBarScript>(); PlayerChange(); shootingManager = currentPlayerGameObj.GetComponent <ShootingManager>(); }
private void Awake() { Instance = this; }
private void Awake() { _transform = transform; _shootingManager = GetComponent <ShootingManager>(); _lifeManager = GetComponent <PlayerLifeManager>(); }
public BlockerController blockerController; // Made this a public type since I'll put in here the prefab of the block instead of those in current scenes void Start() { shootingManager = FindObjectOfType <ShootingManager> (); scoreManager = FindObjectOfType <ScoreManager> (); }
private void Start() { timer = shootingInterval; shootingManager = FindObjectOfType <ShootingManager>(); }