示例#1
0
 ///////////////////////////////////////////////////////////////////////////////
 // functions
 ///////////////////////////////////////////////////////////////////////////////
 // ------------------------------------------------------------------
 // Desc:
 // ------------------------------------------------------------------
 void Reset()
 {
     if ( GetComponent<exLayer2D>() == null ) {
         switch ( plane ) {
         case exPlane.Plane.XY: layer2d = gameObject.AddComponent<exLayerXY>(); break;
         case exPlane.Plane.XZ: layer2d = gameObject.AddComponent<exLayerXZ>(); break;
         case exPlane.Plane.ZY: layer2d = gameObject.AddComponent<exLayerZY>(); break;
         }
         layer2d.plane = this;
         layer2d.UpdateDepth();
     }
 }