public SpawnInfo(SceneSerializerSpawnItem item)
            {
                PoolDataController pdc = item.GetComponent <PoolDataController>();

                id   = item.id;
                grp  = pdc.group;
                type = pdc.factoryKey;
                pos  = item.transform.position;
                rot  = item.transform.rotation;
            }
        /// <summary>
        /// only SceneSerializerSpawnItem calls this
        /// </summary>
        public void RegisterSpawn(SceneSerializerSpawnItem item)
        {
            if (item.id == SceneSerializer.invalidID)
            {
                item.__SetID(mNextId);
                mNextId--;

                mSpawns.Add(item.id, new SpawnInfo(item));
            }
            //if id is valid, then we already spawned it
        }
예제 #3
0
        public override void OnInspectorGUI()
        {
            SceneSerializerSpawnItem data = target as SceneSerializerSpawnItem;

            if (Application.isPlaying)
            {
                EditorGUILayout.LabelField("id", data.id.ToString());
            }
            else
            {
                EditorGUILayout.LabelField("id", "--");
            }
        }
 /// <summary>
 /// only SceneSerializerSpawnItem calls this
 /// </summary>
 public void UnRegisterSpawn(SceneSerializerSpawnItem item)
 {
     mSpawns.Remove(item.id);
 }