Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» Game Mewarnai Tutorial
Thu Mar 23, 2017 10:21 am by kamil

» [ASK HELP] Slide informasi di augmented reality
Tue Jan 03, 2017 8:58 pm by Briyan_ap

» ASK cara klik dan memunculkan informasi
Tue Jan 03, 2017 8:54 pm by Briyan_ap

» [Ask] mengubah game PC menjadi game Android
Tue Jan 03, 2017 10:57 am by NiethaChan

» Virtualisasi suatu Gedung mengunakan unity3D + google seketchUP
Sat Dec 31, 2016 1:06 am by zeepank

» Minta Tolong, slideshow ngga muncul saat object di klik
Tue Dec 27, 2016 12:53 pm by Briyan_ap

» tolong dong lagi bikin button rotate tp button ga keluar
Wed Dec 21, 2016 1:15 pm by Lita Misae

» algoritma Minimax/negascout buat checkers
Wed Nov 30, 2016 1:51 am by ardiansa

» screenshot
Wed Nov 16, 2016 10:15 pm by azhari

Statistic

[ASK] Help Broooo Unity3D & Viforia

View previous topic View next topic Go down

[ASK] Help Broooo Unity3D & Viforia

Post  loveblue91 on Tue Jun 02, 2015 9:52 pm

Malam Bro,

saya stephen, sedang mejalankan tugas akhir kampus dimana saya mengambil judul AR.

saya sedang membuat virtual button dari vuforianya tidak ada virtual botton, saya create new C# dan memasukan
codenya sebagai berikut :

Code:
using UnityEngine;
using System.Collections.Generic;

/// <summary>
/// This class implements the IVirtualButtonEventHandler interface and
/// contains the logic to swap materials for the teapot model depending on what
/// virtual button has been pressed.
/// </summary>
public class VirtualButtonEventHandler : MonoBehaviour,
                                        IVirtualButtonEventHandler
{
    #region PUBLIC_MEMBER_VARIABLES

    /// <summary>
    /// The materials that will be set for the teapot model
    /// </summary>
    public Material[] m_TeapotMaterials;
   public AudioSource sentuhkiri;
   public AudioSource sentuhkanan;

    #endregion // PUBLIC_MEMBER_VARIABLES



    #region PRIVATE_MEMBER_VARIABLES
   
    private GameObject mTeapot;
    private List<Material> mActiveMaterials;

    #endregion // PRIVATE_MEMBER_VARIABLES



    #region UNITY_MONOBEHAVIOUR_METHODS

    void Start()
    {
        // Register with the virtual buttons TrackableBehaviour
        VirtualButtonBehaviour[] vbs = GetComponentsInChildren<VirtualButtonBehaviour>();
        for (int i = 0; i < vbs.Length; ++i)
        {
            vbs[i].RegisterEventHandler(this);
        }

        // Get handle to the teapot object
        mTeapot = transform.FindChild("teapot").gameObject;

        // The list of active materials
        mActiveMaterials = new List<Material>();
    }

    #endregion // UNITY_MONOBEHAVIOUR_METHODS



    #region PUBLIC_METHODS
   
    /// <summary>
    /// Called when the virtual button has just been pressed:
    /// </summary>
    public void OnButtonPressed(VirtualButtonAbstractBehaviour vb)
    {
        Debug.Log("OnButtonPressed");
      
        // Add the material corresponding to this virtual button
        // to the active material list:
        switch (vb.VirtualButtonName)
        {
            case "Name":
            sentuhkiri.Play();
                break;

            case "Real":
            sentuhkanan.Play();
                break;
        }
 }


    /// <summary>
    /// Called when the virtual button has just been released:
    /// </summary>
    public void OnButtonReleased(VirtualButtonAbstractBehaviour vb)
    {
       // Remove the material corresponding to this virtual button
        // from the active material list:
        switch (vb.VirtualButtonName)
        {
         case "Name":
            sentuhkiri.Stop();
            break;
            
         case "Real":
            sentuhkanan.Stop();
            break;
        }

        // Apply the next active material, or apply the default material:
    }
    #endregion // PUBLIC_METHODS
}

terdapat error:
Assets/VirtualButtonEventHandler.cs(9,56): error CS0246: The type or namespace name `IVirtualButtonEventHandler' could not be found. Are you missing a using directive or an assembly reference?

bagaimana cara mengatasinya ya bro? Sad Sad Sad Sad Sad
Helpp Me

Thanks Brooo
avatar
loveblue91
Unity3D Newbie
Unity3D Newbie

Posts : 1
Points : 3
Reputation : 0
Join date : 2015-06-02

View user profile

Back to top Go down

Re: [ASK] Help Broooo Unity3D & Viforia

Post  aanimation on Fri Jun 26, 2015 1:36 pm

kliatannya ada fungsi yang dipanggil tapi tidak sesuai namanya
avatar
aanimation
Unity3D Newbie
Unity3D Newbie

Posts : 47
Points : 50
Reputation : 3
Join date : 2014-03-21
Age : 32
Location : Jogjakarta

View user profile https://dl.dropboxusercontent.com/u/25548837/majaGame/version5.h

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum