コード例 #1
0
    /*-------------------------------------------------------------------------
     * Unity Lifecycle Functions
     * ----------------------------------------------------------------------*/
    void Awake()
    {
        // Singleton implementation
        if (_instance != null)
        {
            Debug.LogError(this.ToString() + ": Singleton already exists. Destroying.");
            Destroy(this);
        }
        else
        {
            _instance = this;
        }

        if (!m_FingerTemplate)
        {
            Debug.LogError("No Finger template set!");
            return;
        }
        if (!m_PalmTemplate)
        {
            Debug.LogError("No Palm template set!");
            return;
        }
        CreateSceneHands();
    }
コード例 #2
0
 void OnDestroy()
 {
     // Singleton implementation
     _instance = null;
 }
コード例 #3
0
    /*-------------------------------------------------------------------------
     * Unity Lifecycle Functions
     * ----------------------------------------------------------------------*/
    void Awake()
    {
        // Singleton implementation
        if (_instance != null)
        {
            Debug.LogError(this.ToString() + ": Singleton already exists. Destroying.");
            Destroy(this);
        }
        else
        {
            _instance = this;
        }

        if( !m_FingerTemplate )
        {
            Debug.LogError("No Finger template set!");
            return;
        }
        if( !m_PalmTemplate )
        {
            Debug.LogError("No Palm template set!");
            return;
        }
        CreateSceneHands();
    }
コード例 #4
0
 void OnDestroy()
 {
     // Singleton implementation
     _instance = null;
 }