Пример #1
0
        ///////////////////////////////////////////////////////////////////////
        //###################################################################//
        //###################################################################//
        //###################################################################//
        ///////////////////////////////////////////////////////////////////////
        //OnSceneGUI()

        //Handles.Slider(_Line.Base.transform.position, _Line.Tangent);



        ///////////////////////////////////////////////////////////////////////
        //###################################################################//
        //###################################################################//
        //###################################################################//
        ///////////////////////////////////////////////////////////////////////
        //static //OnSceneGUI()

        /// <summary>
        /// 스테이션의 시작 중점을 보여주는 용도
        /// </summary>
        static public void DrawMarkerPostion(ref RF_Linker_Station station)
        {
            Handles.color = Color.green;

            Handles.DrawWireDisc(station.transform.position, Vector3.up, ConstValue.PointRadius);
            Handles.DrawLine(station.transform.position, station.transform.position + (Vector3.up * ConstValue.PointHeight));
        }
Пример #2
0
        public RF_Linker_Path AddPath(ref RF_Linker_Station _Station)
        {
            RF_Linker_Path temp_Path = AddPath();

            temp_Path.Next = _Station.AddPath(ref temp_Path);
            return(temp_Path);
        }
Пример #3
0
 private void OnSceneGUI()
 {
     RF_Linker_Station station = target as RF_Linker_Station;
     {
         DrawMarkerPostion(ref station);
         DrawPathLines(ref station, DrawMode.Curve);
     }
 }
Пример #4
0
 /// <summary>
 /// 포인트를 선택했을때 이동하는 길들을 보여주는 용도
 /// </summary>
 static public void DrawPathLines(ref RF_Linker_Station station, DrawMode _mode)
 {
     for (int iter = 1; iter < station.transform.childCount; ++iter)
     {
         var TempLine = station.transform.GetChild(iter).GetComponent <RF_Linker_Path>();
         if (TempLine && TempLine.Next)
         {
             Linker_Path_Editor.DrawPathData(ref TempLine, _mode, "Path:" + iter);
         }
     }
 }
Пример #5
0
 /// <summary>
 /// 공간을 주고 그곳에 있을경우 추가
 /// </summary>
 void AddPath_Button(ref RF_Linker_Station station)
 {
     EditorGUILayout.BeginHorizontal();
     {
         addStationTarget = (RF_Linker_Station)EditorGUILayout.ObjectField("TargetStation", addStationTarget, typeof(RF_Linker_Station), true);
         EditorGUI.BeginDisabledGroup(!addStationTarget);
         {
             if (GUILayout.Button("ADD Path"))
             {
                 EditorUtility.SetDirty(station.AddPath(ref addStationTarget));
                 addStationTarget = null;
             }
         }
         EditorGUI.EndDisabledGroup();
     }
     EditorGUILayout.EndHorizontal();
 }
Пример #6
0
        /// <summary>
        /// 스테이션을 추가
        /// </summary>
        public RF_Linker_Station AddStation()
        {
            // AssetDatabase.FindAssets(); 검증하고 싶을때에는 추가
            RF_Linker_Station temp_Station =
                ((GameObject)PrefabUtility.InstantiatePrefab(
                     AssetDatabase.LoadAssetAtPath(
                         localPath
                         , typeof(GameObject))
                     )).GetComponent <RF_Linker_Station>();

            temp_Station.transform.SetParent(transform.parent);
            temp_Station.transform.position = transform.position;
            temp_Station.name = temp_Station.name + transform.parent.childCount;
            AddPath(ref temp_Station);

            Selection.activeGameObject = temp_Station.gameObject;
            return(temp_Station);
        }
Пример #7
0
        private void Action()
        {
            if (!CurrentPath)
            {
                return;
            }
            ElapsedTime += Time.deltaTime;

            NormalScalar = ElapsedTime * MultiplyValue * Speed;

            transform.position = CurrentPath.PathIntrpPoint(NormalScalar);

            if (NormalScalar >= 1 || MultiplyValue <= 0)
            {
                CurrentStation = CurrentPath.Next.BelongStation;
                CurrentPath    = null;
                InAction       = false;
            }
        }
Пример #8
0
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();
            RF_Linker_Station station = target as RF_Linker_Station;

            {
                {
                    EditorGUILayout.Space();
                    EditorGUILayout.LabelField("※ RailFollower - Link Create");

                    if (GUILayout.Button("ADD Station & Path"))
                    {
                        station.AddStation();
                    }

                    AddPath_Button(ref station);

                    EditorGUILayout.LabelField("", GUI.skin.horizontalSlider);

                    EditorGUILayout.TextArea("", GUI.skin.horizontalSlider);
                }
            }
            AssetDatabase.SaveAssets();
        }