Beispiel #1
0
 public Randomizer(AsteroidObjectList list)
 {
     use_randomizer             = list.use_randomizer;
     color_randomize_options    = new ColorRandomizer(list);
     material_randomize_options = new MaterialRandomizer(list);
     texture_randomize_options  = new TextureRandomizer(list);
     spawn_options = new SpawnRandomizer(list);
 }
Beispiel #2
0
        // Used at the start of each round to put the tank into it's default state.
        public void Reset()
        {
            // maybe we should move this into the agent and add to ITankAgent??
            m_Instance.transform.position         = SpawnRandomizer.GetRandomSpawnPosition(m_SpawnPoint.gameObject);
            m_Instance.transform.localEulerAngles = new Vector3(0f, SpawnRandomizer.GetRandomSpawnRotation(m_SpawnPoint.gameObject), 0f);

            // m_Instance.SetActive (false);
            // m_Instance.SetActive (true);

            // NOTE:  the tutorial reloads the scene and re-runs Start() code for all components with the SetActive() above
            // we dont want to do this, we want a quick state reset
            // call new method below to handle it
            QuickStateReset();
        }
Beispiel #3
0
 internal void RandomiseOrganismChildPosition(BasicOrganismScript organism, BasicOrganismScript parent, float range = 2)
 {
     SpawnRandomizer.SpawnFromParent(organism.GetOrganismMotor(), parent.GetOrganismMotor().GetRotationTransform().position, parent.GetOrganismMotor().GetRotationTransform().eulerAngles, range);
 }
Beispiel #4
0
 internal void RandomiseOrganismPosition(BasicOrganismScript organism)
 {
     SpawnRandomizer.SpawnRandom(organism.GetOrganismMotor());
 }
Beispiel #5
0
 public void SpawnPlayer(SpawnRandomizer spawnArea)
 {
     GameObject.Instantiate(this.player, spawnArea.RandomSpawn, this.player.transform.rotation);
 }