## Handy site for viewing raw image formats

If you’re trying to figure out the format of a chunk of image data, then this site (here) is really handy.

I had an image file in a weird format and needed to figure out what it was. I uploaded the image, entered a few parameters and figured it out withing 30 seconds.

## Rename a member in Unity without losing the assignments in the Inspector

This is pretty simple when you have the right tag.

public GameObject m_foo;

To rename m_foo to m_bar without losing the assignments that have been set in a Unity scene, add the following on the line before the m_foo declaration: –

[FormerlySerializedAs(“m_foo”)]

Now rename m_foo to m_bar and go have a look at the scene in Unity. The member name is changed but the assignments aren’t lost.

Once you’ve been in to Unity and the scene has updated, it’s safe to delete the “[FormerlySerializedAs(“m_foo”)]” line as it’s not needed anymore.

Hope it helps!

## Quaternions: Set up an Quaternion to give a specific angle on a specific axis

Again, just dropping this here so I know where to find it. The following will set up a 1 degree rotation around the x axis (in this case it’s just rotating a Unity transform by 1 degree in the x)

```    Quaternion q = a_activeMesh.m_meshFilter.gameObject.transform.rotation;
Quaternion q2 = CreateFromAxisAngle(1.0f, 0.0f, 0.0f, 1.0f * Time.deltaTime);
q = q * q2;
a_activeMesh.m_meshFilter.gameObject.transform.rotation = q;
```
```Quaternion CreateFromAxisAngle(float x, float y, float z, float a)
{
// Here we calculate the sin( theta / 2) once for optimization
float factor = Mathf.Sin(a / 2.0f);

Quaternion q;

q.x = x * factor;
q.y = y * factor;
q.z = z * factor;

// Calcualte the w value by cos( theta / 2 )
q.w = Mathf.Cos(a / 2.0f );

return q.normalized;
}
```

## ADB Quick Commands

I keep looking these up, so dropping them here so I don’t have to: –

This will echo all output from a Unity project; adb logcat Unity:V *:S

This will echo all output from a Unity project to a file; adb logcat Unity:V *:S -d >> output.txt

This will clear the log; adb logcat -c

This will increase the buffer size so you have more than a few seconds before your logs start to disappear; adb logcat -G 16M

## XCode: “iPhone is not available. Please reconnect the device.”

I upgraded my iPhone 11 to iOS 14 today and got the message “iPhone is not available. Please reconnect the device.” when trying to send an app to it from XCode 11.4.1.

The message doesn’t really match the problem, as the problem was actually that I needed to install XCode 12 in order to support iOS 14. XCode 11 doesn’t support iOS 14.

Quick fix; install XCode 12

## Unity Build Failure, unable to update SDK

So, building on Android, I get the error; “Unity Build Failure, unable to update SDK”. The project I’m working on has been updated to a new SDK but Unity doesn’t have that SDK version installed

I used the SDK manager to update to the correct API but Unity didn’t see the change as Unity is looking at it’s ‘local’ version.

To solve this, you need to install to the specific Unity version that you’re using. Simple process; Open a CommandLine (CMD) as Administrator and type: –

“C:\Program Files\Unity\Hub\Editor\2019.3.11f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\bin\sdkmanager.bat” “platforms;android-29”

Obviously, you’ll need to adjust the Unity version and the Android SDK to what you need, but this does an in-place update of the Unity installed SDK.

Once you run that, Unity is happy again

Quick adb commandline to show the details you actually want: –

adb logcat s Unity ActivityManager PackageManager dalvikvm DEBUG

## The “Exec” task needs a command to execute.

Was getting the error “The “Exec” task needs a command to execute” while building a C#/C++ project in Visual Studio.

Problem turned out to be a stray newline in the Post-build step (I’d removed a copy but not cleared the newline)

## Games: Double Dragon 2

I worked on Double Dragon 2 as a Producer for Virgin Games in Vernon Yard off Portobello Road in the old Virgin Records building.

Binary Design handled the development work (based in Leeds from what I recall) and the programming was done by Richard Aplin who did a superb job.

The Amiga version featured full overscan and ran perfectly smoothly at 60FPS which was amazing for the time it was released.

Gameplay video can be found here