Skip to content

Commit

Permalink
Remove old debug print message
Browse files Browse the repository at this point in the history
  • Loading branch information
zatherz committed Feb 21, 2017
1 parent 21bfaab commit 2f827ac
Showing 1 changed file with 69 additions and 74 deletions.
143 changes: 69 additions & 74 deletions Assembly-CSharp.Base.mm/src/Core/Assets/Assets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,6 @@ public static void Crawl(string dir, string root = null) {
for (int i = 0; i < files.Length; i++) {
string file = files[i];

/*
WIP animation loader stuff
will eventually be moved to a separate method
if (file.EndsWithInvariant("animation.yml")) {
var texture = Resources.Load<Texture2D>("sprites/test");
Console.WriteLine("TEXTURE " + texture.ToString());
Expand Down Expand Up @@ -183,67 +179,66 @@ will eventually be moved to a separate method
Console.WriteLine(ObjectDumper.Dump(tk2d_collection));
}

if (file.RemovePrefix(dir + Path.DirectorySeparatorChar) == "animation.yml") {
var reader = new StreamReader(file);
Console.WriteLine("DESERIALIZING " + file);
var anim = Deserializer.Deserialize<YAML.Animation>(reader);
Console.WriteLine("CREATE ANIMATION");
var animation = new tk2dSpriteAnimation();
var tk2d_data = new tk2dSpriteCollectionData {
name = anim.Name,
spriteCollectionName = anim.Name,
assetName = anim.Name,
};
var tk2d_collection = new tk2dSpriteCollection {
name = anim.Name,
assetName = anim.Name,
spriteCollection = tk2d_data
};
Console.WriteLine("CREATE CLIPS");
var tk2d_clips = new List<tk2dSpriteAnimationClip>();
foreach (var clip in anim.Clips) {
var tk2d_clip = new tk2dSpriteAnimationClip {
name = clip.Key,
fps = clip.Value.FPS,
wrapMode = clip.Value.WrapMode,
loopStart = 0,
};
var tk2d_frames = new List<tk2dSpriteAnimationFrame>();
foreach (var frame in clip.Value.Frames) {
tk2d_data.textureInsts
var tk2d_frame = new tk2dSpriteAnimationFrame {
spriteCollection = tk2d_data,
}
}
//if (file.RemovePrefix(dir + Path.DirectorySeparatorChar) == "animation.yml") {
// var reader = new StreamReader(file);
// Console.WriteLine("DESERIALIZING " + file);
// var anim = Deserializer.Deserialize<YAML.Animation>(reader);

// Console.WriteLine("CREATE ANIMATION");
// var animation = new tk2dSpriteAnimation();

// var tk2d_data = new tk2dSpriteCollectionData {
// name = anim.Name,
// spriteCollectionName = anim.Name,
// assetName = anim.Name,
// };

// var tk2d_collection = new tk2dSpriteCollection {
// name = anim.Name,
// assetName = anim.Name,
// spriteCollection = tk2d_data
// };

// Console.WriteLine("CREATE CLIPS");
// var tk2d_clips = new List<tk2dSpriteAnimationClip>();

// foreach (var clip in anim.Clips) {
// var tk2d_clip = new tk2dSpriteAnimationClip {
// name = clip.Key,
// fps = clip.Value.FPS,
// wrapMode = clip.Value.WrapMode,
// loopStart = 0,
// };

// var tk2d_frames = new List<tk2dSpriteAnimationFrame>();

// foreach (var frame in clip.Value.Frames) {
// tk2d_data.textureInsts

// var tk2d_frame = new tk2dSpriteAnimationFrame {
// spriteCollection = tk2d_data,
// }
// }

tk2d_clips.Add(tk2d_clip);
}
Console.WriteLine("CREATE ANIMATOR");
var animator = new tk2dSpriteAnimator {
name = anim.Name,
ClipFps = anim.FPS,
DefaultClipId = 0,
};
foreach (var clip in anim.Clips) {
Console.WriteLine("CLIP " + clip.Key + ":");
foreach (var frame in clip.Value) {
Console.WriteLine("FRAME " + frame);
}
}
Console.WriteLine("SERIALIZING " + anim);
Console.WriteLine(Serializer.Serialize(anim));
}
*/
// tk2d_clips.Add(tk2d_clip);
// }

// Console.WriteLine("CREATE ANIMATOR");
// var animator = new tk2dSpriteAnimator {
// name = anim.Name,
// ClipFps = anim.FPS,
// DefaultClipId = 0,
// };

// foreach (var clip in anim.Clips) {
// Console.WriteLine("CLIP " + clip.Key + ":");
// foreach (var frame in clip.Value) {
// Console.WriteLine("FRAME " + frame);
// }
// }
// Console.WriteLine("SERIALIZING " + anim);
// Console.WriteLine(Serializer.Serialize(anim));
//}
AddMapping(file.RemovePrefix(root).Substring(1), new AssetMetadata(file));
}
files = Directory.GetDirectories(dir);
Expand Down Expand Up @@ -372,19 +367,19 @@ public static UnityEngine.Object Load(string path, Type type) {
}
}

if (t_Texture.IsAssignableFrom(type) ||
type == t_Texture2D ||
(type == t_Object && metadata.AssetType == t_Texture2D)) {
Texture2D tex = new Texture2D(2, 2);
tex.name = path;
tex.LoadImage(metadata.Data);
tex.filterMode = FilterMode.Point;
return tex;
}
if (t_Texture.IsAssignableFrom(type) ||
type == t_Texture2D ||
(type == t_Object && metadata.AssetType == t_Texture2D))
{
Texture2D tex = new Texture2D(2, 2);
tex.name = path;
tex.LoadImage(metadata.Data);
tex.filterMode = FilterMode.Point;
return tex;
}

}

Console.WriteLine("HERE!");
UnityEngine.Object orig = Resources.Load(path + ETGModUnityEngineHooks.SkipSuffix, type);
if (orig is GameObject) {
Objects.HandleGameObject((GameObject) orig);
Expand Down

0 comments on commit 2f827ac

Please sign in to comment.