コード例 #1
0
 public void StoppedFilmingObject(ObjectViewInfo objectInfo)
 {
     if (GetObjectiveByName (objectInfo.gObject.name) != null && !GetObjectiveByName(objectInfo.gObject.name).completed) {
         Objective curObjective = GetObjectiveByName (objectInfo.gObject.name);
         //if (!curObjective.completed) {
         curObjective.ResetFilmObjective ();
         StopCoroutine("FilmingObjectDelayed");
         _filmDelaying = false;
         //}
     } else {
         if(_allNonObjectivesInScreen.Contains(objectInfo.gObject)){
             _allNonObjectivesInScreen.Remove(objectInfo.gObject);
         }
     }
 }
コード例 #2
0
    public void SeeingObject(GameObject obj)
    {
        if (recorder == null || recorder.recording) {

            float distance = Vector3.Distance (obj.transform.position, transform.position);
            Vector3 rightestPoint;
            Vector3 highestPoint;
            float width = RendererExtensions.GetPerspectiveWidth (obj.GetComponent<Collider> (), thisCamera, out rightestPoint);
            float height = RendererExtensions.GetPerspectiveHeigth (obj.GetComponent<Collider> (), thisCamera, out highestPoint);
            Vector2 center = RendererExtensions.GetPerspectiveCenterOfObject (highestPoint, rightestPoint, width, height);

            ObjectViewInfo objInfo = new ObjectViewInfo (obj, distance, GetObjectBoundInViewPercentage (obj), width, height, center); // TODO Give screen perspective width and height!

            int indexObject = getIndexInfoListObj (obj);
            if (indexObject != NON_CONTAINTING) {
                _objectsViewInfoList [indexObject] = objInfo;
            } else {
                _objectsViewInfoList.Add (objInfo);
            }
            objInfo.coverData = GetAllVisibleObjectsSurfacesByOverlap (_objectsViewInfoList) [obj];
            //Debug.Log (objInfo.pivot + " w, " + objInfo.widthObject + " h, " + objInfo.heightObject + " %, " + objInfo.percentageInViewObject + " ||, " + GetAllVisibleObjectsSurfacesByOverlap (_objectsViewInfoList) [obj]);
        }
    }
コード例 #3
0
 public void StopSeeingObject(ObjectViewInfo objInfo)
 {
     objList.StoppedFilmingObject (objInfo);
 }