@@ -784,32 +784,6 @@ public enum TrackerEmulationMode { Pointer, Translate, Rotate, TranslateForward,
784784 [ SerializeField ]
785785 int highQualitySettingIndex = - 1 ;
786786
787- [ Header ( "Configuration" ) ]
788- [ SerializeField ]
789- string configFilePath = "module-omicron/Config" ;
790-
791- //[SerializeField]
792- //bool generateConfigFile = false;
793-
794- // Config File
795- string configPath ;
796- bool hasConfig = false ;
797-
798- [ Serializable ]
799- public class CAVE2Config
800- {
801- public CAVE2ManagerConfig cave2manager ;
802- }
803-
804- [ Serializable ]
805- public class CAVE2ManagerConfig
806- {
807- public string headNodeMachineName ;
808- public string displayNodeMachineName ;
809- }
810-
811- CAVE2Config config ;
812-
813787 public void Init ( )
814788 {
815789 CAVE2Manager_Instance = this ;
@@ -826,67 +800,6 @@ public void Init()
826800 Debug . Log ( this . GetType ( ) . Name + ">\t initialized on " + machineName ) ;
827801
828802 UnityEngine . Random . InitState ( 1138 ) ;
829-
830- CheckConfigFile ( ) ;
831- }
832-
833- void CheckConfigFile ( )
834- {
835- string configFileDefaultName = "cave2config.cfg" ;
836-
837- // Load config file:
838- // Priority 1: User specfied as command line argument
839- string [ ] cmdArgs = Environment . GetCommandLineArgs ( ) ;
840- for ( int i = 0 ; i < cmdArgs . Length ; i ++ )
841- {
842- if ( cmdArgs [ i ] . Equals ( "-cave2config" ) && i + 1 < cmdArgs . Length )
843- {
844- if ( ! hasConfig )
845- {
846- LoadConfigFile ( Environment . CurrentDirectory + "/" + cmdArgs [ i + 1 ] ) ;
847- }
848- }
849- }
850-
851- // Priority 2: Check Default Path (Assets/module-omicron)
852- // or changed in Editor Inspector for this script
853- if ( ! hasConfig )
854- {
855- LoadConfigFile ( Application . dataPath + "/" + configFilePath + "/" + configFileDefaultName ) ;
856- }
857-
858- // Priority 3: Check Asset Folder Default Path
859- if ( ! hasConfig )
860- {
861- LoadConfigFile ( Application . dataPath + "/" + configFileDefaultName ) ;
862- }
863- }
864-
865- void LoadConfigFile ( string configPath )
866- {
867- // Read from config (if it exists, else create on quit)
868- try
869- {
870- StreamReader reader = new StreamReader ( configPath ) ;
871- config = JsonUtility . FromJson < CAVE2Config > ( reader . ReadToEnd ( ) ) ;
872- CAVE2ManagerConfig c2mConfig = config . cave2manager ;
873-
874- if ( c2mConfig . headNodeMachineName != null )
875- {
876- CAVE2 . HEAD_NODE_NAME = c2mConfig . headNodeMachineName ;
877- }
878- if ( c2mConfig . displayNodeMachineName != null )
879- {
880- CAVE2 . DISPLAY_NODE_NAME = c2mConfig . displayNodeMachineName ;
881- }
882-
883- Debug . Log ( "CAVE2Manager configration loaded from '" + configPath + "'." ) ;
884- hasConfig = true ;
885- }
886- catch
887- {
888-
889- }
890803 }
891804
892805 void Start ( )
@@ -941,6 +854,21 @@ void ConfigurationLoaded(DefaultConfig config)
941854 }
942855 }
943856
857+ void CAVE2ConfigurationLoaded ( DefaultConfig config )
858+ {
859+ ClusterConfig cConfig = ConfigurationManager . loadedConfig . clusterConfig ;
860+ if ( cConfig . headNodeName . Length > 0 )
861+ {
862+ CAVE2 . HEAD_NODE_NAME = cConfig . headNodeName ;
863+ Debug . Log ( "Config: Using '" + CAVE2 . HEAD_NODE_NAME + "' as head node machine name" ) ;
864+ }
865+ if ( cConfig . displayNodeName . Length > 0 )
866+ {
867+ CAVE2 . HEAD_NODE_NAME = cConfig . displayNodeName ;
868+ Debug . Log ( "Config: Using '" + CAVE2 . HEAD_NODE_NAME + "' as display node machine name" ) ;
869+ }
870+ }
871+
944872 void Update ( )
945873 {
946874 if ( CAVE2Manager_Instance == null )
0 commit comments