void OnGUISceneSettings_KawaAltApiWorldInfo(VRCSDK2.VRC_SceneDescriptor scene)
    {
        var w = scene.apiWorld as ApiWorld;

        if (w != null)
        {
            var short_name = Kawa_CutTooLongString(w.name, 100);
            var short_desc = Kawa_CutTooLongString(w.description, 1000);

            EditorGUILayout.LabelField(short_name, titleGuiStyle);

            GUILayout.Label(short_desc, infoGuiStyle);
            EditorGUILayout.LabelField("Capacity: " + w.capacity);

            EditorGUILayout.Space();

            EditorGUILayout.LabelField("Version: " + w.version);
            EditorGUILayout.LabelField("Unity Version: " + w.unityVersion);
            //EditorGUILayout.LabelField("Created At: " + w.createdAt.ToString()); // Невалидно
            EditorGUILayout.LabelField("Created At: " + w.created_at.ToString("u"));
            EditorGUILayout.LabelField("Updated At: " + w.updated_at.ToString("u"));
            EditorGUILayout.LabelField("Supports Android: " + Kawa_SupportsAndroid(w.supportedPlatforms));
            EditorGUILayout.LabelField("Supports Windows:" + Kawa_SupportsWindows(w.supportedPlatforms));

            EditorGUILayout.Space();

            EditorGUILayout.LabelField("Release: " + w.releaseStatus);
            // EditorGUILayout.LabelField("Publication Date: " + w.publicationDate.ToString()); // Невалидно
            EditorGUILayout.LabelField("Is Admin Approved: " + w.isAdminApproved);
            EditorGUILayout.LabelField("Is Community Labs World: " + w.IsCommunityLabsWorld);
            EditorGUILayout.LabelField("Is Curated: " + w.isCurated);

            EditorGUILayout.Space();

            EditorGUILayout.LabelField("Occupants: " + w.occupants);
            EditorGUILayout.LabelField("Total Likes: " + w.totalLikes);
            EditorGUILayout.LabelField("Total Visits: " + w.totalVisits);

            EditorGUILayout.Space();

            var tags = w.tags ?? new List <string>()
            {
            };
            var tags_a  = tags.Where(x => x.StartsWith("author_tag_")).Select(x => x.Substring(11, x.Length - 11)).ToArray();
            var tags_na = tags.Where(x => !x.StartsWith("author_tag_")).ToArray();

            EditorGUILayout.LabelField("Tags: " + string.Join(", ", tags_na.ToArray()), EditorStyles.wordWrappedLabel);
            EditorGUILayout.LabelField("Author Tags: " + string.Join(", ", tags_a.ToArray()), EditorStyles.wordWrappedLabel);
        }
        else
        {
            EditorGUILayout.LabelField("Unpublished VRChat World", titleGuiStyle);
        }
    }
Beispiel #2
0
    void OnGUISceneCheck(VRCSDK2.VRC_SceneDescriptor scene)
    {
        CheckUploadChanges(scene);

        EditorGUILayout.InspectorTitlebar(true, scene.gameObject);

        if (VRC.Core.APIUser.CurrentUser != null && VRC.Core.APIUser.CurrentUser.hasScriptingAccess && !CustomDLLMaker.DoesScriptDirExist())
        {
            CustomDLLMaker.CreateDirectories();
        }

        Vector3 g = Physics.gravity;

        if (g.x != 0.0f || g.z != 0.0f)
        {
            OnGUIWarning(scene, "Gravity vector is not straight down. Though we support different gravity, player orientation is always 'upwards' so things don't always behave as you intend.");
        }
        if (g.y > 0)
        {
            OnGUIWarning(scene, "Gravity vector is not straight down, inverted or zero gravity will make walking extremely difficult.");
        }
        if (g.y == 0)
        {
            OnGUIWarning(scene, "Zero gravity will make walking extremely difficult, though we support different gravity, player orientation is always 'upwards' so this may not have the effect you're looking for.");
        }

        scene.useAssignedLayers = true;
        if (scene.useAssignedLayers)
        {
            if (!UpdateLayers.AreLayersSetup())
            {
                OnGUIWarning(scene, "Layers are not setup properly. Please press the button above.");
            }

            if (UpdateLayers.AreLayersSetup() && !UpdateLayers.IsCollisionLayerMatrixSetup())
            {
                OnGUIWarning(scene, "Physics Collision Layer Matrix is not setup correctly. Please press the button above.");
            }
        }

        // warn those without scripting access if they choose to script locally
        if (VRC.Core.APIUser.CurrentUser != null && !VRC.Core.APIUser.CurrentUser.hasScriptingAccess && CustomDLLMaker.DoesScriptDirExist())
        {
            OnGUIWarning(scene, "Your account does not have permissions to upload custom scripts. You can test locally but need to contact VRChat to publish your world with scripts.");
        }

        // auto create VRCScript dir for those with access
        if (VRC.Core.APIUser.CurrentUser != null && VRC.Core.APIUser.CurrentUser.hasScriptingAccess && !CustomDLLMaker.DoesScriptDirExist())
        {
            CustomDLLMaker.CreateDirectories();
        }
    }
    public override void OnInspectorGUI()
    {
        if (sceneDescriptor == null)
        {
            sceneDescriptor = (VRCSDK2.VRC_SceneDescriptor)target;
        }

        if (pipelineManager == null)
        {
            pipelineManager = sceneDescriptor.GetComponent <VRC.Core.PipelineManager>();
            if (pipelineManager == null)
            {
                sceneDescriptor.gameObject.AddComponent <VRC.Core.PipelineManager>();
            }
        }

        DrawDefaultInspector();
    }
