Beispiel #1
0
        /// <summary>
        /// Get attached ItaskInfoCollectionLoader, which must be attached to the
        /// same game object.
        /// </summary>
        public override void Awake()
        {
            MmLogger.LogApplication("MmTaskManager Awake");

            taskInfoCollectionLoader = GetComponent <ITaskInfoCollectionLoader <U> >();
            MmTaskUserData           = GetComponent <MmTaskUserConfigurator>();
        }
Beispiel #2
0
        /// <summary>
        /// Assign Global enter/exit Delegates for the MmRelaySwitchNode's FSM.
        /// </summary>
        public override void Start()
        {
            MmLogger.LogResponder("MmSwitchResponder Start");

            // Assign default responder for transitioning between MmRelayNodes
            MmRelaySwitchNode.RespondersFSM.GlobalExit += delegate
            {
                MmLogger.LogApplication("MmRelaySwitchNode GlobalExit");

                MmRelaySwitchNode.Current.MmInvoke(MmMethod.SetActive, false,
                                                   new MmMetadataBlock(MmLevelFilterHelper.Default, MmActiveFilter.All,
                                                                       default(MmSelectedFilter), MmNetworkFilter.Local));
            };

            MmRelaySwitchNode.RespondersFSM.GlobalEnter += delegate
            {
                MmLogger.LogApplication("MmRelaySwitchNode GlobalEnter");

                MmRelaySwitchNode.Current.MmInvoke(MmMethod.SetActive, true,
                                                   new MmMetadataBlock(MmLevelFilterHelper.Default, MmActiveFilter.All,
                                                                       default(MmSelectedFilter), MmNetworkFilter.Local));
            };

            base.Start();
        }
Beispiel #3
0
        /// <summary>
        /// Setup app states in derivations.
        /// Get handle to singleton instance MmGuiHandler, is present.
        /// </summary>
        public virtual void SetupAppStates()
        {
            //Todo: Remove
            MmGuiHandler = MmGuiHandler.Instance;

            MmLogger.LogApplication(gameObject.name + ": Initializing Application States.");
        }
        /// <summary>
        /// Load the data for use by deserializer.
        /// </summary>
        public override void Load()
        {
            base.Load();

            MmLogger.LogApplication("Serializing CSV");

            // TODO: Serialize XML here
        }
Beispiel #5
0
        /// <summary>
        /// Close DataHandler file/stream.
        /// </summary>
        public virtual void Close()
        {
#if UNITY_STANDALONE || UNITY_EDITOR
            Writer.Close();
#else
            Writer.Dispose();
#endif
            MmLogger.LogApplication("File closed: " + FileName);
        }
Beispiel #6
0
        /// <summary>
        /// Load file and read into data field member of class.
        /// </summary>
        public virtual void Load()
        {
            StreamReader r = File.OpenText(Path.Combine(FileLocation, FileName));

            Data = r.ReadToEnd();
#if UNITY_STANDALONE || UNITY_EDITOR
            r.Close();
#else
            r.Dispose();
#endif
            MmLogger.LogApplication("File read: " + FileName);
        }
Beispiel #7
0
        /// <summary>
        /// Open DataHandler file/stream.
        /// </summary>
        /// <param name="overwrite">Should the handler override content
        /// if file exists.</param>
        /// <returns>New File created?
        /// 0 - No
        /// 1 - Yes
        /// </returns>
        public virtual int Open(bool overwrite = false)
        {
            int newItem = 0;

#if UNITY_STANDALONE || UNITY_EDITOR
            FileInfo t = new FileInfo(Path.Combine(FileLocation, FileName));

            newItem = (!t.Exists || overwrite) ? 1 : 0;

            if (overwrite && t.Exists)
            {
                t.Delete();
                MmLogger.LogApplication("File Deleted: " + FileName);
            }
            Writer = t.AppendText();
            MmLogger.LogApplication("File opened: " + FileName);
#endif

            return(newItem);
        }
Beispiel #8
0
        /// <summary>
        /// Prepare the tasks that were loaded.
        /// </summary>
        public override void Start()
        {
            MmLogger.LogApplication("MmTaskManager Start");

            PrepareTasks();
        }