Showing posts with label Dev Tools. Show all posts
Showing posts with label Dev Tools. Show all posts

Friday, September 11, 2015

Unity 5.x Screenshot Manager

After watching one of the dev log videos for Limit Theory, I wanted to duplicate his screenshot functionality.

Basically after pressing the screenshot key a nicely framed window displayed the screenshot and offered "Confirm" and "Delete" buttons.

I whipped this up in my Unity 5.2 but honestly there's no reason it should't work all the way back to Unity 3D 4.6 (<- completely untested mind you).

You can download the unity package right HERE.

Here is what it looks like in action:


Package has an Instructions.txt file along with prefabs.

Do let me know if you find it useful.

Current version 1.0
Date: Sept-11-2015

Enjoy :)

Wednesday, April 1, 2015

Rename SpriteBuilder Project

So, unless it's easy to rename an existing (like for example a nice game starter package); it will be pretty un-helpful to publish said examples.

So... off I went to discover the steps involved in the renaming process and it boiled down to TWO major steps.

STEP ONE:
1: Copy and rename the .spritebuilder file (bundle).
2: Once duplicated, rename it - make sure you conform to the standard SpriteBuilder limitations (USE NO SPACES).


3: Right-click and choose "Show Package Contents" to open the bundle folder. Just rename the .ccbproj file.



4: Double-click the Xcode project to open Xcode and proceed to STEP TWO.
In our example we are going to rename "StarterGame.spritebuilder" to "AwesomeProject.spritebuilder".


STEP TWO:
1: Once open in Xcode, perform a normal rename via the "Name" field in the right column.




Afterwards I usually close and exit Xcode then open the new project in SpriteBuilder, publish and use the shortcut to open Xcode.

Enjoy
:)

Wednesday, November 12, 2014

Unity 3D ErrorManager v1.1 (text logging)

Edit: Use this with Unity 4.6 and newer; for Unity 4.5 and older, please see THIS post

While I've named it ErrorManager; it could just as easily have been named TextLogManager because it can be use for so much more than just errors.



Here's the top part of the C# file - see below for download link
/// <summary>
/// ErrorLogManager 
///     - Primary: used to log errors to text file
/// 
/// Created by: Gregory Meach
/// Date: November 12, 2014
/// Version: 1.1 (Updated for Unity 4.6)
/// 
/// License: Do what you want, no credit necessary
/// Liability: None whatsoever.
/// 
/// Example: (called from ANY other class)    
///     ErrorLogManager.sharedManager.UpdateErrorLog("fakeMethod","not found",ErrorLogManager.sharedManager.GetErrorDate());
/// Note:
///     GetErrorDate() helper returns "now" as a string
///
/// </summary>

public class ErrorLogManager : MonoBehaviour {
    
    #region ErrorLog
    [Serializable]
    public class ErrorData {
        public string method;
        public string error;
        public string dateString;
    }
    public List<ErrorData> ErrorList = new List<ErrorData>();
    private string currentLogName = string.Empty;
    private string logInitText = string.Empty;
    private bool isFirstSave = true;

    // Set this to whatever name you want to use
    private string errorLogName = "Game_ErrorLog";

    // Set this to the maximum log entries before they are auto-saved
    private int maxLogEntriesBeforeSave = 30;

    // Set this to TRUE to overwrite the log file on startup
    private bool clearErrorLogOnStartup = false;

    // Set this to FALSE to overwrite the log file on startup
    private bool useTimeStampInFileName = true;

    // Helper methods
    public string GetErrorDate() { return System.DateTime.Now.ToString("s"); }
    public string GetSavedDataPath() { return (Application.persistentDataPath + Path.DirectorySeparatorChar); }
    public string GetFileDate() { 
        string dateString = System.DateTime.Now.ToString("d"); 
        dateString = dateString.Replace("/",".");
        return dateString;
    }

    public void UpdateErrorLog(string callingMethod, string errorMsg, string errorDate) {
        ErrorData newError = new ErrorData();
        newError.method = callingMethod;
        newError.error = errorMsg;
        newError.dateString = errorDate;
        ErrorList.Add(newError);
        if (ErrorList.Count > maxLogEntriesBeforeSave)
            FlushErrorLog();
    }

Here's the package link: ErrorManager_v1.1.unitypackage

Tuesday, October 28, 2014

Icon Set Creator v3.0 (iOS 8)


Previous post here: iOS Icon set Creator

So here's what the updated Automator workflow does:
Asks for your base (1024x1024) icon image then duplicates it, scales it and renames it, rinse and repeat until all twelve  (12) icons are created.

Notes: You can use the 1024 size icon to upload to iTunes Connect. Icon names have been revised to match Xcode 6 for easy drag and drop.

File listing:
iPad76@2x.png
iPad76.png
iPad40@2x.png
iPad40.png
iPad29@2x.png
iPad29.png
iPhone40@2x.png

iPhone60@2x.png
iPhone29@2x.png
iPhone60@3x.png
iPhone40@3x.png
iPhone29@3x.png


The workflow WILL NOT overwrite any existing files so make sure to put your base image in its own folder.

1000 words..... (very, very old screenshots...)

Test folder with 1024 icon (can be named whatever you want)

Launch Automator app and click the Run button...
Browse to and select your 1024 icon file
This is where the "magic" happens (lol!)

Completed folder with shiny new icons, yeah!
(Very old image)

In the zip file is a second Automator "application" named "Create iOS Iconset Droplet iOS8". You don't run this application you simply drop your 1024 icon onto it and the magic happens... sweet right? I know... :-]

To use the droplet, just drag the droplet to your Dock. Now when you need a set of icons, place your master image in a folder, then drag it on top of the droplet and give it about 3 seconds and its done. This has a permanent home in my Dock.


Download link: CLICK ME

Tuesday, June 24, 2014

Unity 3D ErrorManager (text logging)

Edit: Use this with Unity 4.5.x and older; for Unity 4.6 and up, please see THIS update

While I've named it ErrorManager; it could just as easily have been named TextLogManager because it can be use for so much more than just errors.

Here's the top part of the C# file - see below for download link
/// <summary>
/// ErrorLogManager 
///     - Primary: used to log errors to text file
/// 
/// Created by: Gregory Meach
/// Date: June 23, 2014
/// Version: 1.0 (initial release)
/// 
/// License: Do what you want, no credit necessary
/// Liability: None whatsoever.
/// 
/// Example: (called from ANY other class)    
///     ErrorLogManager.sharedManager.UpdateErrorLog("fakeMethod","not found",ErrorLogManager.sharedManager.GetErrorDate());
/// Note:
///     GetErrorDate() helper returns "now" as a string
///
/// </summary>

public class ErrorLogManager : MonoBehaviour {
    
