/// mono-behavior initialization
    void Start()
    {
        if (m_manager == null)
        {
            m_manager = FindObjectOfType(typeof(NISkeletonUsersManager)) as NISkeletonUsersManager;
        }

        if (m_playerMapper == null)
        {
            m_playerMapper = FindObjectOfType(typeof(NIUsersToPlayerMapper)) as NIUsersToPlayerMapper;
        }

        m_basePos = new Rect(0, Screen.height / 2, 200, 30);
    }
示例#2
0
    /// @brief mono-behavior start for initialization
    void Start()
    {
        m_mode = SkeletonGUIModes.SkeletonMode;
        // initialize all the external links
        if (m_input == null)
        {
            m_input = FindObjectOfType(typeof(NIInput)) as NIInput;
            if (m_input == null)
            {
                throw new System.Exception("Please add an NIInput object to the scene");
            }
        }
        if (m_skeletonManager == null)
        {
            m_skeletonManager = FindObjectOfType(typeof(NISkeletonUsersManager)) as NISkeletonUsersManager;
            if (m_skeletonManager == null)
            {
                throw new System.Exception("Please add an NISkeletonUsersManager object to the scene");
            }
        }

        if (m_settings == null)
        {
            m_settings = FindObjectOfType(typeof(OpenNISettingsManager)) as OpenNISettingsManager;
            if (m_settings == null)
            {
                throw new System.Exception("Please add an OpenNISettingsManager object to the scene");
            }
        }
        // a rect used later, this is mainly an initialization
        tempRect        = new Rect();
        tempRect.x      = Screen.width / 2 - 60;
        tempRect.y      = Screen.height / 2 - 20;
        tempRect.width  = 120;
        tempRect.height = 40;

        NIGUI.SetActive(false); // we don't want to see the cursor yet so we deactivate NIGUI
    }