示例#1
0
    private void Init()
    {
        m_selectItems      = new List <GameObject>();
        m_selectItemsNames = new List <string>();

        m_itemHolder  = (GameObject)Resources.Load(Constants.ROW_ITEM_NAME);
        m_rowsManager = GameObject.Find(Constants.ROW_MANAGER_NAME).GetComponent <RowsManager>();
        m_cover       = GameObject.Find(Constants.SELECT_ITEMS_COVER);
        m_showReel    = GameObject.Find(Constants.SHOW_REEL_NAME).GetComponent <ShowReelScript>();

        m_kinectGestureListener = Camera.main.GetComponent <KinectGestureListener>();
        m_kinectManager         = Camera.main.GetComponent <KinectManager>();

        AddSounds();
    }
    void Start()
    {
        m_frames = new List <GameObject>();

        // save all game objects here, to instantiate later.
        for (int i = 0; i < Constants.SHOW_REEL_FRAME_NAMES.Count; i++)
        {
            m_frames.Add((GameObject)Resources.Load(Constants.SHOW_REEL_FRAME_NAMES[i]));
        }

        // save the plane game object here.
        m_picturePlane          = (GameObject)Resources.Load(Constants.FRAME_PLANE_NAME);
        m_started               = false;
        m_showReelItems         = new List <GameObject>();
        m_rowsManager           = GameObject.Find(Constants.ROW_MANAGER_NAME).GetComponent <RowsManager>();
        m_currentPicture        = 0;
        m_kinectGestureListener = Camera.main.GetComponent <KinectGestureListener>();
    }
    private IEnumerator StartScripts()
    {
        yield return(new WaitForSeconds(Constants.SECONDS_BEFORE_INIT_SCRIPTS));

        // point to a game object.
        GameObject sampleObject;

        // Start Picture Loader.
        sampleObject = new GameObject(Constants.PICTURE_LOADER_NAME);
        sampleObject.AddComponent <PictureLoader>();
        m_pictureLoader = sampleObject.GetComponent <PictureLoader>();

        // Start Rows Manager.
        sampleObject = new GameObject(Constants.ROW_MANAGER_NAME);
        sampleObject.AddComponent <RowsManager>();
        m_rowsManager = sampleObject.GetComponent <RowsManager>();
        sampleObject.transform.parent = transform;

        // Start Select Items Manager.
        sampleObject = new GameObject(Constants.SELECT_ITEMS_MANAGER_NAME);
        sampleObject.AddComponent <SelectItemsManager>();
        sampleObject.transform.parent = transform;
        m_selectItemsManager          = sampleObject.GetComponent <SelectItemsManager>();

        // Start Show Reel.
        sampleObject = new GameObject(Constants.SHOW_REEL_NAME);
        sampleObject.AddComponent <ShowReelScript>();
        sampleObject.transform.parent = transform;
        m_showReel = sampleObject.GetComponent <ShowReelScript>();

        // Start Kinect Input.
        m_kinectMouseInput = new GameObject(Constants.KINECT_MOUSE_INPUT_NAME);
        m_kinectMouseInput.AddComponent <KinectMouseInput>();

        // and finally, lock mouse.
        Global.lockMouse = true;
    }
示例#4
0
 void Start()
 {
     m_selectItemManager = GameObject.Find(Constants.SELECT_ITEMS_MANAGER_NAME).GetComponent <SelectItemsManager>();
     m_rowsManager       = GameObject.Find(Constants.ROW_MANAGER_NAME).GetComponent <RowsManager>();
 }