1
Support / Re: Fatal errors with Unity 4.3.1f1 + 2D Toolkit 2.3.0
« on: December 04, 2013, 05:02:40 am »
THANK YOU!
That solved the problem completely :-)
That solved the problem completely :-)
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
[AddComponentMenu("2D Toolkit/Camera/tk2dCamera")]
[ExecuteInEditMode]
/// <summary>
/// Maintains a screen resolution camera.
/// Whole number increments seen through this camera represent one pixel.
/// For example, setting an object to 300, 300 will position it at exactly that pixel position.
/// </summary>
public class tk2dCamera : MonoBehaviour
{
static int CURRENT_VERSION = 1;
public int version = 0;
[SerializeField] private tk2dCameraSettings cameraSettings = new tk2dCameraSettings();
Debug.Log("tk2dSystem.CurrentPlatform: " + tk2dSystem.CurrentPlatform);
tk2dSystem.CurrentPlatform = "4x";
Debug.Log("tk2dSystem.CurrentPlatform: " + tk2dSystem.CurrentPlatform);
Application.LoadLevel("1player");
It only changes when reloaded, ie if you load a scene after setting current platform. Not in current scene. In editor, use the preferences page to switch. In game set this before starting the first scene.
tk2dSystem.CurrentPlatform = "4x";
Debug.Log("tk2dSystem.CurrentPlatform: " + tk2dSystem.CurrentPlatform);
Application.LoadLevel("1player");
void Awake(){
Debug.Log("platform AWAKE: " + tk2dSystem.CurrentPlatform);
}
void Start(){
Debug.Log("platform START: " + tk2dSystem.CurrentPlatform);
}
Do you use tk2dCamera or just a plain ortho camera?
Yes, the idea is the sprites stay exactly the same size so you don't have to reposition anything.
The camera change is only in one place as opposed to all instances of everything.