public override void Initialise(ESTrainingAtom _atom, Action <bool> _initCallback)
        {
            data = new SuppressionTestsData();
            data.Load();

            base.Initialise(_atom, _initCallback);
        }
Exemplo n.º 2
0
 public override void Initialise(ESTrainingAtom _atom, Action <bool> _initCallback)
 {
     data = new SuppressionTestsData();
     atom = _atom;
     //base.Initialise(_atom, _initCallback);
     _initCallback(true);
 }
Exemplo n.º 3
0
        /// <summary>
        /// Initialise this instance.  This allows us to overwrite default initialisation for unit testing with mocks.
        /// </summary>
        public virtual void Initialise(ESTrainingAtom _atom, Action <bool> _initCallback)
        {
            atom = _atom;

            audioManager = AudioManager.instance;

            if (atom.molecule == "")
            {
                atom.molecule = "default";
            }
            //Fetch our default display element and it's parts
            molecule = GetMolecule(atom.molecule);

            molecule.container.SetActive(true);

            image            = GetMolecularChild(molecule, "Image");
            titleText        = GetMolecularChild(molecule, "TitleText");
            hitKeyToContinue = GetMolecularChild(molecule, "HitKeyToContinue");


            //Fetch our visualisers - Singletons so we don't keep creating destroying unless necessary.
            //voiceVisualiser = UnityVoiceVisualiser.instance;
            //subsVisualiser = UnitySubTitlesVisualiser.instance;

            //Naiive but for now, ok.
            _initCallback(true);
        }
