void getAllComponentsRef() { GameObject question = GameObject.Find("Question"); questionLoader = (NF_QuestionLoader)question.GetComponent <NF_QuestionLoader>(); GameObject trail = GameObject.Find("Drag_Trail"); dragTrail = (NF_DragTrail)trail.GetComponent <NF_DragTrail>(); ropesGenerator = (NF_RopesGenerator)this.GetComponent <NF_RopesGenerator>(); inputController = (NF_InputController)this.GetComponent <NF_InputController>(); // select skill id On random if (AGGameState.currentGameIndex == (int)AGGameIndex.k_NamingFruits) { currentCategoryID = (int)Random.Range((int)NamingFruits_CategoryID.id_Food, (int)NamingFruits_CategoryID.id_AlplabeticOrder + 1); backgroundsCount = 4; backgroundArray = new string[] { "Green", "Orange", "Blue", "Sunrise" }; foregroundArray = new string[] { "Top-Green-Back", "Top-Orange-Back", "Top-Blue-Back", "Top-Sunrise-Back" }; frontLayerArray = new string[] { "Top-Green-Front", "Top-Orange-Front", "Top-Blue-Front", "Top-Sunrise-Front" }; dataManager = new JW_DataManager(AGGameIndex.k_NamingFruits, currentCategoryID, _progressionList.text); dataManager.loadCategoryResources(_resourcesData.text); dataManager.currentLevel = 1; dataManager.fetchLevelData(); } else if (AGGameState.currentGameIndex == (int)AGGameIndex.k_2DShapesColors) { currentCategoryID = (int)Random.Range((int)SimpleColors_CategoryID.id_Colors, (int)SimpleColors_CategoryID.id_2DShapes + 1); backgroundsCount = 2; backgroundArray = new string[] { "Pink", "Purple" }; foregroundArray = new string[] { "Pink-Back-Frill", "Purple-Back-Frill" }; frontLayerArray = new string[] { "Pink-Front-Frill", "Purple-Front-Frill" }; dataManager = new JW_DataManager(AGGameIndex.k_2DShapesColors, currentCategoryID, _progressionList.text); dataManager.loadCategoryResources(_resourcesData.text); dataManager.currentLevel = 1; dataManager.fetchLevelData(); } Debug.Log("NF_Skill ID:" + currentCategoryID); }
// Use this for initialization void Start() { pgDataManager = new JW_DataManager (AGGameIndex.k_ShapePond,(int)SkillID.skill_1,plist.text); // Here 1 is the game Index, O is the first skill in available skills //----------- Scale Factor float screenResolution=Screen.currentResolution.width; scaleFactor=screenResolution/PG_Constants.PG_SCREEN_WIDTH; //-------- Refrences of the Objects controlled by GameController GameObject shapesRef = GameObject.FindGameObjectWithTag("pg_shapes_container"); GameObject islandRef = GameObject.FindGameObjectWithTag("pg_island"); olly = GameObject.FindGameObjectWithTag("pg_olly"); icky = GameObject.FindGameObjectWithTag("pg_icky"); referent_bubble = GameObject.FindGameObjectWithTag("pg_referent_bubble"); referent_shape = GameObject.FindGameObjectWithTag("pg_referent_shape"); referent_hint = GameObject.FindGameObjectWithTag("pg_referent_hint"); referent_shapeWithHint = GameObject.FindGameObjectWithTag("pg_referent_shapeWithHint"); background_object = GameObject.Find("Backgrounds"); land = GameObject.Find("Land"); olly_referent_Container = GameObject.Find("OllyReferentContainer"); cross_tick_sign = GameObject.Find("cross_tick_sign"); // --------- Initialize script refrences if(shapesRef!=null) shapesControllerSR = shapesRef.GetComponent<PG_ShapesController>(); if(shapesRef!=null) soundManager = shapesRef.GetComponent<PG_SoundManager>(); if(islandRef!=null) islandControllerSR = islandRef.GetComponent<PG_IslandController>(); if(shapesRef!=null) shapeContainerStatControllerSR = shapesRef.GetComponent<PG_ShapeContainerStatController>(); if(olly_referent_Container!=null) ollyReferentControllerSR = olly_referent_Container.GetComponent<PG_OllyController>(); //else Debug.Log("ollyReferentControllerSR is NULL!"); if(olly!=null) ollyAnimationsSR = olly.GetComponent<PG_OllyAnimations>(); if(icky!=null) ickyControllerSR = icky.GetComponent<PG_IckyController>(); if(icky!=null) ickyAnimationsSR = icky.GetComponent<PG_IckyAnimations>(); if(referent_bubble!=null) referentBubbleControllerSR = referent_bubble.GetComponent<PG_ReferentBubble_Controller>(); if(referent_shape!=null) referentShapeControllerSR = referent_shape.GetComponent<PG_ReferentShape_Controller>(); if(referent_hint!=null) referentHintControllerSR = referent_hint.GetComponent<PG_Referent_ShapeHint>(); if(background_object!=null) backgroundControllerSR = background_object.GetComponent<PG_BackgroundController>(); if(land!=null) landControllerSR = land.GetComponent<PG_LandController>(); //else Debug.Log("Land Null"); // ----- loadLevel(); cross_tick_sign.transform.renderer.enabled=false; enableTouches(); // ----- Repeat question if user didn't played for 10 sec // InvokeRepeating("playQuestionInstructionVO",6, 10F); }
// Use this for initialization void Start() { pgDataManager = new JW_DataManager(AGGameIndex.k_ShapePond, (int)SkillID.skill_1, plist.text); // Here 1 is the game Index, O is the first skill in available skills //----------- Scale Factor float screenResolution = Screen.currentResolution.width; scaleFactor = screenResolution / PG_Constants.PG_SCREEN_WIDTH; //-------- Refrences of the Objects controlled by GameController GameObject shapesRef = GameObject.FindGameObjectWithTag("pg_shapes_container"); GameObject islandRef = GameObject.FindGameObjectWithTag("pg_island"); olly = GameObject.FindGameObjectWithTag("pg_olly"); icky = GameObject.FindGameObjectWithTag("pg_icky"); referent_bubble = GameObject.FindGameObjectWithTag("pg_referent_bubble"); referent_shape = GameObject.FindGameObjectWithTag("pg_referent_shape"); referent_hint = GameObject.FindGameObjectWithTag("pg_referent_hint"); referent_shapeWithHint = GameObject.FindGameObjectWithTag("pg_referent_shapeWithHint"); background_object = GameObject.Find("Backgrounds"); land = GameObject.Find("Land"); olly_referent_Container = GameObject.Find("OllyReferentContainer"); cross_tick_sign = GameObject.Find("cross_tick_sign"); // --------- Initialize script refrences if (shapesRef != null) { shapesControllerSR = shapesRef.GetComponent <PG_ShapesController>(); } if (shapesRef != null) { soundManager = shapesRef.GetComponent <PG_SoundManager>(); } if (islandRef != null) { islandControllerSR = islandRef.GetComponent <PG_IslandController>(); } if (shapesRef != null) { shapeContainerStatControllerSR = shapesRef.GetComponent <PG_ShapeContainerStatController>(); } if (olly_referent_Container != null) { ollyReferentControllerSR = olly_referent_Container.GetComponent <PG_OllyController>(); } //else Debug.Log("ollyReferentControllerSR is NULL!"); if (olly != null) { ollyAnimationsSR = olly.GetComponent <PG_OllyAnimations>(); } if (icky != null) { ickyControllerSR = icky.GetComponent <PG_IckyController>(); } if (icky != null) { ickyAnimationsSR = icky.GetComponent <PG_IckyAnimations>(); } if (referent_bubble != null) { referentBubbleControllerSR = referent_bubble.GetComponent <PG_ReferentBubble_Controller>(); } if (referent_shape != null) { referentShapeControllerSR = referent_shape.GetComponent <PG_ReferentShape_Controller>(); } if (referent_hint != null) { referentHintControllerSR = referent_hint.GetComponent <PG_Referent_ShapeHint>(); } if (background_object != null) { backgroundControllerSR = background_object.GetComponent <PG_BackgroundController>(); } if (land != null) { landControllerSR = land.GetComponent <PG_LandController>(); } //else Debug.Log("Land Null"); // ----- loadLevel(); cross_tick_sign.transform.renderer.enabled = false; enableTouches(); // ----- Repeat question if user didn't played for 10 sec // InvokeRepeating("playQuestionInstructionVO",6, 10F); }
void getAllComponentsRef() { GameObject question = GameObject.Find("Question"); questionLoader = (NF_QuestionLoader) question.GetComponent<NF_QuestionLoader>(); GameObject trail = GameObject.Find("Drag_Trail"); dragTrail = (NF_DragTrail) trail.GetComponent<NF_DragTrail>(); ropesGenerator = (NF_RopesGenerator) this.GetComponent<NF_RopesGenerator>(); inputController = (NF_InputController) this.GetComponent<NF_InputController>(); // select skill id On random if(AGGameState.currentGameIndex == (int) AGGameIndex.k_NamingFruits){ currentCategoryID=(int)Random.Range((int)NamingFruits_CategoryID.id_Food,(int)NamingFruits_CategoryID.id_AlplabeticOrder+1); backgroundsCount=4; backgroundArray = new string[] {"Green","Orange","Blue","Sunrise"}; foregroundArray = new string[] {"Top-Green-Back","Top-Orange-Back","Top-Blue-Back","Top-Sunrise-Back"}; frontLayerArray = new string[] {"Top-Green-Front","Top-Orange-Front","Top-Blue-Front","Top-Sunrise-Front"}; dataManager = new JW_DataManager(AGGameIndex.k_NamingFruits,currentCategoryID,_progressionList.text); dataManager.loadCategoryResources(_resourcesData.text); dataManager.currentLevel=1; dataManager.fetchLevelData(); } else if(AGGameState.currentGameIndex == (int) AGGameIndex.k_2DShapesColors){ currentCategoryID= (int)Random.Range((int)SimpleColors_CategoryID.id_Colors,(int)SimpleColors_CategoryID.id_2DShapes+1); backgroundsCount=2; backgroundArray = new string[] {"Pink","Purple"}; foregroundArray = new string[] {"Pink-Back-Frill","Purple-Back-Frill"}; frontLayerArray = new string[] {"Pink-Front-Frill","Purple-Front-Frill"}; dataManager = new JW_DataManager(AGGameIndex.k_2DShapesColors,currentCategoryID,_progressionList.text); dataManager.loadCategoryResources(_resourcesData.text); dataManager.currentLevel=1; dataManager.fetchLevelData(); } Debug.Log("NF_Skill ID:" + currentCategoryID); }