예제 #1
0
                /// <summary>
                /// Saves an escort mission to file.
                /// </summary>
                /// <param name="escort">Escort.</param>
                /// <param name="owner">Owner.</param>
                public static void SaveMissionEscortToFile(EscortObject escort, string owner)
                {
                    path = UnityEditor.EditorUtility.SaveFilePanelInProject("Save Escort Mission File As", owner.ToLower() + ".cc_escort", "cc_escort", "");

                    if (path.Length == 0)
                    {
                        return;
                    }

                    XmlSerializer serializer = new XmlSerializer(typeof(EscortObject));
                    FileStream    stream     = new FileStream(path, FileMode.Create);

                    serializer.Serialize(stream, escort);
                    stream.Close();
                }
예제 #2
0
                /// <summary>
                /// Loads an escort mission from file.
                /// </summary>
                /// <returns>The mission escort from file.</returns>
                /// <param name="escort">Escort.</param>
                public static EscortObject LoadMissionEscortFromFile(EscortObject escort)
                {
                    path = UnityEditor.EditorUtility.OpenFilePanel("Open Escort Mission File", Application.dataPath, "cc_escort");

                    if (path.Length == 0)
                    {
                        return(escort);
                    }

                    XmlSerializer serializer = new XmlSerializer(typeof(EscortObject));
                    FileStream    stream     = new FileStream(path, FileMode.Open);

                    escort = serializer.Deserialize(stream) as EscortObject;
                    stream.Close();

                    return(escort);
                }
        public void Copy(EscortObject _object)
        {
            if (_object == null)
            {
                return;
            }

            base.Copy(_object);

            DelayEscort  = _object.DelayEscort;
            DelayFollow  = _object.DelayFollow;
            DelayStandby = _object.DelayStandby;
            DelayIdle    = _object.DelayIdle;

            DurationStandby = _object.DurationStandby;

            BehaviourModeEscort  = _object.BehaviourModeEscort;
            BehaviourModeFollow  = _object.BehaviourModeFollow;
            BehaviourModeStandby = _object.BehaviourModeStandby;
            BehaviourModeIdle    = _object.BehaviourModeIdle;
        }
 public CustomMissionObject(EscortObject _object) : base(_object)
 {
     Copy(_object);
 }
 public EscortObject(EscortObject _object) : base(_object)
 {
     Copy(_object);
 }