Check if object is in camera

I am trying to figure out if an object is within my Camera’s sight, I have done this before using

	public static bool ArmySpawnerInScreenSpace(Vector2 UnitScreenPosition)
	{
		if((UnitScreenPosition.x < Screen.width  UnitScreenPosition.y < Screen.height)
		(UnitScreenPosition.x < 0f  UnitScreenPosition.y < 0f))
		{
			return true;
		}
		else
		{
			return false;
		}
	}

Something like that. However it seems that since I am using an isometric camera angle that this formula no longer works.

my camera is angled at:
X: 30
Y: 45
Z: 0

Any tips or ideas would be super helpful, cheers!

Never mind found the issue! Hhaha Herp Derp me! I had the second set of < the wrong way haha fail

There is such way:

...
    ///Returns 'true' if object visible from camera
    public bool IsVisibleFrom(Camera camera)
    {
        Plane[] planes = GeometryUtility.CalculateFrustumPlanes(camera);
        return GeometryUtility.TestPlanesAABB(planes, renderer.bounds);
    }
...

Cheers but I already got it working using my own method… Just typing it the right way hahaha

You may run all kind of troubles with your own solution. In example, if user runs with different resolution (aspect)