Beispiel #4
0
    void CheckUploadChanges(VRCSDK2.VRC_SceneDescriptor scene)
    {
        if (UnityEditor.EditorPrefs.HasKey("VRCSDK2_scene_changed") &&
            UnityEditor.EditorPrefs.GetBool("VRCSDK2_scene_changed"))
        {
            UnityEditor.EditorPrefs.DeleteKey("VRCSDK2_scene_changed");

            if (UnityEditor.EditorPrefs.HasKey("VRCSDK2_capacity"))
            {
                scene.capacity = UnityEditor.EditorPrefs.GetInt("VRCSDK2_capacity");
                UnityEditor.EditorPrefs.DeleteKey("VRCSDK2_capacity");
            }
            if (UnityEditor.EditorPrefs.HasKey("VRCSDK2_content_sex"))
            {
                scene.contentSex = UnityEditor.EditorPrefs.GetBool("VRCSDK2_content_sex");
                UnityEditor.EditorPrefs.DeleteKey("VRCSDK2_content_sex");
            }
            if (UnityEditor.EditorPrefs.HasKey("VRCSDK2_content_violence"))
            {
                scene.contentViolence = UnityEditor.EditorPrefs.GetBool("VRCSDK2_content_violence");
                UnityEditor.EditorPrefs.DeleteKey("VRCSDK2_content_violence");
            }
            if (UnityEditor.EditorPrefs.HasKey("VRCSDK2_content_gore"))
            {
                scene.contentGore = UnityEditor.EditorPrefs.GetBool("VRCSDK2_content_gore");
                UnityEditor.EditorPrefs.DeleteKey("VRCSDK2_content_gore");
            }
            if (UnityEditor.EditorPrefs.HasKey("VRCSDK2_content_other"))
            {
                scene.contentOther = UnityEditor.EditorPrefs.GetBool("VRCSDK2_content_other");
                UnityEditor.EditorPrefs.DeleteKey("VRCSDK2_content_other");
            }
            if (UnityEditor.EditorPrefs.HasKey("VRCSDK2_release_public"))
            {
                scene.releasePublic = UnityEditor.EditorPrefs.GetBool("VRCSDK2_release_public");
                UnityEditor.EditorPrefs.DeleteKey("VRCSDK2_release_public");
            }

            EditorUtility.SetDirty(scene);
            UnityEditor.SceneManagement.EditorSceneManager.MarkSceneDirty(UnityEditor.SceneManagement.EditorSceneManager.GetActiveScene());
        }
    }
