Ejemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        {
            m_currentAstroidSpawnerAngle += m_planet.m_speed * Time.deltaTime;
            Vector3 position = m_planet.NextPosition3d(m_currentAstroidSpawnerAngle);

            Vector3 sunToPlanet = (position - m_planet.m_sun.transform.position).normalized;

            Vector3 idontcareanymore = sunToPlanet * m_astroidSpawnerDeviation;

            m_astroidSpawnerInner.transform.position = position - idontcareanymore;
            m_astroidSpawnerOuter.transform.position = position + idontcareanymore;
        }
        m_spawnTime = m_defaultSpawnTime - (Time.time * m_spawnModifier);
        m_spawnTime = Mathf.Clamp(m_spawnTime, m_spawnTimeMin, m_defaultSpawnTime);
    }