using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public static class Utils
{
public static float GetDepthInOrthoCam(GameObject g, Camera c)
{
return Vector3.Dot(g.transform.position - c.transform.position, c.transform.forward);
}
public static Vector2 GetPosInOrthoCam(GameObject g, Camera c)
{
float x = Vector3.Dot(g.transform.position - c.transform.position, c.transform.right);
float y = Vector3.Dot(g.transform.position - c.transform.position, c.transform.up);
return new Vector2(x, y);
}
}