Beispiel #5
0
    void OnGUIScene(VRCSDK2.VRC_SceneDescriptor scene)
    {
        string lastUrl          = VRC_SdkBuilder.GetLastUrl();
        bool   lastBuildPresent = lastUrl != null;

        string worldVersion = "-1";

        PipelineManager[] pms = (PipelineManager[])VRC.Tools.FindSceneObjectsOfTypeAll <PipelineManager>();
        if (pms.Length == 1 && !string.IsNullOrEmpty(pms[0].blueprintId))
        {
            if (scene.apiWorld == null)
            {
                ApiWorld world = API.FromCacheOrNew <ApiWorld>(pms[0].blueprintId);
                world.Fetch(null, false,
                            (c) => scene.apiWorld = c.Model as ApiWorld,
                            (c) =>
                {
                    if (c.Code == 404)
                    {
                        Debug.LogErrorFormat("Could not load world {0} because it didn't exist.", pms[0].blueprintId);
                        ApiCache.Invalidate <ApiWorld>(pms[0].blueprintId);
                    }
                    else
                    {
                        Debug.LogErrorFormat("Could not load world {0} because {1}", pms[0].blueprintId, c.Error);
                    }
                });
                scene.apiWorld = world;
            }
            worldVersion = (scene.apiWorld as ApiWorld).version.ToString();
        }
        EditorGUILayout.LabelField("World Version: " + worldVersion);

        EditorGUILayout.Space();

        if (!UpdateLayers.AreLayersSetup() && GUILayout.Button("Setup Layers for VRChat"))
        {
            bool doIt = EditorUtility.DisplayDialog("Setup Layers for VRChat", "This adds all VRChat layers to your project and pushes any custom layers down the layer list. If you have custom layers assigned to gameObjects, you'll need to reassign them. Are you sure you want to continue?", "Do it!", "Don't do it");
            if (doIt)
            {
                UpdateLayers.SetupEditorLayers();
            }
        }

        if (UpdateLayers.AreLayersSetup() && !UpdateLayers.IsCollisionLayerMatrixSetup() && GUILayout.Button("Setup Collision Layer Matrix for VRChat"))
        {
            bool doIt = EditorUtility.DisplayDialog("Setup Collision Layer Matrix for VRChat", "This will setup the correct physics collisions in the PhysicsManager for VRChat layers. Are you sure you want to continue?", "Do it!", "Don't do it");
            if (doIt)
            {
                UpdateLayers.SetupCollisionLayerMatrix();
            }
        }

        scene.autoSpatializeAudioSources = EditorGUILayout.ToggleLeft("Apply 3D spatialization to AudioSources automatically at runtime (override settings by adding an ONSPAudioSource component to game object)", scene.autoSpatializeAudioSources);
        if (GUILayout.Button("Enable 3D spatialization on all 3D AudioSources in scene now"))
        {
            bool doIt = EditorUtility.DisplayDialog("Enable Spatialization", "This will add an ONSPAudioSource script to every 3D AudioSource in the current scene, and enable default settings for spatialization.  Are you sure you want to continue?", "Do it!", "Don't do it");
            if (doIt)
            {
                if (_EnableSpatialization != null)
                {
                    _EnableSpatialization();
                }
                else
                {
                    Debug.LogError("VrcSdkControlPanel: EnableSpatialization callback not found!");
                }
            }
        }

        GUI.enabled = (GUIErrors.Count == 0 && checkedForIssues);
        EditorGUILayout.Space();
        EditorGUILayout.BeginVertical();
        EditorGUILayout.LabelField("Test", EditorStyles.boldLabel);
        numClients = EditorGUILayout.IntField("Number of Clients", numClients);
        if (lastBuildPresent == false)
        {
            GUI.enabled = false;
        }
        if (GUILayout.Button("Last Build"))
        {
            VRC_SdkBuilder.shouldBuildUnityPackage = false;
            VRC_SdkBuilder.numClientsToLaunch      = numClients;
            VRC_SdkBuilder.RunLastExportedSceneResource();
        }
        if (APIUser.CurrentUser.hasSuperPowers)
        {
            if (GUILayout.Button("Copy Test URL"))
            {
                TextEditor te = new TextEditor();
                te.text = lastUrl;
                te.SelectAll();
                te.Copy();
            }
        }
        if (lastBuildPresent == false)
        {
            GUI.enabled = true;
        }
        if (GUILayout.Button("New Build"))
        {
            EnvConfig.ConfigurePlayerSettings();
            VRC_SdkBuilder.shouldBuildUnityPackage = false;
            VRC.AssetExporter.CleanupUnityPackageExport();  // force unity package rebuild on next publish
            VRC_SdkBuilder.numClientsToLaunch = numClients;
            VRC_SdkBuilder.PreBuildBehaviourPackaging();
            VRC_SdkBuilder.ExportSceneResourceAndRun();
        }
        EditorGUILayout.EndVertical();
        EditorGUILayout.Space();
        EditorGUILayout.BeginVertical();
        EditorGUILayout.LabelField("Publish", EditorStyles.boldLabel);
        if (lastBuildPresent == false)
        {
            GUI.enabled = false;
        }
        if (GUILayout.Button("Last Build"))
        {
            if (APIUser.CurrentUser.canPublishWorlds)
            {
                VRC_SdkBuilder.shouldBuildUnityPackage = VRC.AccountEditorWindow.FutureProofPublishEnabled;
                VRC_SdkBuilder.UploadLastExportedSceneBlueprint();
            }
            else
            {
                ShowContentPublishPermissionsDialog();
            }
        }
        if (lastBuildPresent == false)
        {
            GUI.enabled = true;
        }
        if (GUILayout.Button("New Build"))
        {
            if (APIUser.CurrentUser.canPublishWorlds)
            {
                EnvConfig.ConfigurePlayerSettings();
                VRC_SdkBuilder.shouldBuildUnityPackage = VRC.AccountEditorWindow.FutureProofPublishEnabled;
                VRC_SdkBuilder.PreBuildBehaviourPackaging();
                VRC_SdkBuilder.ExportAndUploadSceneBlueprint();
            }
            else
            {
                ShowContentPublishPermissionsDialog();
            }
        }
        EditorGUILayout.EndVertical();
        GUI.enabled = true;
    }
