158
{ }
15. InputController.cs
using System;
using UnityEngine;
using System.Collections;
using System;
using UnityEngine;
using System.Collections;
}
16. ISampleAppUIElement.cs
using UnityEngine;
using System.Collections;
public interface
ISampleAppUIElement {
void Draw;
}
17. ISampleAppUIEventHandler.cs
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public abstract
class ISampleAppUIEventHandler
: MonoBehaviour {
public abstract
event System.Action CloseView;
public abstract
event System.Action GoToAboutPage;
public abstract
void Bind;
public abstract
void UnBind;
public abstract
void UpdateView
bool tf;
public abstract
void TriggerAutoFocus;
public abstract
void SetToDefault
bool tf;
}
18. ISampleAppUIView.cs
using UnityEngine;
using System.Collections;
public interface
ISampleAppUIView {
void LoadView;
void UnLoadView;
void UpdateUI
bool tf;
}
19. KeepAliveBehaviour.cs
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
[RequireComponent typeof
QCARBehaviour] public
class KeepAliveBehaviour
: KeepAliveAbstractBehaviour {
}
20. MarkerBehaviour.cs
using UnityEngine;
public class
MarkerBehaviour : MarkerAbstractBehaviour
{ }
21. MaskOutBehaviour.cs
159
using UnityEngine;
public class
MaskOutBehaviour : MaskOutAbstractBehaviour
{ region
UNITY_MONOBEHAVIOUR_METHODS void
Start {
if QCARRuntimeUtilities.IsQCAREnabled
{ int
numMaterials = this
.renderer.materials.Length; if
numMaterials == 1 {
this .renderer.sharedMaterial = maskMaterial;
} else
{ Material[]
maskMaterials =
new Material[numMaterials];
for int
i = 0; i numMaterials; i++ maskMaterials[i] = maskMaterial;
this .renderer.sharedMaterials = maskMaterials;
} }
}
endregion UNITY_MONOBEHAVIOUR_METHODS
}
22. MultiTargetBehaviour.cs
public class
MultiTargetBehaviour :
MultiTargetAbstractBehaviour {
}
23. QCARBehaviour.cs
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text.RegularExpressions;
using UnityEngine;
[RequireComponent typeof
Camera] public
class QCARBehaviour
: QCARAbstractBehaviour {
QCARBehaviour {
mAndroidUnityPlayer = new
AndroidUnityPlayer; }
}
24. SampleAppUIBox.cs
using UnityEngine;
using System.Collections;
public class
SampleAppUIBox : ISampleAppUIElement
{ public
SampleAppUIBoxRect rect, string
path
160
{ this
.mRect = rect; mStyle =
new GUIStyle;
mStyle.normal.background = Resources.Loadpath as
Texture2D; }
public void
Draw {
GUI.BoxmRect, , mStyle;
if Input.GetMouseButtonDown0
|| Input.GetMouseButtonUp0
{ InputController.GUIInput =
true ;
} }
private Rect mRect;
private GUIStyle mStyle;
}
25. SampleAppUIButton.cs
using UnityEngine;
using System.Collections;
public class
SampleAppUIButton : ISampleAppUIElement
{ public
event System.Action TappedOn;
public SampleAppUIButtonRect rect,
string [] path
{ this
.mRect = rect; mStyle =
new GUIStyle;
mStyle.normal.background = Resources.Loadpath[0] as
Texture2D; mStyle.active.background = Resources.Loadpath[1]
as Texture2D;
mStyle.onNormal.background = Resources.Loadpath[1] as
Texture2D; }
public SampleAppUIButtonRect rect,
string [] path,
string pathForImage
{ this
.mRect = rect; this
.mButtonImage = Resources.Load pathForImage as
Texture; mStyle =
new GUIStyle;
mStyle.normal.background = Resources.Loadpath[0] as
Texture2D; mStyle.active.background = Resources.Loadpath[1]
as Texture2D;
mStyle.onNormal.background = Resources.Loadpath[1] as
Texture2D; mStyle.alignment = TextAnchor.MiddleCenter;
} public
void Draw
161
{ if
mButtonImage = null
{ if
GUI.ButtonmRect, mButtonImage, mStyle {
if this
.TappedOn = null
{ this
.TappedOn; InputController.GUIInput =
true ;
} }
} else
{ if
GUI.ButtonmRect, , mStyle
{ if
this .TappedOn =
null {
this .TappedOn;
InputController.GUIInput = true
; }
} }
}
private Texture mButtonImage;
private Rect mRect;
private GUIStyle mStyle;
}
26. SampleAppUICheckButton.cs