Exemple #1
0
        public Vector2[] GetMeshUV1s(Mesh m, SA2LogLevel LOG_LEVEL)
        {
            Vector2[] uv;
#if (UNITY_4_6 || UNITY_4_5 || UNITY_4_3 || UNITY_4_2 || UNITY_4_1 || UNITY_4_0_1 || UNITY_4_0 || UNITY_3_5)
            uv = m.uv1;
#else
            if (LOG_LEVEL >= SA2LogLevel.warn)
            {
                SA2Log.LogDebug("UV1 does not exist in Unity 5+");
            }
            uv = m.uv;
#endif
            if (uv.Length == 0)
            {
                if (LOG_LEVEL >= SA2LogLevel.debug)
                {
                    SA2Log.LogDebug("Mesh " + m + " has no uv1s. Generating");
                }
                if (LOG_LEVEL >= SA2LogLevel.warn)
                {
                    Debug.LogWarning("Mesh " + m + " didn't have uv1s. Generating uv1s.");
                }
                uv = new Vector2[m.vertexCount];
                for (int i = 0; i < uv.Length; i++)
                {
                    uv[i] = _HALF_UV;
                }
            }
            return(uv);
        }
Exemple #2
0
 public static void Log(SA2LogLevel l, String msg, SA2LogLevel currentThreshold)
 {
     if (l <= currentThreshold)
     {
         if (l == SA2LogLevel.error)
         {
             Debug.LogError(msg);
         }
         if (l == SA2LogLevel.warn)
         {
             Debug.LogWarning(String.Format("frm={0} WARN {1}", Time.frameCount, msg));
         }
         if (l == SA2LogLevel.info)
         {
             Debug.Log(String.Format("frm={0} INFO {1}", Time.frameCount, msg));
         }
         if (l == SA2LogLevel.debug)
         {
             Debug.Log(String.Format("frm={0} DEBUG {1}", Time.frameCount, msg));
         }
         if (l == SA2LogLevel.trace)
         {
             Debug.Log(String.Format("frm={0} TRACE {1}", Time.frameCount, msg));
         }
     }
 }
Exemple #3
0
    public void RunTestHarness()
    {
        int numTex = 32;
        int min    = 126;
        int max    = 2046;
        //txs[0] = new Image(0,5,800);
        //txs[1] = new Image(1,5,5000);

        List <Vector2> imgsToAdd = new List <Vector2>();

        for (int i = 0; i < numTex; i++)
        {
            imgsToAdd.Add(new Vector2(UnityEngine.Random.Range(min, max), UnityEngine.Random.Range(min, max) * 5));
        }

        doPowerOfTwoTextures = true;
        LOG_LEVEL            = SA2LogLevel.trace;

        //			imgsToAdd.Add(new Vector2(2046,900));
        //			imgsToAdd.Add(new Vector2(2046,900));
        //			imgsToAdd.Add(new Vector2(2,2));
        //			imgsToAdd.Add(new Vector2(2,2));

        int padding = 1;
        int w;
        int h;

        GetRects(imgsToAdd, 4096, padding, out w, out h);
    }
Exemple #4
0
 public static Vector2[] GetMeshUV1s(Mesh m, SA2LogLevel LOG_LEVEL)
 {
     if (_SAVersion == null)
     {
         _SAVersion = (SAVersionInterface)Activator.CreateInstance(Type.GetType("SA.Core.SAVersionConcrete,Assembly-CSharp"));
     }
     return(_SAVersion.GetMeshUV1s(m, LOG_LEVEL));
 }
        public bool isDirty = false; //needs apply

        public CombinedMesh(int maxNumVertsInMesh, GameObject resultSceneObject, SA2LogLevel ll)
        {
            combinedMesh = new SA3MeshCombinerSingle();
            combinedMesh.resultSceneObject = resultSceneObject;
            combinedMesh.LOG_LEVEL         = ll;
            extraSpace             = maxNumVertsInMesh;
            numVertsInListToDelete = 0;
            numVertsInListToAdd    = 0;
            gosToAdd    = new List <GameObject>();
            gosToDelete = new List <int>();
            gosToUpdate = new List <GameObject>();
        }
Exemple #6
0
 public void Log(SA2LogLevel l, String msg, SA2LogLevel currentThreshold)
 {
     SA2Log.Log(l, msg, currentThreshold);
     _CacheLogMessage(msg);
 }