public static LevelBoundaries GetInstance()
 {
     if (!instance) {
     instance = FindObjectOfType(typeof(LevelBoundaries)) as LevelBoundaries;
     if (!instance)
         Debug.LogError("There needs to be one active LevelAttributes script on a GameObject in your scene.");
     }
     return instance;
 }
Exemple #2
0
    private void Awake()
    {
        var left   = leftBound.transform.position.x + leftBound.transform.localScale.x;
        var right  = rightBound.transform.position.x - rightBound.transform.localScale.x;
        var top    = topBound.transform.position.y - topBound.transform.localScale.y;
        var bottom = bottomBound.transform.position.y + bottomBound.transform.localScale.y;

        levelBoundaries = new LevelBoundaries(left, right, top, bottom);
    }
Exemple #3
0
 // Start is called before the first frame update
 void Start()
 {
     boundaries = FindObjectOfType <LevelBoundaries>();
 }
 void OnDisable()
 {
     instance = null;
 }
Exemple #5
0
 public void Load(Player subby, LevelBoundaries boundaries)
 {
     Subby = subby;
     Boundaries = boundaries;
 }
 void Start()
 {
     target = CavemanController.current_player;
     levelAttributes = LevelBoundaries.GetInstance ();
     levelBounds = levelAttributes.bounds;
 }