示例#1
0
 public virtual void Hide(bool tf)
 {
     if (tf)
     {
         m_vertices[0] = Vector3.zero;
         m_vertices[1] = Vector3.zero;
         m_vertices[2] = Vector3.zero;
         m_vertices[3] = Vector3.zero;
         UpdateVerts();
         hidden = tf;             // Assign after so that UpdateVerts() will run.
     }
     else
     {
         hidden = tf;
         if (m_sprite != null)
         {
             if (m_sprite.pixelPerfect)
             {
                 m_sprite.CalcSize();
             }
             else
             {
                 m_sprite.SetSize(m_sprite.width, m_sprite.height);
             }
         }
     }
 }
示例#2
0
	// Use this for initialization
	void Start()
	{
		sprite = gameObject.GetComponent<SpriteRoot>();
		
#if !UNITY_EDITOR
		sprite.width = ( sprite.RenderCamera.orthographicSize * sprite.RenderCamera.aspect * 2.0f) * sizeX;
		sprite.height = sprite.RenderCamera.orthographicSize * 2.0f * sizeY;
		sprite.CalcSize();
#endif
	}