Last active
November 21, 2017 12:25
-
-
Save snlehton/cd2fedcfe3d298f35d6d81ec2dec6ee1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class SpawnTest : MonoBehaviour | |
{ | |
// a prefab containing SpawnTestPrefab | |
public GameObject prefab; | |
void Start() | |
{ | |
Instantiate(prefab, new Vector3(100, 0, 0), Quaternion.identity); | |
} | |
} | |
//... | |
using UnityEngine; | |
public class SpawnTestPrefab : MonoBehaviour | |
{ | |
// Use this for initialization | |
void Start() | |
{ | |
Debug.Log("[" + Time.frameCount + "] Start " + transform.position); | |
} | |
void OnEnable() | |
{ | |
Debug.Log("[" + Time.frameCount + "] OnEnable " + transform.position); | |
} | |
void Awake() | |
{ | |
Debug.Log("[" + Time.frameCount + "] Awake " + transform.position); | |
} | |
} | |
/* | |
... | |
log output: | |
Unity 5.6.1p3 | |
[1] Awake (100.0, 0.0, 0.0) | |
[1] OnEnable (100.0, 0.0, 0.0) | |
[1] Start (100.0, 0.0, 0.0) | |
Unity 5.6.4p2 & Unity 2017.2.0f3 | |
[1] Awake (0.0, 0.0, 0.0) | |
[1] OnEnable (0.0, 0.0, 0.0) | |
[1] Start (100.0, 0.0, 0.0) | |
EDIT: | |
Works in Unity 2017.2.0p2 (no idea which fix) | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment