You need help for something ? Go to https://xr4dev.pages.xr4all.eu

Commit 3674d20c authored by aradjafari's avatar aradjafari

Version 1.5

parents edcbea8e 52d31084
Pipeline #2690 failed with stages
in 40 minutes and 58 seconds
default:
image: gableroux/unity3d:2019.4.5f1
stages:
- activation
- test
......@@ -11,6 +8,11 @@ variables:
BUILD_NAME: MirageXR
UNITY_VERSION: 2019.4.5f1
UNITY_ACTIVATION_FILE: ./Unity_v$UNITY_VERSION.alf
IMAGE: unityci/editor # https://hub.docker.com/r/unityci/editor
IMAGE_VERSION: "0.9" # https://hub.docker.com/r/unityci/editor
UNITY_DIR: $CI_PROJECT_DIR # this needs to be an absolute path. Defaults to the root of your tree.
image: $IMAGE:$UNITY_VERSION-base-$IMAGE_VERSION
.unity_before_script: &unity_before_script
before_script:
......@@ -21,7 +23,7 @@ variables:
cache:
key: "$CI_PROJECT_NAMESPACE-$CI_PROJECT_NAME-$CI_COMMIT_REF_SLUG-$TEST_PLATFORM"
paths:
- Library/
- $UNITY_DIR/Library/
# uncomment and run this job when you need to request a license
# you may need to follow activation steps from documentation
......@@ -178,6 +180,26 @@ hololens1-build-check:
tags:
- windows
.build: &build
stage: build
<<: *unity_before_script
<<: *cache
script:
- chmod +x ./ci/build.sh && ./ci/build.sh
artifacts:
paths:
- $UNITY_DIR/Builds/
#build-android-il2cpp:
# <<: *build
# image: $IMAGE:$UNITY_VERSION-android-$IMAGE_VERSION
# variables:
# BUILD_TARGET: Android
# BUNDLE_VERSION_CODE: $CI_PIPELINE_IID
# BUILD_APP_BUNDLE: "false"
# SCRIPTING_BACKEND: IL2CPP
prerelease-notification:
only:
- develop
......
......@@ -807,8 +807,8 @@ Camera:
m_GameObject: {fileID: 807537237}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 2
m_BackGroundColor: {r: 0, g: 0, b: 0, a: 0}
m_ClearFlags: 1
m_BackGroundColor: {r: 0, g: 0, b: 0, a: 1}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
......@@ -822,7 +822,7 @@ Camera:
width: 1
height: 1
near clip plane: 0.1
far clip plane: 50
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 5
......@@ -884,34 +884,6 @@ MonoBehaviour:
m_AutoFocus: 1
m_LightEstimation: 0
m_FacingDirection: 1
--- !u!21 &870388604
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: 'targetMaterial
-29828'
m_Shader: {fileID: 10752, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 5
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 2800000, guid: 02ca749bb835418ebe6506fa988f7211, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats: []
m_Colors:
- _Color: {r: 0.82089555, g: 0.82089555, b: 0.82089555, a: 1}
--- !u!1001 &967134324
PrefabInstance:
m_ObjectHideFlags: 0
......@@ -971,7 +943,7 @@ PrefabInstance:
type: 3}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 870388604}
objectReference: {fileID: 1976782536}
- target: {fileID: 33609130599881980, guid: 177bff737c69d564ebb225d7fe7fc402,
type: 3}
propertyPath: m_Mesh
......@@ -1725,6 +1697,34 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 6913f3715d997c84e8d04d5e256fc233, type: 3}
--- !u!21 &1976782536
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: 'targetMaterial
-1230'
m_Shader: {fileID: 10752, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 5
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 2800000, guid: 02ca749bb835418ebe6506fa988f7211, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats: []
m_Colors:
- _Color: {r: 0.82089555, g: 0.82089555, b: 0.82089555, a: 1}
--- !u!1 &1980728070
GameObject:
m_ObjectHideFlags: 0
......
......@@ -128,7 +128,7 @@ public class AudioEditor : MonoBehaviour
public void Close()
{
//when editor is closed play the spatial audio if it is exist
if (annotationToEdit != null) {
if (annotationToEdit != null && GameObject.Find(annotationToEdit.poi).GetComponentInChildren<AudioPlayer>() != null) {
GameObject.Find(annotationToEdit.poi).GetComponentInChildren<AudioPlayer>().PlayAudio();
}
......@@ -268,7 +268,7 @@ public class AudioEditor : MonoBehaviour
//set the correct dialog recorder(correct character) to the audio player
foreach (var character in FindObjectsOfType<MirageXR.CharacterController>())
{
if (character.MyAction == this.action && character.DialogRecorder.DialogSaveName != "")
if (character.MyAction == action && character.DialogRecorder.DialogSaveName != "")
{
SaveFileName = character.DialogRecorder.DialogSaveName;
originalFilePath = Path.Combine(ActivityManager.Instance.Path, SaveFileName);
......@@ -348,7 +348,8 @@ public class AudioEditor : MonoBehaviour
EventManager.ActivateObject(annotationToEdit);
EventManager.NotifyActionModified(action);
GameObject.Find(annotationToEdit.poi).GetComponentInChildren<AudioPlayer>().DialogRecorderPanel = DialogRecorderPanel;
if(GameObject.Find(annotationToEdit.poi).GetComponentInChildren<AudioPlayer>() != null)
GameObject.Find(annotationToEdit.poi).GetComponentInChildren<AudioPlayer>().DialogRecorderPanel = DialogRecorderPanel;
}
Close();
......@@ -362,12 +363,10 @@ public class AudioEditor : MonoBehaviour
IsRecording = true;
IsPlaying = false;
if (string.IsNullOrEmpty(SaveFileName))
{
SaveFileName = $"MirageXR_Audio_{System.DateTime.Now.ToFileTimeUtc()}.wav";
}
AudioRecorder.Start();
if (gameObject.activeInHierarchy)
......
......@@ -6,6 +6,8 @@ using UnityEngine.UI;
public class AnnotationListItem : MonoBehaviour
{
[SerializeField] private Text textField;
[SerializeField] private InputField startStepInput;
[SerializeField] private InputField endStepInput;
private Button button;
......@@ -25,6 +27,9 @@ public class AnnotationListItem : MonoBehaviour
private void Start()
{
OnEditModeChanged(ActivityManager.Instance.EditModeActive);
startStepInput.onEndEdit.AddListener(delegate { AdjustPoiLifetime(); });
endStepInput.onEndEdit.AddListener(delegate { AdjustPoiLifetime(); });
}
private void OnEnable()
......@@ -57,8 +62,49 @@ public class AnnotationListItem : MonoBehaviour
return;
}
textField.text = DisplayedAnnotation.predicate;
var actionList = ActivityManager.Instance.Activity.actions;
var startStep = actionList.IndexOf(actionList.Find(a => a.enter.activates.Find(p => p.poi == DisplayedAnnotation.poi) != null));
var lastStep = actionList.FindLastIndex(a => a.enter.activates.Find(p => p.poi == DisplayedAnnotation.poi) != null);
startStepInput.text = (startStep+1).ToString();
endStepInput.text = (lastStep+1).ToString();
}
void AdjustPoiLifetime()
{
var actionList = ActivityManager.Instance.ActionsOfTypeAction;
var currentActionIndex = actionList.IndexOf(actionList.Find(a => a.id == ActivityManager.Instance.ActiveActionId));
var startIndex = Int32.Parse(startStepInput.text) > 0 ? Int32.Parse(startStepInput.text)-1 : 0;
var endIndex = Int32.Parse(endStepInput.text) <= actionList.Count ? Int32.Parse(endStepInput.text)-1 : actionList.Count-1;
if (startIndex == 0)
startStepInput.text = "1";
if (endIndex > actionList.Count - 1)
{
endStepInput.text = actionList.Count.ToString();
endIndex = actionList.Count - 1;
}
if (startIndex > endIndex)
{
startIndex = endIndex;
startStepInput.text = startStepInput.text;
}
ActivityManager.Instance.AddAllAnnotationsBetweenSteps(startIndex, endIndex, DisplayedAnnotation, Vector3.zero);
//On editing the keep alive of the character in each step, save the data (Can use for other augmentations also if needed
if (DisplayedAnnotation.predicate.StartsWith("char"))
ActivityManager.Instance.SaveData();
UpdateUI();
}
public void OnItemClicked()
{
OnAnnotationItemClicked?.Invoke(DisplayedAnnotation);
......
......@@ -49,8 +49,11 @@ public class ActionEditor : MonoBehaviour
{
return detailView;
}
private readonly string[] listOfPois = { "image", "video", "audio", "ghost", "label", "act", "vfx", "model", "character", "pick&place", /*"image marker",*/ };
#if UNITY_ANDROID || UNITY_IOS
private readonly string[] listOfPois = { "image", "video", "audio", "ghost", "label", "act", "vfx", "model", "character", "pick&place", };
#else
private readonly string[] listOfPois = { "image", "video", "audio", "ghost", "label", "act", "vfx", "model", "character", "pick&place", "image marker", };
#endif
private bool addMenuVisible;
......
......@@ -5,6 +5,7 @@ using UnityEngine.UI;
public class AnnotationEditor : MonoBehaviour
{
[SerializeField] private Button deleteAnnotation;
[SerializeField] private GameObject lifeIcon;
private AnnotationListItem annotationListItem;
......@@ -35,6 +36,7 @@ public class AnnotationEditor : MonoBehaviour
private void SetEditModeState(bool editModeActive)
{
deleteAnnotation.gameObject.SetActive(editModeActive);
lifeIcon.SetActive(editModeActive);
}
public void DeleteAnnotation()
......
......@@ -24,7 +24,7 @@ public class ModelPreviewItem
public string uid = "";
public string resourceUrl = "";
public ThumbnailImage resourceImage;
public float fileSize = 0.0f;
}
......
using System.Collections;
 using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.IO;
using ICSharpCode.SharpZipLib.Zip;