void FingureGestures_OnTap(Vector2 fingurePos, int tapCount)
 {
     RaycastHit hit;
     Ray ray;
     ray = Camera.main.ScreenPointToRay(fingurePos);
        	if(Physics.Raycast(ray, out hit,10000)){
         GameObject iconSelected = hit.transform.gameObject;
         gameIconScript = (JW_GameIcon)iconSelected.GetComponent<JW_GameIcon>();
         if(gameIconScript){
             gameIconScript.goToGame();
             }
     }
 }
Exemple #2
0
    void FingureGestures_OnTap(Vector2 fingurePos, int tapCount)
    {
        RaycastHit hit;
        Ray        ray;

        ray = Camera.main.ScreenPointToRay(fingurePos);
        if (Physics.Raycast(ray, out hit, 10000))
        {
            GameObject iconSelected = hit.transform.gameObject;
            gameIconScript = (JW_GameIcon)iconSelected.GetComponent <JW_GameIcon>();
            if (gameIconScript)
            {
                gameIconScript.goToGame();
            }
        }
    }
Exemple #3
0
    void createGameIcons()
    {
        string  textureName;
        Vector3 iconPosition;

        foreach (DictionaryEntry entry in gameIconsTable)
        {
            GameObject gameIcon = Instantiate(gameIconPrefab) as GameObject;
            gameIconScript = (JW_GameIcon)gameIcon.GetComponent <JW_GameIcon>();
            _gameIconIndex = (AGGameIndex)System.Convert.ToInt32(entry.Key);
            textureName    = (string)entry.Value;
            iconPosition   = gameIconPositions();
            gameIconScript.gameIconInitializer((int)_gameIconIndex, textureName, iconPosition);
            _gameIcons.Add(gameIcon);

            GameObject label = Instantiate(nameLabelPrefab) as GameObject;
            if (_gameIconIndex == AGGameIndex.k_ShapePond)
            {
                label.renderer.material    = labelPondGameMat;
                label.transform.position   = new Vector3(3, 10, -150);
                label.transform.localScale = new Vector3(160, 28, 1);
            }
            else if (_gameIconIndex == AGGameIndex.k_NamingFruits)
            {
                label.renderer.material    = labelFruitGameMat;
                label.transform.position   = new Vector3(-262, 10, -150);
                label.transform.localScale = new Vector3(160, 28, 1);
            }
            else if (_gameIconIndex == AGGameIndex.k_MemoryAnimal)
            {
                label.renderer.material    = labelMemoryAnimalMat;
                label.transform.position   = new Vector3(262, 10, -150);
                label.transform.localScale = new Vector3(160, 28, 1);
            }
            else if (_gameIconIndex == AGGameIndex.k_2DShapesColors)
            {
                label.renderer.material    = label2DShapesMat;
                label.transform.position   = new Vector3(-265, -224, -150);
                label.transform.localScale = new Vector3(160, 28, 1);
            }
        }
    }
    void createGameIcons()
    {
        string textureName;
        Vector3 iconPosition;

        foreach(DictionaryEntry entry in gameIconsTable){

        GameObject gameIcon =Instantiate(gameIconPrefab) as GameObject;
        gameIconScript = (JW_GameIcon)gameIcon.GetComponent<JW_GameIcon>();
        _gameIconIndex = (AGGameIndex)System.Convert.ToInt32(entry.Key);
        textureName = (string)entry.Value;
        iconPosition = gameIconPositions();
        gameIconScript.gameIconInitializer((int)_gameIconIndex, textureName, iconPosition);
        _gameIcons.Add(gameIcon);

            GameObject label = Instantiate(nameLabelPrefab) as GameObject;
            if(_gameIconIndex == AGGameIndex.k_ShapePond) {
                label.renderer.material = labelPondGameMat;
                label.transform.position = new Vector3(3,10,-150);
                label.transform.localScale = new Vector3(160, 28, 1);
            } else if(_gameIconIndex == AGGameIndex.k_NamingFruits) {
                label.renderer.material = labelFruitGameMat;
                label.transform.position = new Vector3(-262,10,-150);
                label.transform.localScale = new Vector3(160, 28, 1);
            } else if(_gameIconIndex == AGGameIndex.k_MemoryAnimal) {
                label.renderer.material = labelMemoryAnimalMat;
                label.transform.position = new Vector3(262,10,-150);
                label.transform.localScale = new Vector3(160, 28, 1);
            }
            else if(_gameIconIndex == AGGameIndex.k_2DShapesColors) {
                label.renderer.material = label2DShapesMat;
                label.transform.position = new Vector3(-265,-224,-150);
                label.transform.localScale = new Vector3(160, 28, 1);
            }
        }
    }