    #region ErrorLog
    [Serializable]
    public class ErrorData {
        public string method;
        public string error;
        public string dateString;
    }
    public List<ErrorData> ErrorList = new List<ErrorData>();
    private string currentLogName = string.Empty;
    private string logInitText = string.Empty;
    private bool isFirstSave = true;

    // Set this to whatever name you want to use
    private string errorLogName = "Game_ErrorLog";

    // Set this to the maximum log entries before they are auto-saved
    private int maxLogEntriesBeforeSave = 30;

    // Set this to TRUE to overwrite the log file on startup
    private bool clearErrorLogOnStartup = false;

    // Set this to FALSE to overwrite the log file on startup
    private bool useTimeStampInFileName = true;

    // Helper methods
    public string GetErrorDate() { return System.DateTime.Now.ToString("s"); }
    public string GetSavedDataPath() { return (Application.persistentDataPath + Path.DirectorySeparatorChar); }
    public string GetFileDate() { 
        string dateString = System.DateTime.Now.ToString("d"); 
        dateString = dateString.Replace("/",".");
        return dateString;
    }

    public void UpdateErrorLog(string callingMethod, string errorMsg, string errorDate) {
        ErrorData newError = new ErrorData();
        newError.method = callingMethod;
        newError.error = errorMsg;
        newError.dateString = errorDate;
        ErrorList.Add(newError);
        if (ErrorList.Count > maxLogEntriesBeforeSave)
            FlushErrorLog();
    }

Here's the package link: ErrorManager_v1.0.unitypackage

Thursday, September 26, 2013

Xcode 5 - Fixing Simulator Install Errors

With the GM release of Xcode 5 - building and testing seem okay with iOS 7 however many times when you build and run for iOS 6 the simulator will fail to install your build.

As a work around, INSTEAD of deleting the app from the simulator, just browse to the simulators folder, open the 6.1 (or whatever version you are having the error on), open Applications then find your app and open that folder. Now just remove the .app bundle.

This should allow your new build to install but you SHOULD NOT loose all your settings, saved games, preferences, etc.

:-)


Wednesday, March 23, 2011

Back to life

I missed this somewhere... sorry but Mobile Orchard is back on-line. Last I knew Dan was "taking his ball and going home".... guess he had a change of heart (or pocketbook). Note: I can't locate Dan's blog post as it has disappeared, I guess you can take back what you say on the interweb ;-)

Miss Mobile Orchard? We’re back!

Regardless, it was a great resource and should continue to be, if you've not checked them out by all means do:

http://mobileorchard.com/

Saturday, December 18, 2010

iOS Icon set Creator

UPDATED HERE: View Post

I was updating the icon for Easy Lander and was annoyed every time I wanted to see the update in the Simulator or on my device because I had to take my new 512x512 icon and resize it, a few times.

<fanboy alert!>
This is why I love using a Mac! - AUTOMATOR to the rescue!
</fanboy alert!>

So here's what the Automator workflow does:
Asks for your 512x512 icon image then duplicates it, scales it and renames it, rinse and repeat until all five (5) icons are created.

Icon@2x.png = 114x114
Icon-72.png = 72x72
Icon-Small@2x.png = 58x58
Icon.png = 57x57
IconSmall-50.png = 50x50
Icon-Small.png = 29x29

The workflow WILL NOT overwrite any existing files so make sure to put your 512 image in its own folder.

1000 words.....

Test folder with 512 icon (can be named whatever you want)

Launch Automator app and click the Run button...
Browse to and select your 512 icon file
This is where the "magic" happens (lol!)

Completed folder with shiny new icons, yeah!


In the zip file is a second Automator "application" named "Create iOS Iconset Droplet". You don't run this application you simply drop your 512 icon onto it and the magic happens... sweet right? I know... :-]

Download link CLICK ME

Tuesday, September 14, 2010

iOS Developer Utilities

Open Source iOS Add-ons

There are several open source iOS add-ons that I use and maybe there are some developers that do not know about them. Here's my listing:

* In-App Purchasing: Excellent blog post with source code to easily add In-App Purchasing to your app. The only thing that I have updated is to use the keychain and not NSUserDefaults. See Keychain Access below.

* Ask for Review: Add this to pop-up an alert after X-days or X-launches of your app and prompt the use for a review.

* Keychain Access: Add this to easily access (store and retrieve) data from the secure keychain. Use it in combination with In-App purchases for an increase in security.

* Mobile App-Sales: Use this to track your iTunes Sales info (jonkean's branch works now).

* Three20: I personally don't use it but many developers do.

I will keep this post updated as I find new ones too.