Beispiel #6
0
    void OnGUISceneCheck(VRCSDK2.VRC_SceneDescriptor scene)
    {
        CheckUploadChanges(scene);

        EditorGUILayout.InspectorTitlebar(true, scene.gameObject);

        if (VRC.Core.APIUser.CurrentUser != null && VRC.Core.APIUser.CurrentUser.hasScriptingAccess && !CustomDLLMaker.DoesScriptDirExist())
        {
            CustomDLLMaker.CreateDirectories();
        }

        Vector3 g = Physics.gravity;

        if (g.x != 0.0f || g.z != 0.0f)
        {
            OnGUIWarning(scene, "Gravity vector is not straight down. Though we support different gravity, player orientation is always 'upwards' so things don't always behave as you intend.");
        }
        if (g.y > 0)
        {
            OnGUIWarning(scene, "Gravity vector is not straight down, inverted or zero gravity will make walking extremely difficult.");
        }
        if (g.y == 0)
        {
            OnGUIWarning(scene, "Zero gravity will make walking extremely difficult, though we support different gravity, player orientation is always 'upwards' so this may not have the effect you're looking for.");
        }

        #if PLAYMAKER
        if (VRCSDK2.VRC_PlaymakerHelper.ValidatePlaymaker() == false)
        {
            OnGUIError(scene, VRCSDK2.VRC_PlaymakerHelper.GetErrors());
        }
        #endif

        if (!UpdateLayers.AreLayersSetup())
        {
            OnGUIError(scene, "Layers are not yet configured for VRChat. Please press the 'Setup Layers for VRChat' button above to apply layer settings and enable Test/Publish.");
        }

        if (UpdateLayers.AreLayersSetup() && !UpdateLayers.IsCollisionLayerMatrixSetup())
        {
            OnGUIError(scene, "Physics Collision Layer Matrix is not yet configured for VRChat. Please press the 'Setup Collision Layer Matrix for VRChat' button above to apply collision settings and enable Test/Publish.");
        }

        // warn those without scripting access if they choose to script locally
        if (VRC.Core.APIUser.CurrentUser != null && !VRC.Core.APIUser.CurrentUser.hasScriptingAccess && CustomDLLMaker.DoesScriptDirExist())
        {
            OnGUIWarning(scene, "Your account does not have permissions to upload custom scripts. You can test locally but need to contact VRChat to publish your world with scripts.");
        }

        foreach (VRCSDK2.VRC_DataStorage ds in GameObject.FindObjectsOfType <VRCSDK2.VRC_DataStorage>())
        {
            VRCSDK2.VRC_ObjectSync os = ds.GetComponent <VRCSDK2.VRC_ObjectSync>();
            if (os != null && os.SynchronizePhysics)
            {
                OnGUIWarning(scene, ds.name + " has a VRC_DataStorage and VRC_ObjectSync, with SynchronizePhysics enabled.");
            }
        }

        // auto create VRCScript dir for those with access
        if (VRC.Core.APIUser.CurrentUser != null && VRC.Core.APIUser.CurrentUser.hasScriptingAccess && !CustomDLLMaker.DoesScriptDirExist())
        {
            CustomDLLMaker.CreateDirectories();
        }

        if (scene.UpdateTimeInMS < (int)(1000f / 90f * 3f))
        {
            OnGUIWarning(scene, "Room has a very fast update rate; experience may suffer with many users.");
        }
    }
