コード例 #1
0
        void ApplyShot(int index)
        {
            if (index > Storage.shots.Count)
            {
                return;
            }

            ShotManager.ApplyShot(Storage.shots[index - 1], Storage);
        }
コード例 #2
0
        public static void PreWarm(ShotObject shotObj)
        {
            if (shotObj == null || shotObj.shots.Count <= 0)
            {
                return;
            }

            var shots = shotObj.shots;

            for (int i = shots.Count - 1; i >= 0; i--)
            {
                ShotManager.ApplyShot(shots[i], shotObj);

                var selections = shots[i].selectedObjs;
                for (int j = selections.Count - 1; j >= 0; j--)
                {
                    ShotManager.ApplySelection(selections[j].SelectedObj);
                }
            }
        }
コード例 #3
0
        void RenderShotInspector()
        {
            _v = EditorGUILayout.BeginScrollView(_v);
            foreach (var shot in Storage.shots)
            {
                if (GUILayout.Button(shot.name))
                {
                    ShotManager.ApplyShot(shot, Storage);
                }

                //Render selection buttons
                if (shot.selectedObjs.Count > 0)
                {
                    GUILayout.BeginHorizontal();
                    GUILayout.Label("Selections: ", GUILayout.Width(80));
                    GUILayout.BeginVertical();
                    GUILayout.BeginHorizontal();
                    for (int i = 0; i < shot.selectedObjs.Count; i++)
                    {
                        if (i != 0 && i % 2 == 0)
                        {
                            GUILayout.EndHorizontal();
                            GUILayout.BeginHorizontal();
                        }

                        if (GUILayout.Button(shot.selectedObjs[i].name, GUILayout.Width(105)))
                        {
                            ShotManager.ApplySelection(shot.selectedObjs[i].SelectedObj);
                        }
                    }
                    GUILayout.EndHorizontal();
                    GUILayout.EndVertical();
                    GUILayout.EndHorizontal();
                }
                GUILayout.Space(10);
            }
            EditorGUILayout.EndScrollView();
        }