// Start is called before the first frame update
 void Start()
 {
     shootingManager = GetComponent <ShootingManager>();
     currentIndex    = 0;
     cambiaArma(currentIndex);
     armaGrande = false;
     player     = GetComponent <PlayerControllerFPS>();
 }
Ejemplo n.º 2
0
    private void Awake()
    {
        isActive = IsActive;
        lives    = MaximumLives;

        self = transform;
        selfShootingManager = GetComponent <ShootingManager>();
    }
Ejemplo n.º 3
0
 void Start()
 {
     spawnGrid();
     shootingmanager = gameObject.GetComponent <ShootingManager> ();
     shootingmanager.Initiate();
     movementmanager = gameObject.GetComponent <MovementManager> ();
     movementmanager.initiate(Vector3.right);
 }
Ejemplo n.º 4
0
 // 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);
     }
 }
Ejemplo n.º 6
0
 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>();
 }
Ejemplo n.º 7
0
    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
    }
Ejemplo n.º 8
0
    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;
        }
    }
Ejemplo n.º 9
0
    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
                    });
                }
            }
        }
    }
Ejemplo n.º 10
0
 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;
 }
Ejemplo n.º 12
0
 // Update is called once per frame
 void Update()
 {
     cdbarScript = FindObjectOfType <CDBarScript>().GetComponent <CDBarScript>();
     PlayerChange();
     shootingManager = currentPlayerGameObj.GetComponent <ShootingManager>();
 }
Ejemplo n.º 13
0
 private void Awake()
 {
     Instance = this;
 }
Ejemplo n.º 14
0
 private void Awake()
 {
     _transform       = transform;
     _shootingManager = GetComponent <ShootingManager>();
     _lifeManager     = GetComponent <PlayerLifeManager>();
 }
Ejemplo n.º 15
0
    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> ();
    }
Ejemplo n.º 16
0
 private void Start()
 {
     timer           = shootingInterval;
     shootingManager = FindObjectOfType <ShootingManager>();
 }