Beispiel #7
0
    private void Make()
    {
        List <GameObject> R_con      = new List <GameObject>();
        List <GameObject> L_con      = new List <GameObject>();
        List <GameObject> Gimic_List = new List <GameObject>();
        string            path       = AssetDatabase.GetAssetOrScenePath(page_fold);

        string[] sp_path = path.Split('/');
        string   re_path = sp_path[2];

        for (int i = 3; i < sp_path.Length; i++)
        {
            re_path += "/" + sp_path[i];
        }



        VRCSDK2.VRC_SceneDescriptor vRC_Scene = VRCWoald.GetComponent <VRCSDK2.VRC_SceneDescriptor>();

        for (int i = 0; ; i++)
        {
            if (File.Exists(path + "/p" + i + sp_path[sp_path.Length - 2] + ".mat"))
            {
                Material mat = Resources.Load(re_path + "/p" + i + sp_path[sp_path.Length - 2]) as Material;
                if (mat == null)
                {
                    Debug.Log(re_path + "/p" + i + ".mat" + " mat is null");
                }
                vRC_Scene.DynamicMaterials.Add(mat);
            }
            else
            {
                Debug.Log("end mat");

                break;
            }
        }


        Material mat1 = Resources.Load(re_path + "/p0" + sp_path[sp_path.Length - 2]) as Material;
        Material mat2 = Resources.Load(re_path + "/p1" + sp_path[sp_path.Length - 2]) as Material;

        String R_con_name = R_Bar.name;
        String L_con_name = L_Bar.name;

        R_page.GetComponent <Renderer>().material = mat1;
        L_page.GetComponent <Renderer>().material = mat2;

        GameObject R_con_pac = new GameObject();

        R_con_pac.name                    = "R_con_pac";
        R_con_pac.transform.parent        = R_Bar.transform.parent;
        R_con_pac.transform.localPosition = new Vector3(0, 0, 0);
        R_con_pac.transform.localRotation = new Quaternion(0, 0, 0, 0);
        R_con_pac.transform.localScale    = new Vector3(1, 1, 1);
        //R_Bar.transform.parent = R_con_pac.transform;
        R_Bar.SetActive(false);


        GameObject L_con_pac = new GameObject();

        L_con_pac.name                    = "L_con_pac";
        L_con_pac.transform.parent        = L_Bar.transform.parent;
        L_con_pac.transform.localPosition = new Vector3(0, 0, 0);
        L_con_pac.transform.localRotation = new Quaternion(0, 0, 0, 0);
        L_con_pac.transform.localScale    = new Vector3(1, 1, 1);
        //L_Bar.transform.parent = L_con_pac.transform;
        L_Bar.SetActive(false);


        /*ページ遷移イベント取得まで
         * 前提としてTriggerのEventsの
         * 0に右ページ
         * 1に左ページ
         * 2に右のコントロールバー入れ替え
         * 3に左のコントロールバー入れ替え
         * をが入っている
         */


        for (int i = 0; ; i++) //右コントローラー作成
        {
            Debug.Log("Rpage" + (2 * i) + "_" + 2 * i);
            if (File.Exists(path + "/p" + (i * 2) + sp_path[sp_path.Length - 2] + ".mat"))
            {
                Debug.Log(path + "/p" + (i * 2) + sp_path[sp_path.Length - 2] + ".mat" + " true");
            }
            else
            {
                Debug.Log(path + "/p" + (i * 2) + sp_path[sp_path.Length - 2] + ".mat" + " false");
                break;
            }

            R_con.Add(Instantiate(R_Bar) as GameObject);

            R_con[i].name = "R_con_" + (2 * i) + "_" + (2 * i + 1);
            Debug.Log("リネーム");
            R_con[i].transform.parent = R_con_pac.transform;
            Debug.Log("親変更");
            R_con[i].transform.localPosition = R_Bar.transform.localPosition;
            R_con[i].transform.localRotation = R_Bar.transform.localRotation;
            R_con[i].transform.localScale    = R_Bar.transform.localScale;
            Debug.Log("トランスフォーム調整");

            VRCSDK2.VRC_Trigger R_bar_trg = R_con[i].GetComponent(typeof(VRCSDK2.VRC_Trigger)) as VRCSDK2.VRC_Trigger;
            if (R_bar_trg == null)
            {
                Debug.Log("トリガーが無いが");
                R_bar_trg = R_con[i].AddComponent <VRCSDK2.VRC_Trigger>();
            }

            Debug.Log("トリガー取得");
            VRCSDK2.VRC_Trigger.TriggerEvent r_trg = new VRCSDK2.VRC_Trigger.TriggerEvent();
            Debug.Log("トリガーイベント作成");

            R_bar_trg.interactText = R_con_name;

            R_bar_trg.Triggers.Add(r_trg);
            Debug.Log("トリガーイベント追加");

            r_trg.TriggerType = VRCSDK2.VRC_Trigger.TriggerType.OnInteract;

            VRCSDK2.VRC_EventHandler.VrcEvent evr = new VRCSDK2.VRC_EventHandler.VrcEvent();
            VRCSDK2.VRC_EventHandler.VrcEvent evl = new VRCSDK2.VRC_EventHandler.VrcEvent();

            Debug.Log("イベントインスタンス作成");
            if (local)
            {
                r_trg.BroadcastType = VRCSDK2.VRC_EventHandler.VrcBroadcastType.Local;      //GUIから切り変えれるように
            }
            evr.EventType = VRCSDK2.VRC_EventHandler.VrcEventType.SetMaterial;
            evl.EventType = VRCSDK2.VRC_EventHandler.VrcEventType.SetMaterial;

            Debug.Log("イベントタイプ指定");

            evr.ParameterString = path + "/p" + (i * 2) + sp_path[sp_path.Length - 2] + ".mat";
            evr.ParameterObject = R_page;  //ここに右ページオブジェクト

            Debug.Log("右ページマテリアル指定");

            evl.ParameterString = path + "/p" + (i * 2 + 1) + sp_path[sp_path.Length - 2] + ".mat";
            evl.ParameterObject = L_page;

            Debug.Log("左ページマテリアル指定");


            r_trg.Events.Add(evr);
            r_trg.Events.Add(evl);
        }

        for (int i = 0; ; i++)
        {
                               //左コントローラー作成
            {
                Debug.Log("Lpage" + (2 * i) + "_" + 2 * i);
                if (File.Exists(path + "/p" + (i * 2) + sp_path[sp_path.Length - 2] + ".mat"))
                {
                    Debug.Log(path + "/p" + (i * 2) + sp_path[sp_path.Length - 2] + ".mat" + " true");
                }
                else
                {
                    Debug.Log(path + "/p" + (i * 2) + sp_path[sp_path.Length - 2] + ".mat" + " false");
                    break;
                }

                L_con.Add(Instantiate(L_Bar) as GameObject);

                L_con[i].name = "L_con_" + (2 * i) + "_" + (2 * i + 1);
                Debug.Log("リネーム");
                L_con[i].transform.parent = L_con_pac.transform;
                Debug.Log("親変更");
                L_con[i].transform.localPosition = L_Bar.transform.localPosition;
                L_con[i].transform.localRotation = L_Bar.transform.localRotation;
                L_con[i].transform.localScale    = L_Bar.transform.localScale;
                Debug.Log("トランスフォーム調整");

                VRCSDK2.VRC_Trigger L_bar_trg = L_con[i].GetComponent(typeof(VRCSDK2.VRC_Trigger)) as VRCSDK2.VRC_Trigger;
                Debug.Log("トリガー取得");
                if (L_bar_trg == null)
                {
                    Debug.Log("トリガーが無いが");
                    L_bar_trg = L_con[i].AddComponent <VRCSDK2.VRC_Trigger>();
                }

                L_bar_trg.interactText = L_con_name;


                VRCSDK2.VRC_Trigger.TriggerEvent l_trg = new VRCSDK2.VRC_Trigger.TriggerEvent();
                Debug.Log("トリガーイベント作成");

                L_bar_trg.Triggers.Add(l_trg);
                Debug.Log("トリガーイベント追加");

                l_trg.TriggerType = VRCSDK2.VRC_Trigger.TriggerType.OnInteract;

                VRCSDK2.VRC_EventHandler.VrcEvent evr = new VRCSDK2.VRC_EventHandler.VrcEvent();
                VRCSDK2.VRC_EventHandler.VrcEvent evl = new VRCSDK2.VRC_EventHandler.VrcEvent();

                Debug.Log("イベントインスタンス作成");
                if (local)
                {
                    l_trg.BroadcastType = VRCSDK2.VRC_EventHandler.VrcBroadcastType.Local;    //GUIから切り変えれるように
                }
                evr.EventType = VRCSDK2.VRC_EventHandler.VrcEventType.SetMaterial;
                evl.EventType = VRCSDK2.VRC_EventHandler.VrcEventType.SetMaterial;

                Debug.Log("イベントタイプ指定");

                evr.ParameterString = path + "/p" + (i * 2) + sp_path[sp_path.Length - 2] + ".mat";
                evr.ParameterObject = R_page; //ここに右ページオブジェクト

                Debug.Log("右ページマテリアル指定");

                evl.ParameterString = path + "/p" + (i * 2 + 1) + sp_path[sp_path.Length - 2] + ".mat";
                evl.ParameterObject = L_page;

                Debug.Log("左ページマテリアル指定");


                l_trg.Events.Add(evr);
                l_trg.Events.Add(evl);
            }
        }

        Debug.Log("オブジェクト作成終了");
        Debug.Log("遷移システム開始");

        if (gimic)
        {
            GameObject Gimic_pac = new GameObject();
            Gimic_pac.name                    = "Gimic_pac";
            Gimic_pac.transform.parent        = L_Bar.transform.parent;
            Gimic_pac.transform.localPosition = new Vector3(0, 0, 0);
            Gimic_pac.transform.localRotation = new Quaternion(0, 0, 0, 0);
            Gimic_pac.transform.localScale    = new Vector3(1, 1, 1);
            //L_Bar.transform.parent = L_con_pac.transform;

            for (int i = 0; i < R_con.Count; i++)
            {
                Gimic_List.Add(new GameObject());
                Gimic_List[i].name = "p" + (i * 2) + "_" + (i * 2 + 1);
                Gimic_List[i].transform.localScale    = new Vector3(1, 1, 1);
                Gimic_List[i].transform.parent        = Gimic_pac.transform;
                Gimic_List[i].transform.localPosition = new Vector3(0, 0, 0);
                Gimic_List[i].transform.localRotation = new Quaternion(0, 0, 0, 0);

                if (i != 0)
                {
                    Gimic_List[i].SetActive(false);
                }
            }
        }


        Debug.Log("R_con表示設定");
        for (int i = 0; i < R_con.Count; i++) //右コン操作 戻る操作()
        {
            VRCSDK2.VRC_Trigger trg = R_con[i].GetComponent <VRCSDK2.VRC_Trigger>();
            VRCSDK2.VRC_Trigger.TriggerEvent intract = new VRCSDK2.VRC_Trigger.TriggerEvent();

            Debug.Log("トリガーインスタンス作成");


            intract.TriggerType = VRCSDK2.VRC_Trigger.TriggerType.OnInteract;
            Debug.Log("トリガータイプ指定");

            if (local)
            {
                intract.BroadcastType = VRCSDK2.VRC_EventHandler.VrcBroadcastType.Local;        //GUIから切り替えれるように
            }
            VRCSDK2.VRC_EventHandler.VrcEvent r_next = new VRCSDK2.VRC_EventHandler.VrcEvent();
            VRCSDK2.VRC_EventHandler.VrcEvent r_pre  = new VRCSDK2.VRC_EventHandler.VrcEvent();
            VRCSDK2.VRC_EventHandler.VrcEvent l_next = new VRCSDK2.VRC_EventHandler.VrcEvent();
            VRCSDK2.VRC_EventHandler.VrcEvent l_pre  = new VRCSDK2.VRC_EventHandler.VrcEvent();
            Debug.Log("イベントインスタンス作成");


            r_next.EventType = VRCSDK2.VRC_EventHandler.VrcEventType.SetGameObjectActive;
            r_pre.EventType  = VRCSDK2.VRC_EventHandler.VrcEventType.SetGameObjectActive;
            l_next.EventType = VRCSDK2.VRC_EventHandler.VrcEventType.SetGameObjectActive;
            l_pre.EventType  = VRCSDK2.VRC_EventHandler.VrcEventType.SetGameObjectActive;
            Debug.Log("イベントタイプ指定");


            r_next.ParameterBoolOp = VRCSDK2.VRC_EventHandler.VrcBooleanOp.True;
            r_pre.ParameterBoolOp  = VRCSDK2.VRC_EventHandler.VrcBooleanOp.False;
            l_next.ParameterBoolOp = VRCSDK2.VRC_EventHandler.VrcBooleanOp.True;
            l_pre.ParameterBoolOp  = VRCSDK2.VRC_EventHandler.VrcBooleanOp.False;
            Debug.Log("Bool設定");

            //戻るボタンで戻った先がi r_next i-1 l_next i+1 r_pre i l_pre i+2

            Debug.Log("r_next");
            if (i > 0)
            {
                r_next.ParameterObject = R_con[i - 1];
            }

            Debug.Log("r_pre");
            r_pre.ParameterObject = R_con[i];

            Debug.Log("l_next");
            if (i < L_con.Count - 1)
            {
                l_next.ParameterObject = L_con[i + 1];
            }

            Debug.Log("l_pre");
            if (i < L_con.Count - 2)
            {
                l_pre.ParameterObject = L_con[i + 2];
            }
            Debug.Log("遷移先指定");


            if (i > 0)
            {
                intract.Events.Add(r_next);
            }
            intract.Events.Add(r_pre);
            if (i < L_con.Count - 1)
            {
                intract.Events.Add(l_next);
            }
            if (i < L_con.Count - 2)
            {
                intract.Events.Add(l_pre);
            }
            if (gimic)  //ギミック出し入れ部分
            {
                VRCSDK2.VRC_EventHandler.VrcEvent G_next = new VRCSDK2.VRC_EventHandler.VrcEvent();
                VRCSDK2.VRC_EventHandler.VrcEvent G_pre  = new VRCSDK2.VRC_EventHandler.VrcEvent();

                G_next.EventType = VRCSDK2.VRC_EventHandler.VrcEventType.SetGameObjectActive;
                G_pre.EventType  = VRCSDK2.VRC_EventHandler.VrcEventType.SetGameObjectActive;

                G_next.ParameterBoolOp = VRCSDK2.VRC_EventHandler.VrcBooleanOp.True;
                G_pre.ParameterBoolOp  = VRCSDK2.VRC_EventHandler.VrcBooleanOp.False;

                Debug.Log("G_next");
                G_next.ParameterObject = Gimic_List[i];

                Debug.Log("G_pre");
                if (i < Gimic_List.Count - 1)
                {
                    G_pre.ParameterObject = Gimic_List[i + 1];
                }

                intract.Events.Add(G_pre);
                intract.Events.Add(G_next);
            }
            Debug.Log("イベント割り当て");


            trg.Triggers.Add(intract);
            Debug.Log("トリガー割り当て");
        }
        Debug.Log("L_con表示設定");

        for (int i = 0; i < R_con.Count; i++) //左コン操作
        {
            VRCSDK2.VRC_Trigger trg = L_con[i].GetComponent <VRCSDK2.VRC_Trigger>();
            VRCSDK2.VRC_Trigger.TriggerEvent intract = new VRCSDK2.VRC_Trigger.TriggerEvent();

            Debug.Log("トリガーインスタンス作成");


            intract.TriggerType = VRCSDK2.VRC_Trigger.TriggerType.OnInteract;
            Debug.Log("トリガータイプ指定");
            if (local)
            {
                intract.BroadcastType = VRCSDK2.VRC_EventHandler.VrcBroadcastType.Local;        //GUIから切り替えれるように
            }
            VRCSDK2.VRC_EventHandler.VrcEvent r_next = new VRCSDK2.VRC_EventHandler.VrcEvent();
            VRCSDK2.VRC_EventHandler.VrcEvent r_pre  = new VRCSDK2.VRC_EventHandler.VrcEvent();
            VRCSDK2.VRC_EventHandler.VrcEvent l_next = new VRCSDK2.VRC_EventHandler.VrcEvent();
            VRCSDK2.VRC_EventHandler.VrcEvent l_pre  = new VRCSDK2.VRC_EventHandler.VrcEvent();
            Debug.Log("イベントインスタンス作成");


            r_next.EventType = VRCSDK2.VRC_EventHandler.VrcEventType.SetGameObjectActive;
            r_pre.EventType  = VRCSDK2.VRC_EventHandler.VrcEventType.SetGameObjectActive;
            l_next.EventType = VRCSDK2.VRC_EventHandler.VrcEventType.SetGameObjectActive;
            l_pre.EventType  = VRCSDK2.VRC_EventHandler.VrcEventType.SetGameObjectActive;
            Debug.Log("イベントタイプ指定");


            r_next.ParameterBoolOp = VRCSDK2.VRC_EventHandler.VrcBooleanOp.True;
            r_pre.ParameterBoolOp  = VRCSDK2.VRC_EventHandler.VrcBooleanOp.False;
            l_next.ParameterBoolOp = VRCSDK2.VRC_EventHandler.VrcBooleanOp.True;
            l_pre.ParameterBoolOp  = VRCSDK2.VRC_EventHandler.VrcBooleanOp.False;
            Debug.Log("Bool設定");

            //進むボタン 進んだ先がiだからnextはrがi-1 lがi+1 preはrがi-2 lがi
            Debug.Log("r_next");
            if (i > 0)
            {
                r_next.ParameterObject = R_con[i - 1];
            }

            Debug.Log("r_pre");
            if (i > 1)
            {
                r_pre.ParameterObject = R_con[i - 2];
            }

            Debug.Log("l_next");
            if (i < L_con.Count - 1)
            {
                l_next.ParameterObject = L_con[i + 1];
            }

            Debug.Log("l_pre");
            l_pre.ParameterObject = L_con[i];
            Debug.Log("遷移先指定");

            if (i > 0)
            {
                intract.Events.Add(r_next);
            }
            if (i > 1)
            {
                intract.Events.Add(r_pre);
            }
            if (i < L_con.Count - 1)
            {
                intract.Events.Add(l_next);
            }
            intract.Events.Add(l_pre);
            if (gimic)  //ギミック出し入れ部分
            {
                VRCSDK2.VRC_EventHandler.VrcEvent G_next = new VRCSDK2.VRC_EventHandler.VrcEvent();
                VRCSDK2.VRC_EventHandler.VrcEvent G_pre  = new VRCSDK2.VRC_EventHandler.VrcEvent();

                G_next.EventType = VRCSDK2.VRC_EventHandler.VrcEventType.SetGameObjectActive;
                G_pre.EventType  = VRCSDK2.VRC_EventHandler.VrcEventType.SetGameObjectActive;

                G_next.ParameterBoolOp = VRCSDK2.VRC_EventHandler.VrcBooleanOp.True;
                G_pre.ParameterBoolOp  = VRCSDK2.VRC_EventHandler.VrcBooleanOp.False;

                Debug.Log("G_next");
                G_next.ParameterObject = Gimic_List[i];

                Debug.Log("G_pre");
                if (0 < i)
                {
                    G_pre.ParameterObject = Gimic_List[i - 1];
                }

                intract.Events.Add(G_next);
                intract.Events.Add(G_pre);
            }
            Debug.Log("イベント割り当て");


            trg.Triggers.Add(intract);
            Debug.Log("トリガー割り当て");
        }

        L_con[1].SetActive(true);
        Debug.Log(L_con.Count * 2 + "ページ");
    }
    void OnGUIScene_KawaAlt(VRCSDK2.VRC_SceneDescriptor scene)
    {
        string lastUrl          = VRC_SdkBuilder.GetLastUrl();
        bool   lastBuildPresent = lastUrl != null;

        EditorGUILayout.Space();

        using (new GUILayout.HorizontalScope(boxGuiStyle, GUILayout.Width(this.position.width)))
        {
            using (new GUILayout.VerticalScope())
            {
                GUILayout.Label("Offline Testing", infoGuiStyle);
                numClients = EditorGUILayout.IntField("Number of Clients", numClients);

                var lb_enabled = (GUIErrors.Count == 0 && checkedForIssues) && lastBuildPresent;
                using (new EditorGUI.DisabledScope(!lb_enabled))
                {
                    if (GUILayout.Button("Last Build"))
                    {
                        VRC_SdkBuilder.shouldBuildUnityPackage = false;
                        VRC_SdkBuilder.numClientsToLaunch      = numClients;
                        VRC_SdkBuilder.RunLastExportedSceneResource();
                    }
                    if (GUILayout.Button("Copy Test URL"))
                    {
                        TextEditor te = new TextEditor();
                        te.text = lastUrl;
                        te.SelectAll();
                        te.Copy();
                    }
                }

                var bt_enabled = (GUIErrors.Count == 0 && checkedForIssues) || APIUser.CurrentUser.developerType == APIUser.DeveloperType.Internal;
                using (new EditorGUI.DisabledScope(!bt_enabled))
                {
                    if (GUILayout.Button("Build & Test"))
                    {
                        EnvConfig.ConfigurePlayerSettings();
                        VRC_SdkBuilder.shouldBuildUnityPackage = false;
                        VRC.AssetExporter.CleanupUnityPackageExport();  // force unity package rebuild on next publish
                        VRC_SdkBuilder.numClientsToLaunch = numClients;
                        VRC_SdkBuilder.PreBuildBehaviourPackaging();
                        VRC_SdkBuilder.ExportSceneResourceAndRun(customNamespace);
                    }
                }
            }
            using (var vs2 = new GUILayout.VerticalScope())
            {
                GUILayout.Label("Online Publishing", infoGuiStyle);

                using (new EditorGUI.DisabledScope(!lastBuildPresent))
                {
                    if (GUILayout.Button("Last Build"))
                    {
                        if (APIUser.CurrentUser.canPublishWorlds)
                        {
                            VRC_SdkBuilder.shouldBuildUnityPackage = VRCSdkControlPanel.FutureProofPublishEnabled;
                            VRC_SdkBuilder.UploadLastExportedSceneBlueprint();
                        }
                        else
                        {
                            ShowContentPublishPermissionsDialog();
                        }
                    }
                }

                var bp_nabled = (GUIErrors.Count == 0 && checkedForIssues) || APIUser.CurrentUser.developerType == APIUser.DeveloperType.Internal;
                using (new EditorGUI.DisabledScope(!bp_nabled))
                {
                    if (GUILayout.Button("Build & Publish"))
                    {
                        if (APIUser.CurrentUser.canPublishWorlds)
                        {
                            EnvConfig.ConfigurePlayerSettings();
                            VRC_SdkBuilder.shouldBuildUnityPackage = VRCSdkControlPanel.FutureProofPublishEnabled;
                            VRC_SdkBuilder.PreBuildBehaviourPackaging();
                            VRC_SdkBuilder.ExportAndUploadSceneBlueprint(customNamespace);
                        }
                        else
                        {
                            ShowContentPublishPermissionsDialog();
                        }
                    }
                }
            }
        }
    }