Example #1
0
 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;
 }
Example #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);
    }
Example #3
0
 // Start is called before the first frame update
 void Start()
 {
     boundaries = FindObjectOfType <LevelBoundaries>();
 }
Example #4
0
 void OnDisable()
 {
     instance = null;
 }
Example #5
0
 public void Load(Player subby, LevelBoundaries boundaries)
 {
     Subby = subby;
     Boundaries = boundaries;
 }
Example #6
0
 void Start()
 {
     target = CavemanController.current_player;
     levelAttributes = LevelBoundaries.GetInstance ();
     levelBounds = levelAttributes.bounds;
 }