Exemplo n.º 4
0
        public override void Initialise(ESTrainingAtom _atom, Action <bool> _initCallback)
        {
            atom = _atom;

            audioManager = AudioManager.instance;

            _initCallback(true);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Spins the atom. Asks the user whether to carry on if they wish, or start from the first atom of this day.
        ///
        /// </summary>
        /// <param name="atom">Atom.</param>
        public void Play(ESTrainingAtom atom)
        {
            //TODO: If the atom isn't the very first, we should ask if the user wishes to start from the first atom, or continue from where they are
            physics = LocatePhysics(atom);
            //We start the atom, passing it our callback hook so we know when to load the next one

            physics.Initialise(atom, PostInit);
        }
Exemplo n.º 6
0
        private int FindAtomIndex(ESTrainingAtom match, List <ESTrainingAtom> searchInAtoms)
        {
            int i = 0;

            foreach (ESTrainingAtom atom in searchInAtoms)
            {
                if (atom == match)
                {
                    return(i);
                }
                i++;
            }
            return(-1);
        }
Exemplo n.º 7
0
        public override void Initialise(ESTrainingAtom _atom, Action <bool> _initCallback)
        {
            atom = _atom;

            audioManager = AudioManager.instance;

            if (atom.molecule == "")
            {
                atom.molecule = "default";
            }
            //Fetch our default display element and it's parts
            molecule = GetMolecule(atom.molecule);

            molecule.container.SetActive(true);

            _initCallback(true);
        }
        public virtual void Initialise(ESTrainingAtom _atom, Action <bool> _initCallback)
        {
            atom = _atom;

            initCallback = _initCallback;

            //Fix our screen orientation
            Screen.orientation = ScreenOrientation.LandscapeLeft;

            //Get the audio manager
            audioManager = AudioManager.instance;

            //multiCameraController = GetMolecularChild(molecule, "MultiCamera").GetComponent<MultiCameraController>();
            multiCameraController = GameObject.Find("MultiCamera").GetComponent <MultiCameraController>();

            //Disable the 2D camera and enable the 3D camera
            multiCameraController.SwitchTo3D(InitPart2);
        }
Exemplo n.º 9
0
        private List <string> OutputLink(List <string> links, ESTrainingAtom atom, string nextStep, bool inferred)
        {
            string linkStr = "";

            if (atoms.Exists(x => x.id == nextStep))
            {
                linkStr = "\"" + atom.id + "\" -> " + "\"" + nextStep + "\"";
            }
            else
            {
                linkStr = "\"" + atom.id + "\" -> ERROR";
            }
            if (inferred)
            {
                linkStr += "[style=dashed]";
            }
            links.Add(linkStr);
            return(links);
        }
Exemplo n.º 10
0
        /// <summary>
        /// Initialises the atoms. Where were we last time? Do we want to start from the beginning?
        /// </summary>
        public void InitialiseAtoms(List <ESTrainingAtom> _atoms)
        {
            atoms = _atoms; //TODO : May want to explicitly set this e.g. from JSON before calling this method

            if (PlayerPrefs.HasKey("currentNodeID"))
            { //Are there stored settings already?
                currentNodeID        = PlayerPrefs.GetString("currentNodeID");
                currentNodeCompleted = (PlayerPrefs.GetInt("currentNodeCompleted") != 0);
                currentAtom          = FindAtom(currentNodeID, _atoms);
                if (currentAtom == null)
                {
                    InitaliseFreshStart(_atoms);
                }
                //TODO: Now we need to check that this currentNodeID exists, and if not, rollback the currentNodeID to the
            }
            else
            { //Lets initialise as this must be a first run-through
                InitaliseFreshStart(_atoms);
            }
        }
Exemplo n.º 11
0
        /// <summary>
        /// When an atom has run to completion, we receive a callback here
        /// if that atoms specifies a specific atom to transition to.
        /// </summary>
        /// <param name="_id">Identifier.</param>
        public void Atomised(string nextAtomID)
        {
            Debug.Log("Atomised callback in ContentNode - next atom specified as (" + nextAtomID + ")");

            //Shut down visualisation if it exists.
            //if (physics.Atom.visualiseVoice)
            //{
            //    UnityVoiceVisualiser.instance.StopVisualisation();
            //}

            if (nextAtomID != "")
            {
                ESTrainingAtom nextAtom = FindAtom(nextAtomID, atoms);
                if (nextAtom != null)
                {
                    currentAtom = nextAtom;
                    Play(currentAtom);
                }
                else
                {
                    Debug.Log("Could not find specified atom!" + nextAtomID);
                }
            }
            else
            {
                ESTrainingAtom nextAtom = FindNextAtom();
                if (nextAtom != null)
                {
                    currentAtom = nextAtom;
                    Play(currentAtom);
                }
                else
                {
                    Debug.Log("Ran out of Atoms");
                    Debug.Log("This is where we call back to our maker");
                    currentAtom = atoms[0];//Reset the atom to the original atom so that it becomes the restart point
                    QuitToSceneSelector();
                }
            }
        }
Exemplo n.º 12
0
        public ESTrainingAtom FindNextAtom(ESTrainingAtom searchFromAtom, List <ESTrainingAtom> searchInAtoms)
        {
            int i = -1;

            if (searchFromAtom != null)
            {
                i = FindAtomIndex(searchFromAtom, searchInAtoms);
            }
            i++;
            while (i <= atoms.Count - 1)
            {
                if (atoms[i].disableAtom != true)
                { //ignore disabled atoms
                    return(atoms[i]);
                }
                else
                {
                    i++;
                }
            }
            return(null);
        }
Exemplo n.º 13
0
        /// <summary>
        /// Look for any custom physics matching the paragraph - we might want a physics type rather than id matching
        /// </summary>
        /// <returns>The physics.</returns>
        /// <param name="atom">Atom.</param>
        public ESAtomPhysicsInterface LocatePhysics(ESTrainingAtom atom)
        {
            Type t;

            try
            {
                //Look for custom physics...
                string classname = "EyeSkills.ESAtomPhysics" + atom.preferredPhysics;
                t       = Type.GetType(classname, true);
                physics = (ESAtomPhysicsInterface)Activator.CreateInstance(t);
            }
            catch (TypeLoadException)
            {
                //This is expected behaviour
                if (atom.preferredPhysics != "")
                {
                    Debug.Log("Could not load physics [" + atom.preferredPhysics + "]");
                }
                Debug.Log("Loading default physics");
                physics = new ESTrainingDefaultPhysics();
            }

            return(physics);
        }
        //public AudioManager audioManager = new AudioManager();

        public override void Initialise(ESTrainingAtom _atom, Action <bool> _initCallback)
        {
            MultiCameraController.instance.SwitchTo3D(delegate(bool success){
                _initCallback(true);
            });
        }
Exemplo n.º 15
0
 public void Initialise(ESTrainingAtom atom, Action <bool> _initCallback)
 {
     _initCallback(true);
 }
Exemplo n.º 16
0
 public override void Initialise(ESTrainingAtom _atom, Action <bool> _initCallback)
 {
     base.Initialise(_atom, _initCallback);
 }
Exemplo n.º 17
0
 /// <summary>
 /// Begin from the first atom.
 /// </summary>
 /// <param name="_atoms">Atoms.</param>
 private void InitaliseFreshStart(List <ESTrainingAtom> _atoms)
 {
     currentAtom          = FindNextAtom(null, _atoms);
     currentNodeID        = currentAtom.id;
     currentNodeCompleted = false;
 }