Exemple #1
0
 public Vector3 GetMappedCoordinates(Vector2 sensoCoordinates)
 {
     if (_sm != null)
     {
         return(GetMapped(sensoCoordinates));
     }
     else if (_sm == null && SensoManager.Instance != null)
     {
         _sm = SensoManager.Instance;
         if (hardwareConfiguration == null)
         {
             hardwareConfiguration = _sm.sensoHardwareConfiguration;
         }
         return(GetMapped(sensoCoordinates));
     }
     else
     {
         return(Vector3.zero + offset);
     }
 }
Exemple #2
0
        protected void Awake()
        {
            //Check the singleton is unique
            if (_instance == null)
            {
                //Debug.Log("Hello");
                _instance = SensoManager.Instance;

                //Set up the Hardware configuration
                if (_instance.sensoHardwareConfiguration == null)
                {
                    _instance.sensoHardwareConfiguration = SensoHardwareConfiguration.InstantiateStandardConfiguration();
                }
                _instance._plates = new Plate[Instance.sensoHardwareConfiguration.hardwarePlates.Length];
                DontDestroyOnLoad(gameObject);
            }
            else
            {
                Destroy(gameObject);
            }
        }
        //public void Store(string serializedMemory)
        //{
        //    _memory = serializedMemory;
        //}
        #endregion


        #region Unity Boilerplate functions
        protected void Awake()
        {
            //Check the singleton is unique
            if (_instance == null)
            {
                _instance = SensoManager.Instance;
            }
            else
            {
                if (FindObjectsOfType <SensoManager>().Length > 1)
                {
                    Destroy(gameObject);
                    return;
                }
            }

            //Set up the Hardware configuration
            if (_instance.sensoHardwareConfiguration == null)
            {
                _instance.sensoHardwareConfiguration = SensoHardwareConfiguration.InstantiateStandardConfiguration();
            }
            _instance._plates = new Plate[Instance.sensoHardwareConfiguration.hardwarePlates.Length];
            DontDestroyOnLoad(gameObject);
        }