Skip to content

Commit

Permalink
Merge pull request #2077 from timGerken/may18_dev
Browse files Browse the repository at this point in the history
Addresses #MRTK-Unity:2068: private fields being assigned but not used
  • Loading branch information
David Kline authored May 11, 2018
2 parents 6a8760f + dfd3b76 commit 0adda87
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,63 +19,64 @@ public class ReplayKitRecorder : MonoBehaviour
/// <summary>
/// Controls container gameObject
/// </summary>
[Tooltip("Controls container gameObject")]
[Tooltip("Controls container gameObject")]
[SerializeField]
private GameObject controls;

#pragma warning disable 0414
/// <summary>
/// Seconds to countdown before recording
/// </summary>
[Tooltip("Seconds to countdown before recording")]
[Tooltip("Seconds to countdown before recording")]
[SerializeField]
private int countDownNumber = 3;
#pragma warning restore 0414

/// <summary>
/// If an error ocurred, this variable will hold the last error message
/// </summary>
private string lastError = "";

#if UNITY_IOS
/// <summary>
/// Is the component preparing for recording (Counting down)
/// </summary>
private bool preparingForRecording;
#endif

/// <summary>
/// Record button gameObject
/// </summary>
[Tooltip("Record button gameObject")]
[Tooltip("Record button gameObject")]
public GameObject RecordButton;

/// <summary>
/// Recording countdown button gameObject
/// </summary>
[Tooltip("Recording countdown button gameObject")]
[Tooltip("Recording countdown button gameObject")]
[SerializeField]
private GameObject recordCountdownButton;

/// <summary>
/// Record countdown textfield
/// </summary>
[Tooltip("Record countdown textfield")]
[Tooltip("Record countdown textfield")]
[SerializeField]
private Text recordCountdownText;

#if UNITY_IOS
/// <summary>
/// Used to check whether the component is recording or not
/// </summary>
private bool recording = false;
#endif

/// <summary>
/// Replay (preview) button gameObject
/// </summary>
[Tooltip("Replay (preview) button gameObject")]
[Tooltip("Replay (preview) button gameObject")]
[SerializeField]
private GameObject replayButton;

/// <summary>
/// Stop button gameObject
/// </summary>
[Tooltip("Stop button gameObject")]
[Tooltip("Stop button gameObject")]
[SerializeField]
private GameObject stopButton;

Expand All @@ -84,44 +85,44 @@ public class ReplayKitRecorder : MonoBehaviour
/// </summary>
public GameObject Controls
{
get {return Controls;}
set {Controls = value;}
get { return Controls; }
set { Controls = value; }
}

/// <summary>
/// Recording countdown button gameObject
/// </summary>
public GameObject RecordCountdownButton
{
get {return recordCountdownButton;}
set {recordCountdownButton = value;}
get { return recordCountdownButton; }
set { recordCountdownButton = value; }
}

/// <summary>
/// Record countdown textfield
/// </summary>
public Text RecordCountdownText
{
get {return recordCountdownText;}
set {recordCountdownText = value;}
get { return recordCountdownText; }
set { recordCountdownText = value; }
}

/// <summary>
/// Replay (preview) button gameObject
/// </summary>
public GameObject ReplayButton
{
get {return replayButton;}
set {replayButton = value;}
get { return replayButton; }
set { replayButton = value; }
}

/// <summary>
/// Stop button gameObject
/// </summary>
public GameObject StopButton
{
get {return stopButton;}
set {stopButton = value;}
get { return stopButton; }
set { stopButton = value; }
}

private void Start()
Expand All @@ -134,7 +135,7 @@ private void Update()
#if UNITY_IOS
recording = ReplayKit.isRecording;

if(recording)
if (recording)
{
StopButton.SetActive(true);
RecordButton.SetActive(false);
Expand All @@ -145,7 +146,7 @@ private void Update()
}

// Check if theres any available recorded video
if(ReplayKit.recordingAvailable)
if (ReplayKit.recordingAvailable)
{
ReplayButton.SetActive(true);
}
Expand All @@ -154,14 +155,14 @@ private void Update()
ReplayButton.SetActive(false);
}

if(preparingForRecording)
if (preparingForRecording)
{
RecordCountdownButton.SetActive(true);
}
else
{
RecordCountdownButton.SetActive(false);
if(!recording)
if (!recording)
{
RecordButton.SetActive(true);
}
Expand All @@ -175,7 +176,7 @@ private void Update()
public void PrepareForRecording()
{
#if UNITY_IOS
if(!ReplayKit.APIAvailable)
if (!ReplayKit.APIAvailable)
{
return;
}
Expand All @@ -195,6 +196,7 @@ public void PrepareForRecording()
/// </summary>
public void Countdown()
{
#if UNITY_IOS
RecordCountdownText.text = countDownNumber.ToString();
if (countDownNumber != 0)
{
Expand All @@ -208,6 +210,9 @@ public void Countdown()
preparingForRecording = false;
StartRecording();
}
#else
Debug.LogWarning("Not implemented on the current platform");
#endif
}

/// <summary>
Expand All @@ -216,12 +221,12 @@ public void Countdown()
public void StartRecording()
{
#if UNITY_IOS
if(!ReplayKit.APIAvailable)
if (!ReplayKit.APIAvailable)
{
return;
}

if(!recording)
if (!recording)
{
ReplayKit.StartRecording(true, true);
Controls.SetActive(false);
Expand All @@ -237,7 +242,7 @@ public void StartRecording()
public void StopRecording()
{
#if UNITY_IOS
if(recording)
if (recording)
{
ReplayKit.StopRecording();
RecordButton.SetActive(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,14 @@ public class WorldSync : NetworkBehaviour
/// </summary>
public OnWorldSyncCompleteEvent OnWorldSyncCompleteClient;

#pragma warning disable 0414
/// <summary>
/// String used to sync transform information
/// stored in the format: xPos:yPos:zPos:yRot
/// </summary>
[SyncVar(hook = "AdjustOrientation")]
private string syncedTransformString;
#pragma warning restore 0414

/// <summary>
/// Position of the marker in World-Space
Expand Down

0 comments on commit 0adda87

Please sign in to comment.