public virtual void Awake() { if (objects.Count == 0) { var markers = FindObjectsOfType <LevelGeneratorMarker>(); if (markers != null) { for (int i = 0; i < markers.Length; i++) { objects.Add(markers[i].gameObject); } } } if (bounds == Vector2.zero) { bounds.x = CameraHelpers.OrthographicBounds(Camera.main).extents.x; bounds.y = CameraHelpers.OrthographicBounds(Camera.main).extents.y; } if (pixelMode && resolution.x > 0 && resolution.y > 0) { bounds.x = resolution.x / 100 / 2; bounds.y = resolution.y / 100 / 2; } }
public void Get(GameObject obj) { if (camera == null) { camera = Camera.main; } if (camera) { screenBounds = CameraHelpers.OrthographicBounds(camera); } }
void Awake() { bulletProperties.glowColor = bulletProperties.glow.color; bulletProperties.glow.enabled = false; screenBounds = CameraHelpers.OrthographicBounds(Camera.main); if (Find("Turret") != null) { turretFrames = Find("Turret").sprites.Length; } }
public void Get(GameObject obj) { if (Camera.main.orthographic && bounds == Vector2.zero) { bounds = CameraHelpers.OrthographicBounds(Camera.main).extents; } if (spriteRenderer == null) { spriteRenderer = obj.GetComponent <SpriteRenderer>(); } if (spriteRenderer && size == Vector2.zero) { size = spriteRenderer.bounds.size; } }
public void Get(GameObject obj) { if (camera == null) { camera = Camera.main; } if (camera) { screenBounds = CameraHelpers.OrthographicBounds(camera); } if (spriteRenderer == null) { spriteRenderer = obj.GetComponent <SpriteRenderer>(); } }
public void Get(GameObject obj) { if (camera == null) { camera = Camera.main; } if (camera) { screenBounds = CameraHelpers.OrthographicBounds(camera); } if (spriteRenderer == null) { spriteRenderer = obj.GetComponent <SpriteRenderer>(); } if (spriteRenderer && size == Vector2.zero) { size = spriteRenderer.bounds.size; } if (animator == null) { animator = obj.GetComponent <Animator>(); } }