예제 #1
0
        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;
            }
        }
예제 #2
0
 public void Get(GameObject obj)
 {
     if (camera == null)
     {
         camera = Camera.main;
     }
     if (camera)
     {
         screenBounds = CameraHelpers.OrthographicBounds(camera);
     }
 }
예제 #3
0
        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;
            }
        }
예제 #4
0
 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;
     }
 }
예제 #5
0
 public void Get(GameObject obj)
 {
     if (camera == null)
     {
         camera = Camera.main;
     }
     if (camera)
     {
         screenBounds = CameraHelpers.OrthographicBounds(camera);
     }
     if (spriteRenderer == null)
     {
         spriteRenderer = obj.GetComponent <SpriteRenderer>();
     }
 }
예제 #6
0
 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>();
     }
 }