コード例 #1
0
ファイル: TextureAtlasEditor.cs プロジェクト: Tokter/TokED
 protected override void OnDispose()
 {
     if (_atlas != null)
     {
         _atlas.UnLoad();
         _atlas = null;
     }
     if (_mat != null)
     {
         _mat.Dispose();
         _mat = null;
     }
 }
コード例 #2
0
ファイル: TextureAtlasEditor.cs プロジェクト: Tokter/TokED
 public override void Load()
 {
     _atlas = SelectedGameObject.FindParent<GameObjects.TextureAtlas>();
     if (_atlas != null)
     {
         _atlas.Load();
         var bitmap = _atlas.GetBitmap();
         if (bitmap != null)
         {
             _mat = TokGL.Material.CreateTextureColor(TokGL.Texture.FromBitmap(bitmap, true, false));
             Camera.Up = new Vector3(0, -1, 0);
             Camera.Position = new Vector3(bitmap.Width / 2.0f, bitmap.Height / 2.0f, -100);
             Camera.LookAt = new Vector3(bitmap.Width / 2.0f, bitmap.Height / 2.0f, 0);
             Camera.Fov = 1.0f;
         }
     }
 }