private LeapImageRetriever getImageRetreiverForEye(UnityEngine.VR.VRNode eyeNode) {
    Camera cameraForEye = getCameraObjectForEye(eyeNode);
    LeapImageRetriever imageRetrieverForEye = cameraForEye.gameObject.GetComponent<LeapImageRetriever>();

    if (cameraForEye == null) {
      throw new System.NullReferenceException("Could not resolve the camera for the given eye: " + eyeNode.ToString());
    }

    if (imageRetrieverForEye == null) {
      throw new UnityEngine.MissingComponentException("Could not find LeapImageRetriever component adjacent to camera on " + cameraForEye.gameObject.name + " for the given eye: " + eyeNode.ToString());
    }

    return imageRetrieverForEye;
  }
Ejemplo n.º 2
0
		public void SaveCache (UnityEngine.Object obj, float remainLife)
		{
			ObjectType assetType = getAssetType(obj);

			if (assetType != ObjectType.None)
			{
				CachePool pool = null;
				cachePoolDic.TryGetValue(assetType, out pool);

				if (pool == null)
				{
					pool = new CachePool();
					cachePoolDic[assetType] = pool;
				}
				pool.Cache(obj, remainLife);
			}
			else
			{
				Debug.LogError("Unknown cache type: " + obj.ToString());
			}
		}
  private Camera getCameraObjectForEye(UnityEngine.VR.VRNode cameraNode) {
    Camera camera;

    switch (cameraNode) {
      case UnityEngine.VR.VRNode.CenterEye:
      case UnityEngine.VR.VRNode.Head:
        camera = ((HMRConfigurationManager)target)._centerCamera;
        break;
      case UnityEngine.VR.VRNode.LeftEye:
        camera = ((HMRConfigurationManager)target)._leftCamera;
        break;
      case UnityEngine.VR.VRNode.RightEye:
        camera = ((HMRConfigurationManager)target)._rightCamera;
        break;
      default:
        throw new System.ArgumentOutOfRangeException("No understoof VRNode provided.");
    }

    if (camera == null) {
      throw new System.NullReferenceException("The camera reference for the " + cameraNode.ToString() + "is missing on " + ((HMRConfigurationManager)target).gameObject.name);
    }

    return camera;
  }
Ejemplo n.º 4
0
 public static void Exception(System.Exception exception, UnityEngine.Object context)
 {
     _NotifyError(context.ToString() + " - " + exception.ToString());
     if (UnityEngine.Debug.isDebugBuild) UnityEngine.Debug.LogException(exception, context);
 }
Ejemplo n.º 5
0
 public static void Error(object message, UnityEngine.Object context)
 {
     _NotifyError(context.ToString() + " - " + message);
     if (UnityEngine.Debug.isDebugBuild) UnityEngine.Debug.LogError(message, context);
 }
        /// <summary>
        /// @param actionName	human readable name of the action. Valid values are defined in com.takomat.modules.model.constants.GameActions
        /// @param actionIndex	zero based action index
        /// @param data			optional additional data that might be passed with the event.
        /// 						For the action FINISHED_GAME_YEAR this parameter contains the number
        /// 						of years that have already been played.
        ///[EventHandler(event = "TrackingEvent.TRACK_ACTION", properties = "actionName, actionIndex, data")]
        /// </summary>
        public void trackGameAction(string 			actionName, 
		                             int 				actionIndex, 
		                             UnityEngine.Object data		)
        {
            //TODO
            string serviceUrl = "/api.php/event/track";
            WWWForm param = new WWWForm ();
            param.AddField ("actionIndex", actionIndex);
            param.AddField ("actionName",  actionName);
            param.AddField ("data", 	   data.ToString());

            bool oldDebugState = debugOutputStopped;
            debugOutputStopped = false;

            addDebugOutput("\ntrack Game Action");
            addDebugOutput("\n\t>actionIndex: " +
                           actionIndex);
            addDebugOutput("\n\t>actionName: " +
                           actionName);
            addDebugOutput("\n\t>data: " +
                           data);

            debugOutputStopped = oldDebugState;
            //Checks if _sessionToken is actual
            if (_sessionToken != GameManager.Instance.mainGame.GetValue ("sessionToken"))
            {
                dbModuleEventSession ("", GameManager.Instance.mainGame.GetValue("sessionToken"));
            }
            param.AddField ("sessionToken", _sessionToken);

            sendHTTPRequest (serviceUrl, param, null);
        }
Ejemplo n.º 7
0
		public void ReleaseCache (UnityEngine.Object obj, CacheObject.DestroyDelegate destroyCallback)
		{
			if (obj == null)
			{
				Debug.LogError("Object you want to release is null!");
				return;
			}

			ObjectType assetType = getAssetType(obj);

			if (assetType != ObjectType.None)
			{
				CachePool pool = null;
				cachePoolDic.TryGetValue(assetType, out pool);
				
				if (pool != null)
				{
					pool.Release(obj, destroyCallback);
				}
				else
				{
					Debug.LogError("Cache pool doesn't exist: " + assetType.ToString());
				}
			}
			else
			{
				Debug.LogError("Unknown cache type: " + obj.ToString());
			}
		}
Ejemplo n.º 8
0
	public void NotifyButtonPress (UnityEngine.EventSystems.PointerEventData.InputButton button)
	{
		Debug.Log("The button is being pressed!: " + button.ToString());
	}