You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
680 B

  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class LandMarkGenerater : MonoBehaviour {
  5. public Transform[] LandMarkLocations;
  6. public void AddHotSpots(GameObject[] hotSpots)
  7. {
  8. foreach(Transform location in LandMarkLocations)
  9. {
  10. int randIndex = Random.Range(0, hotSpots.Length);
  11. float RandomRotation = Random.Range(0, 3) * 90;
  12. GameObject temp = Instantiate(hotSpots[randIndex], transform);
  13. temp.transform.position = location.position;
  14. temp.transform.Rotate(Vector3.up, RandomRotation);
  15. temp.name = "LandMark";
  16. }
  17. }
  18. }