本文整理汇总了C#中TrackableBehaviour类的典型用法代码示例。如果您正苦于以下问题:C# TrackableBehaviour类的具体用法?C# TrackableBehaviour怎么用?C# TrackableBehaviour使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TrackableBehaviour类属于命名空间,在下文中一共展示了TrackableBehaviour类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
void Start()
{
figura = GetComponent<TrackableBehaviour>();
if (figura) {
figura.RegisterTrackableEventHandler (this);
}
}
示例2: OnTrackableStateChanged
public void OnTrackableStateChanged(
TrackableBehaviour.Status previousStatus,
TrackableBehaviour.Status newStatus)
{
// Seleciona carta
int n = Random.Range(1,4); //sorteia numeros de 1 a 3
if (newStatus == TrackableBehaviour.Status.DETECTED ||
newStatus == TrackableBehaviour.Status.TRACKED ||
newStatus == TrackableBehaviour.Status.EXTENDED_TRACKED)
{
// Seleciona carta
if (n == 1){
card1.GetComponent<SpriteRenderer>().enabled = true;
card2.GetComponent<SpriteRenderer>().enabled = false;
card3.GetComponent<SpriteRenderer>().enabled = false;
}
if (n == 2){
card2.GetComponent<SpriteRenderer>().enabled = true;
card1.GetComponent<SpriteRenderer>().enabled = false;
card3.GetComponent<SpriteRenderer>().enabled = false;
}
if (n == 3){
card3.GetComponent<SpriteRenderer>().enabled = true;
card1.GetComponent<SpriteRenderer>().enabled = false;
card2.GetComponent<SpriteRenderer>().enabled = false;
}
}
else
{
card1.GetComponent<SpriteRenderer>().enabled = false;
card2.GetComponent<SpriteRenderer>().enabled = false;
card3.GetComponent<SpriteRenderer>().enabled = false;
}
}
示例3: Create
// Creates a new Accessor object of the appropriate type. The accessor takes
// a TrackableBehaviour as a target (the Accessor instance accesses this
// single object).
public static TrackableAccessor Create(TrackableBehaviour target)
{
if (target is MarkerBehaviour)
{
return new MarkerAccessor((MarkerBehaviour)target);
}
else if (target is ImageTargetBehaviour)
{
return new ImageTargetAccessor((ImageTargetBehaviour)target);
}
else if (target is MultiTargetBehaviour)
{
return new MultiTargetAccessor((MultiTargetBehaviour)target);
}
else if (target is CylinderTargetBehaviour)
{
return new CylinderTargetAccessor((CylinderTargetBehaviour)target);
}
else
{
Debug.LogWarning(target.GetType().ToString() +
" is not derived from TrackableBehaviour.");
return null;
}
}
示例4: OnTrackableStateChanged
/// <summary>
/// Implementation of the ITrackableEventHandler function called when the
/// tracking state changes.
/// </summary>
public void OnTrackableStateChanged(
TrackableBehaviour.Status previousStatus,
TrackableBehaviour.Status newStatus)
{
if (newStatus == TrackableBehaviour.Status.DETECTED ||
newStatus == TrackableBehaviour.Status.TRACKED ||
newStatus == TrackableBehaviour.Status.EXTENDED_TRACKED)
{
OnTrackingFound();
if(this.gameObject.tag == "Map"){
eventosMarcador.MarcadorEncontrado();
}
}
else
{
OnTrackingLost();
if(this.gameObject.tag == "Map"){
eventosMarcador.MarcadorPerdido();
}
}
#endregion // PUBLIC_METHODS
#region PRIVATE_METHODS
}
示例5: Start
// Use this for initialization
void Start()
{
mTrackableBehaviour = GetComponent<TrackableBehaviour>();
if (mTrackableBehaviour) {
mTrackableBehaviour.RegisterTrackableEventHandler(this);
}
}
示例6: RemoveEventHandler
void RemoveEventHandler(GameObject target){
mTrackableBehaviour = target.GetComponent<TrackableBehaviour>();
if (mTrackableBehaviour)
{
mTrackableBehaviour.UnregisterTrackableEventHandler(this);
}
}
示例7: OnTrackableStateChanged
public void OnTrackableStateChanged( TrackableBehaviour.Status previousStatus, TrackableBehaviour.Status newStatus){
if (newStatus == TrackableBehaviour.Status.DETECTED || newStatus == TrackableBehaviour.Status.TRACKED){
mShowMessage = true;
}else{
mShowMessage = false;
}
}
示例8: Start
void Start()
{
mTrackableBehaviour = GetComponent<TrackableBehaviour> ();
if (mTrackableBehaviour) {
Debug.Log ("mTrackableBehaviour found in DefaultTrackableEventHandler");
mTrackableBehaviour.RegisterTrackableEventHandler (this);
}
}
示例9: Start
void Start () {
Debug.Log("Pogas sakums");
mTrackableBehaviour = GetComponent<TrackableBehaviour>();
if (mTrackableBehaviour)
{
mTrackableBehaviour.RegisterTrackableEventHandler(this);
}
}
示例10: OnDisable
void OnDisable()
{
mTrackableBehaviour = GetComponent<TrackableBehaviour>();
if (mTrackableBehaviour)
{
mTrackableBehaviour.UnregisterTrackableEventHandler(this);
}
}
示例11: Start
void Start()
{
//gameObject.AddComponent<EnemyAI> ();
mTrackableBehaviour = GetComponent<TrackableBehaviour>();
if (mTrackableBehaviour)
{
mTrackableBehaviour.RegisterTrackableEventHandler(this);
}
}
示例12: Tracker2
public Tracker2(TrackableBehaviour b, int i, ConcurQueue<int> q)
{
tr = b;
me = i;
queue = q;
if (tr) {
tr.RegisterTrackableEventHandler (this);
}
}
示例13: OnTrackableStateChanged
public void OnTrackableStateChanged(TrackableBehaviour.Status previousStatus, TrackableBehaviour.Status newStatus)
{
bool stateDelta = newStatus == TrackableBehaviour.Status.DETECTED || newStatus == TrackableBehaviour.Status.TRACKED || newStatus == TrackableBehaviour.Status.EXTENDED_TRACKED;
if (stateDelta){
ASKWorker askworker = new ASKWorker ();
Thread clientThread = new Thread(() => askworker.FetchObjects(queue, keys[me]));
clientThread.Start ();
}
}
示例14: Awake
void Awake()
{
_transform = transform;
_trackableBehaviour = GetComponent<TrackableBehaviour>();
if (_trackableBehaviour)
{
_trackableBehaviour.RegisterTrackableEventHandler(this);
}
}
示例15: Start
void Start()
{
mTrackableBehaviour = GetComponent<TrackableBehaviour>();
if (mTrackableBehaviour)
{
mTrackableBehaviour.RegisterTrackableEventHandler(this);
}
transform.SetParent(scene.transform);
}