// Start is called before the first frame update void Start() { this.meshRenderer = GetComponent <MeshRenderer>(); if (this.meshRenderer == null) { print("Failed to get this.meshRenderer"); return; } this.actsAsManipulatable = GetComponent <ActsAsManipulatable>(); if (this.actsAsManipulatable == null) { print("Failed to get this.actsAsManipulatable"); return; } ActsAsSwipeable actsAsSwipeable = GetComponent <ActsAsSwipeable>(); if (actsAsSwipeable != null) { actsAsSwipeable.swipeLeftDelegate = OnSwipeLeft; actsAsSwipeable.swipeRightDelegate = OnSwipeRight; } if (!MLPersistentCoordinateFrames.IsStarted) { MLResult resultStart = MLPersistentCoordinateFrames.Start(); switch (resultStart.Result) { case MLResult.Code.Ok: { commonStart(); } break; case MLResult.Code.PrivilegeDenied: throw new System.NotImplementedException(); case MLResult.Code.InvalidParam: throw new System.NotImplementedException(); case MLResult.Code.UnspecifiedFailure: throw new System.NotImplementedException(); } } else { commonStart(); } }
private void OnSwipeLeft(ActsAsSwipeable actsAsSwipeable) { transform.Rotate(new Vector3(0, 1), -1f); }