コード例 #1
0
 Cam_Status_Holder GetCurrentStatus()
 {
     Cam_Status nSpace = new Cam_Status(space);
     Cam_Status nJungle = new Cam_Status(jungle);
     Cam_Status nJapan = new Cam_Status(japan);
     Cam_Status nViking = new Cam_Status(viking);
     Cam_Status_Holder nHolder = new Cam_Status_Holder(nSpace, nJungle, nJapan, nViking, ScreenLayout.DEFAULT);
     return nHolder;
 }
コード例 #2
0
 IEnumerator MotionDuration()
 {
     yield return new WaitForSeconds(2f);
     mDel -= MoveSpace;
     mDel -= MoveJungle;
     mDel -= MoveJapan;
     mDel -= MoveViking;
     currentStatus = GetCurrentStatus();
     testingInt++;
 }
コード例 #3
0
 public void CreateNewLayout(Cam_Status_Holder cStat)
 {
     screenStatuses.Add(cStat);
 }
コード例 #4
0
 void Awake()
 {
     currentStatus = GetCurrentStatus();
 }
コード例 #5
0
    public override void OnInspectorGUI()
    {
        Cam_ScreenMover cScreenM = (Cam_ScreenMover)target;
        InitStyles();
        if (!stylesInit)
        {
            InitStyles();
            stylesInit = true;
        }

        cameraAttachMenu = EditorGUILayout.Foldout(cameraAttachMenu, cameraAttachMenuString);
        if (cameraAttachMenu)
        {
            cameraAttachMenuString = "Hide Cameras";
            EditorGUILayout.BeginVertical(palletLightBox);
            EditorGUILayout.LabelField("Space Camera", EditorStyles.boldLabel);
            cScreenM.space = EditorGUILayout.ObjectField(cScreenM.space, typeof(Camera), true) as Camera;
            EditorGUILayout.LabelField("Jungle Camera", EditorStyles.boldLabel);
            cScreenM.jungle = EditorGUILayout.ObjectField(cScreenM.jungle, typeof(Camera), true) as Camera;
            EditorGUILayout.LabelField("Japan Camera", EditorStyles.boldLabel);
            cScreenM.japan = EditorGUILayout.ObjectField(cScreenM.japan, typeof(Camera), true) as Camera;
            EditorGUILayout.LabelField("Viking Camera", EditorStyles.boldLabel);
            cScreenM.viking = EditorGUILayout.ObjectField(cScreenM.viking, typeof(Camera), true) as Camera;
            GUILayout.Space(10);
            EditorGUILayout.EndVertical();
        }
        else
        {
            cameraAttachMenuString = "Show Cameras";
        }

        if (cScreenM.space == null || cScreenM.jungle == null || cScreenM.japan == null || cScreenM.viking == null)
        {
            return;//Can only edit with all camera assigned.
        }
        //--

        //Section to edit current selected.

        newLayoutMenu = EditorGUILayout.Foldout(newLayoutMenu, newLayoutMenuString);
        if (newLayoutMenu)
        {
            newLayoutMenuString = "Hide Layout creation Menu.";
            EditorGUILayout.BeginVertical(palletDarkBox);
                EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.LabelField("Select Type of Layout: ", EditorStyles.boldLabel, GUILayout.MaxWidth(1000f));
                    newCam_Layout = EditorGUILayout.Popup("", newCam_Layout, optionsLayout, GUILayout.Width(200f));
                EditorGUILayout.EndHorizontal();
                EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.LabelField("Based on Cameras Layouts.", EditorStyles.helpBox, GUILayout.MaxWidth(1000f));
                    if (GUILayout.Button("Create Layout", GUILayout.Width(200f), GUILayout.Height(40f)))
                    {
                        Cam_Status nSpace = new Cam_Status(cScreenM.space);
                        Cam_Status nJungle = new Cam_Status(cScreenM.jungle);
                        Cam_Status nJapan = new Cam_Status(cScreenM.japan);
                        Cam_Status nViking = new Cam_Status(cScreenM.viking);
                        Cam_Status_Holder nHolder = new Cam_Status_Holder(nSpace, nJungle, nJapan, nViking, (ScreenLayout)newCam_Layout);
                        cScreenM.CreateNewLayout(nHolder);

                        selectedLayout = cScreenM.screenStatuses.Count - 1;

                    }
                EditorGUILayout.EndHorizontal();
            EditorGUILayout.EndVertical();
            ///Current Layout
            EditorGUILayout.BeginVertical(palletLightestBox);
            cScreenM.space.rect = EditorGUILayout.RectField(cScreenM.space.name, cScreenM.space.rect);
            cScreenM.space.depth = EditorGUILayout.FloatField("Camera Dept: ", cScreenM.space.depth, GUILayout.Width(270f));
            EditorGUILayout.EndVertical();

            EditorGUILayout.BeginVertical(palletLightestBox);
            cScreenM.jungle.rect = EditorGUILayout.RectField(cScreenM.jungle.name, cScreenM.jungle.rect);
            cScreenM.jungle.depth = EditorGUILayout.FloatField("Camera Dept: ", cScreenM.jungle.depth, GUILayout.Width(270f));
            EditorGUILayout.EndVertical();

            EditorGUILayout.BeginVertical(palletLightestBox);
            cScreenM.japan.rect = EditorGUILayout.RectField(cScreenM.japan.name, cScreenM.japan.rect);
            cScreenM.japan.depth = EditorGUILayout.FloatField("Camera Dept: ", cScreenM.japan.depth, GUILayout.Width(270f));
            EditorGUILayout.EndVertical();

            EditorGUILayout.BeginVertical(palletLightestBox);
            cScreenM.viking.rect = EditorGUILayout.RectField(cScreenM.viking.name, cScreenM.viking.rect);
            cScreenM.viking.depth = EditorGUILayout.FloatField("Camera Dept: ", cScreenM.viking.depth, GUILayout.Width(270f));
            EditorGUILayout.EndVertical();
            if (GUILayout.Button("Remove Current", GUILayout.Width(200f), GUILayout.Height(40f)))
            {
                cScreenM.RemoveAt( cScreenM.screenStatuses.Count - 1);

            }
            ///Current Layout
            ///

        }
        else
        {
            newLayoutMenuString = "Show Layout creation Menu.";
        }

        layoutSelectorMenu = EditorGUILayout.Foldout(layoutSelectorMenu, layoutSelectorString);
        if (cScreenM.screenStatuses.Count == 0)
        {
            EditorGUILayout.LabelField("No layout defined. Click <Create Layout> button to start.", EditorStyles.boldLabel);
            return;
        }
        else if(layoutSelectorMenu)
        {
            layoutSelectorString = "Hide Layouts.";
            int[] layoutTypeCount = new int[(int)ScreenLayout.COUNT];
            string[] selectionGridStatuses = new string[cScreenM.screenStatuses.Count];

            for (int i = 0; i < cScreenM.screenStatuses.Count; i++)
            {
                layoutTypeCount[(int)cScreenM.screenStatuses[i].layout]++;
                selectionGridStatuses[i] = cScreenM.screenStatuses[i].layout.ToString() + "  # " + layoutTypeCount[(int)cScreenM.screenStatuses[i].layout];
            }

            selectedLayout = GUILayout.SelectionGrid(selectedLayout, selectionGridStatuses, 2);

            layoutNumber = 0;
            for (int j = 0; j <= selectedLayout; j++)
            {
                if (cScreenM.screenStatuses[selectedLayout].layout == cScreenM.screenStatuses[j].layout)
                {
                    layoutNumber++;
                }
            }
        }
        else if (!layoutSelectorMenu)
        {
            layoutSelectorString = "Show Layouts.";
        }
        //Displays the selected layout.
        EditorGUILayout.LabelField("Total Layouts: " + cScreenM.screenStatuses.Count, EditorStyles.boldLabel);
        GUILayout.Space(20);

        EditorGUILayout.BeginVertical(palletLightBox);
        EditorGUILayout.RectField(cScreenM.space.name, cScreenM.screenStatuses[selectedLayout].space.rect);
        EditorGUILayout.FloatField("Camera Dept: ", cScreenM.space.depth, GUILayout.MaxWidth(250f));
        EditorGUILayout.EndVertical();

        EditorGUILayout.BeginVertical(palletLightBox);
        EditorGUILayout.RectField(cScreenM.jungle.name, cScreenM.screenStatuses[selectedLayout].jungle.rect);
        EditorGUILayout.FloatField("Camera Dept: ", cScreenM.jungle.depth, GUILayout.MaxWidth(250f));
        EditorGUILayout.EndVertical();

        EditorGUILayout.BeginVertical(palletLightBox);
        EditorGUILayout.RectField(cScreenM.japan.name, cScreenM.screenStatuses[selectedLayout].japan.rect);
        EditorGUILayout.FloatField("Camera Dept: ", cScreenM.japan.depth, GUILayout.MaxWidth(250f));
        EditorGUILayout.EndVertical();

        EditorGUILayout.BeginVertical(palletLightBox);
        EditorGUILayout.RectField(cScreenM.viking.name, cScreenM.screenStatuses[selectedLayout].viking.rect);
        EditorGUILayout.FloatField("Camera Dept: ", cScreenM.viking.depth, GUILayout.MaxWidth(250f));
        EditorGUILayout.EndVertical();
        //---------------------------
    }