unity3d - How can I draw 2D triangles in Unity 5? -


i'm trying draw 2d triangles using this or this (scripts) unsuccessfully (i don't see triangles). have camera, canvas , panel in it, i've tried apply on empty canvas's child object, how must apply these scripts? i've tried different variations. , way draw triangles or there better? i've read somewhere gl class doesn't work on ios and/or mac, true?

private gameobject m_gotriangle; m_gotriangle.addcomponent<meshfilter>();         m_gotriangle.addcomponent<meshrenderer>();         m_meshtriangle = m_gotriangle.getcomponent<meshfilter>().mesh;         m_meshtriangle.clear();         m_meshtriangle.uv = new vector2[] { new vector2(0, 0), new vector2(0, 0.25f), new vector2(0.25f, 0.25f) };         m_meshtriangle.vertices = new vector3[] { new vector3(0, 0, 0), new vector3(0, 0.25f, 0), new vector3(0.25f, 0.25f, 0) };         m_meshtriangle.triangles = new int[] { 0, 1, 2 }; 

hope helps! =)


Comments

Popular posts from this blog

java - Could not locate OpenAL library -

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

sorting - opencl Bitonic sort with 64 bits keys -