Example #1
0
    private CheckpointBoundary GenerateCheckpointBoundary(ref string id)
    {
        CheckpointBoundary checkPointBoundaryPrefab   = Resources.Load <CheckpointBoundary>(CHECKPOINT_BOUNDARY_PREFAB_PATH);
        CheckpointBoundary checkpointBoundary         = Instantiate(checkPointBoundaryPrefab);
        ObjectId           checkpointBoundaryObjectId = checkpointBoundary.gameObject.GetComponent <ObjectId>();

        id = checkpointBoundaryObjectId.GenerateId();
#if UNITY_EDITOR
        EditorGUIUtility.systemCopyBuffer = checkpointBoundaryObjectId.Id;
#endif
        return(checkpointBoundary);
    }
Example #2
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        if (GUILayout.Button("Copy Id"))
        {
            EditorGUIUtility.systemCopyBuffer = objectId.Id;
        }

        if (GUILayout.Button("Generate Id"))
        {
            objectId.GenerateId();

            EditorUtility.SetDirty(objectId);
            EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene());
        }
    }