Exemplo n.º 1
0
    public void My_start()
    {
        if (game_master.game_master_obj)
            my_game_master = (game_master)game_master.game_master_obj.GetComponent("game_master");

        if (my_world_number < my_game_master.total_stages_in_world_n.Length)
        {
            if (my_game_master.stage_screen_generation_selected == game_master.stage_screen_generation.manual)
                {
                my_manage_menu_uGUI = GameObject.Find("Home_Canvas").GetComponent<manage_menu_uGUI>();

                if (my_game_master.total_stages_in_world_n[my_world_number] != stage_icons.Length)
                    Debug.LogError("the number of icons don't match the number of stages in this world ");

                for (int i = 0; i < stage_icons.Length; i++)
                    {
                    stage_icons[i].world_number = my_world_number;
                    stage_icons[i].stage_number = i+1;
                    stage_icons[i].my_manage_menu_uGUI = my_manage_menu_uGUI;
                    stage_icons[i].my_game_master = my_game_master;
                    if ((i+1) <stage_icons.Length)
                        stage_icons[i].next_stage_ico = stage_icons[i+1];
                    stage_icons[i].My_start();
                    }

                Focus_on_first_icon();

                }
            }
    }
Exemplo n.º 2
0
 void Awake()
 {
     LevelMenu2D.Instance.OnItemClicked += HandleOnItemClicked;
     SwipeDetector.OnSwipeLeft          += HandleOnSwipeDown;
     SwipeDetector.OnSwipeRight         += HandleOnSwipeUp;
     gui = GameObject.FindObjectOfType <manage_menu_uGUI>();
 }
Exemplo n.º 3
0
    public void My_start()
    {
        if (game_master.game_master_obj)
        {
            my_game_master = (game_master)game_master.game_master_obj.GetComponent("game_master");
        }

        if (my_world_number < my_game_master.total_stages_in_world_n.Length)
        {
            if (my_game_master.stage_screen_generation_selected == game_master.stage_screen_generation.manual)
            {
                my_manage_menu_uGUI = GameObject.Find("Home_Canvas").GetComponent <manage_menu_uGUI>();

                if (my_game_master.total_stages_in_world_n[my_world_number] != stage_icons.Length)
                {
                    Debug.LogError("the number of icons don't match the number of stages in this world ");
                }

                for (int i = 0; i < stage_icons.Length; i++)
                {
                    stage_icons[i].world_number        = my_world_number;
                    stage_icons[i].stage_number        = i + 1;
                    stage_icons[i].my_manage_menu_uGUI = my_manage_menu_uGUI;
                    stage_icons[i].my_game_master      = my_game_master;
                    if ((i + 1) < stage_icons.Length)
                    {
                        stage_icons[i].next_stage_ico = stage_icons[i + 1];
                    }
                    stage_icons[i].My_start();
                }

                Focus_on_first_icon();
            }
        }
    }
Exemplo n.º 4
0
        void Start()
        {
            Menu = transform.parent.parent.GetComponent <LevelSelectMenu>();
            var texts = Menu.GetComponentsInChildren <Text>();

            foreach (var t in texts)
            {
                if (t.name == "LevelName")
                {
                    LevelNameText = t;
                }
                else if (t.name == "LevelNumber")
                {
                    LevelNumberText = t;
                }
            }
            // LevelNameText = GameObject.Find("LevelName").GetComponent<Text>();
            // LevelNumberText = GameObject.Find("LevelNumber").GetComponent<Text>();
            LevelImage = GetComponentInChildren <Image>();
            LevelImage.raycastTarget = false;
            LevelNameText.text       = LevelName;
            CreateButton();

            OriginScale = LevelImage.GetComponent <RectTransform>().localScale.x;

            gui = GameObject.FindObjectOfType <manage_menu_uGUI>();
        }
Exemplo n.º 5
0
	public void My_start()
	{
		manager_linear_map_obj = this.gameObject;
		DontDestroyOnLoad(manager_linear_map_obj);

		if (stage_icons.Length > 0)
			{
			if (game_master.game_master_obj)
				my_game_master = (game_master)game_master.game_master_obj.GetComponent("game_master");
		
			my_manage_menu_uGUI = GameObject.Find("Home_Canvas").GetComponent<manage_menu_uGUI>();
		
			if (my_game_master.press_start_and_go_to_selected == game_master.press_start_and_go_to.map)//if the map is in use
				{
				if (my_game_master.total_number_of_stages_in_the_game != stage_icons.Length)
					{
						Debug.LogError("the number of icons don't match the total number of stages in the game");
					}
				else
					{
					int temp_current_world = 0;
					int temp_stage_conut = 1;
					for (int i = 0; i < stage_icons.Length; i++)
						{
						//check if this stage icon belong to this world of if you must pass to next world
						if (temp_stage_conut  <= my_game_master.total_stages_in_world_n[temp_current_world])
							{
							//Debug.Log("same world " + temp_current_world +","+temp_stage_conut);
							Update_this_icon(i,temp_current_world,temp_stage_conut);
							temp_stage_conut++;
							}
						else//next world
							{
							temp_current_world++;
							temp_stage_conut = 1;
							//Debug.Log("new world " + temp_current_world +","+temp_stage_conut);
							Update_this_icon(i,temp_current_world,temp_stage_conut);
							temp_stage_conut++;
							}
						}
					
					}
				}

			my_manage_menu_uGUI.stage_screen_target_button = stage_icons[0].gameObject;
			if (this.gameObject.activeSelf)
				my_manage_menu_uGUI.Mark_this_button(my_manage_menu_uGUI.stage_screen_target_button);
			}

	}
Exemplo n.º 6
0
    public void My_start()
    {
        if (stage_icons.Length > 0)
        {
            if (game_master.game_master_obj)
            {
                my_game_master = (game_master)game_master.game_master_obj.GetComponent("game_master");
            }

            my_manage_menu_uGUI = GameObject.Find("Home_Canvas").GetComponent <manage_menu_uGUI>();

            if (my_game_master.press_start_and_go_to_selected == game_master.press_start_and_go_to.map)            //if the map is in use
            {
                if (my_game_master.total_number_of_stages_in_the_game != stage_icons.Length)
                {
                    Debug.LogError("the number of icons don't match the total number of stages in the game");
                }
                else
                {
                    int temp_current_world = 0;
                    int temp_stage_conut   = 1;
                    for (int i = 0; i < stage_icons.Length; i++)
                    {
                        //check if this stage icon belong to this world of if you must pass to next world
                        if (temp_stage_conut <= my_game_master.total_stages_in_world_n[temp_current_world])
                        {
                            //Debug.Log("same world " + temp_current_world +","+temp_stage_conut);
                            Update_this_icon(i, temp_current_world, temp_stage_conut);
                            temp_stage_conut++;
                        }
                        else                        //next world
                        {
                            temp_current_world++;
                            temp_stage_conut = 1;
                            //Debug.Log("new world " + temp_current_world +","+temp_stage_conut);
                            Update_this_icon(i, temp_current_world, temp_stage_conut);
                            temp_stage_conut++;
                        }
                    }
                }
            }
            my_manage_menu_uGUI.stage_screen_target_button = stage_icons[0].gameObject;
            if (this.gameObject.activeSelf)
            {
                my_manage_menu_uGUI.Mark_this_button(my_manage_menu_uGUI.stage_screen_target_button);
            }
        }
    }
Exemplo n.º 7
0
    public void My_start()
    {
        if (game_master.game_master_obj)
            my_game_master = (game_master)game_master.game_master_obj.GetComponent("game_master");

        my_manage_menu_uGUI = GameObject.Find("Home_Canvas").GetComponent<manage_menu_uGUI>();

        if (my_game_master.total_stages_in_world_n.Length != world_icons.Length)
            Debug.LogError("the length of game_master._total_stages_in_world_n and manual_world_screen.world_icons MUST be the same");

        for (int i = 0; i < world_icons.Length; i++)
            {
            world_icons[i].my_number = i;
            world_icons[i].my_manage_menu_uGUI = my_manage_menu_uGUI;
            world_icons[i].my_game_master = my_game_master;
            world_icons[i].My_start();
            }
    }
Exemplo n.º 8
0
    public void My_start()
    {
        if (game_master.game_master_obj)
        {
            my_game_master = (game_master)game_master.game_master_obj.GetComponent("game_master");
        }

        my_manage_menu_uGUI = GameObject.Find("Home_Canvas").GetComponent <manage_menu_uGUI>();

        if (my_game_master.total_stages_in_world_n.Length != world_icons.Length)
        {
            Debug.LogError("the length of game_master._total_stages_in_world_n and manual_world_screen.world_icons MUST be the same");
        }

        for (int i = 0; i < world_icons.Length; i++)
        {
            world_icons[i].my_number           = i;
            world_icons[i].my_manage_menu_uGUI = my_manage_menu_uGUI;
            world_icons[i].my_game_master      = my_game_master;
            world_icons[i].My_start();
        }
    }
Exemplo n.º 9
0
	// Use this for initialization
	void Start () {



		if (game_master.game_master_obj)
			{
			my_game_master = (game_master)game_master.game_master_obj.GetComponent("game_master");
			my_gift_manager.my_game_master = my_game_master;
			//play music menu again
			my_game_master.music_source.enabled  = true;
			if (my_game_master.my_ads_master)
				{
				my_game_master.my_ads_master.my_feedback_window = my_feedback_window;
				my_game_master.my_ads_master.my_gift_manager = my_gift_manager;
				my_game_master.my_ads_master.my_info_bar = info_bar;
				}
			score_ranck_ico.SetActive(true);
//			score_ranck_ico.SetActive(my_game_master.show_int_score_rank);

			if (my_game_master.my_ads_master.enable_ads)
				Check_internet();
			else
				internet_off_ico.SetActive(false); 
			}


		this_script = this.gameObject.GetComponent("manage_menu_uGUI") as manage_menu_uGUI;
		my_options = options_screen.GetComponent<options_menu>();

		//adjust canvas scale
		my_scale = this.gameObject.GetComponent<CanvasScaler>();
		if (my_scale)
			{
			if (my_game_master.press_start_and_go_to_selected == game_master.press_start_and_go_to.map)
				my_scale.matchWidthOrHeight = 0.7f;
			else 
				my_scale.matchWidthOrHeight = 0.75f;
			}

		//stage pages
		stages_screen_manual = new Transform[manual_stage_screens_list.childCount];
		for (int i = 0; i < stages_screen_manual.Length; i++)
			stages_screen_manual[i] = manual_stage_screens_list.GetChild(i);

		Setup_stage_page();


		if (my_game_master.press_start_and_go_to_selected == game_master.press_start_and_go_to.nested_world_stage_select_screen)
			{
			if (my_game_master.total_stages_in_world_n.Length == 1)
				{
				if(my_game_master.stage_screen_generation_selected == game_master.stage_screen_generation.automatic)
					{
					Generate_stage_screen(my_game_master.current_world[my_game_master.current_profile_selected]);
					}

				}
			else
				{
				if (my_game_master.world_screen_generation_selected == game_master.world_screen_generation.automatic)
					Generate_world_screen();
				else if (my_game_master.world_screen_generation_selected == game_master.world_screen_generation.manual)
					my_manual_world_screen.My_start();
				}
			}

		info_bar.Show_info_bar(false);

		if (my_game_master.go_to_this_screen == game_master.this_screen.home_screen)//is this scene not is load from a game stage
		{

			//show logo at the start
			if (logo_screen != null && show_logo_for_n_seconds > 0 && !game_master.logo_already_show)
				{
				Mark_current_screen(logo_screen);
				home_screen.gameObject.SetActive(false);
				game_master.logo_already_show = true;

				if (!my_game_master.show_new_profile_window)
					{
					Update_profile_name(true);
					}
				Invoke("Close_logo",show_logo_for_n_seconds);
				}
			else//don't show logo at the start
				{
				if (!game_master.logo_already_show)
					{
					game_master.logo_already_show = true;
					if (!my_game_master.show_new_profile_window)
						{
						Update_profile_name(true);
						if (my_game_master.my_ads_master.Check_app_start_ad_countdown())
							my_game_master.my_ads_master.Call_ad(my_game_master.my_ads_master.ads_just_after_logo_when_game_start_as_daily_reward);
						}
					}
				//start music when the game start
				my_game_master.Start_music(my_game_master.music_menu,true);
				Show_home_screen();
				}
		}
		else if (my_game_master.go_to_this_screen == game_master.this_screen.stage_screen) //return to home stage from a game stage
		{
			if (my_game_master.show_debug_messages)
				Debug.Log("return to home stage from a game stage");

			home_screen.gameObject.SetActive(false);
			//Update_profile_name(true);
			if (my_game_master.press_start_and_go_to_selected == game_master.press_start_and_go_to.nested_world_stage_select_screen)
				{
				if(my_game_master.stage_screen_generation_selected == game_master.stage_screen_generation.automatic)
					{
					Mark_current_screen(stages_screen_automatic);

					Generate_stage_screen(my_game_master.current_world[my_game_master.current_profile_selected]);

					Mark_this_button(stage_screen_target_button);
					}
				else if (my_game_master.stage_screen_generation_selected == game_master.stage_screen_generation.manual)
					{
					Mark_current_screen(stages_screen_manual[my_game_master.current_world[my_game_master.current_profile_selected]]);
					}
				}
			else if (my_game_master.press_start_and_go_to_selected == game_master.press_start_and_go_to.map)
				{
				Mark_current_screen(map_screen);
				}
			else if (my_game_master.press_start_and_go_to_selected == game_master.press_start_and_go_to.single_screen_with_a_page_for_every_world)
				{
				Mark_current_screen(multi_page_screen);
				}
			else if (my_game_master.press_start_and_go_to_selected == game_master.press_start_and_go_to.straight_to_the_next_game_stage)
				{
				Mark_current_screen(home_screen);
				}

			Update_profile_name(true);

			my_game_master.my_ads_master.Call_ad(my_game_master.my_ads_master.ads_when_return_to_home_scene_from_a_stage);

			//start music when retur to home from a game stage
			my_game_master.Start_music(my_game_master.music_menu,true);

		}
	}
Exemplo n.º 10
0
    // Use this for initialization
    void Start()
    {
        if (game_master.game_master_obj)
        {
            my_game_master = (game_master)game_master.game_master_obj.GetComponent("game_master");
            my_gift_manager.my_game_master = my_game_master;

            if (my_game_master.my_ads_master)
            {
                my_game_master.my_ads_master.my_feedback_window = my_feedback_window;
                my_game_master.my_ads_master.my_gift_manager    = my_gift_manager;
                my_game_master.my_ads_master.my_info_bar        = info_bar;
            }

            score_ranck_ico.SetActive(my_game_master.show_int_score_rank);

            if (my_game_master.my_ads_master.enable_ads)
            {
                Check_internet();
            }
            else
            {
                internet_off_ico.SetActive(false);
            }
        }


        this_script = this.gameObject.GetComponent("manage_menu_uGUI") as manage_menu_uGUI;
        my_options  = options_screen.GetComponent <options_menu>();

        //adjust canvas scale
        my_scale = this.gameObject.GetComponent <CanvasScaler>();
        if (my_scale)
        {
            if (my_game_master.press_start_and_go_to_selected == game_master.press_start_and_go_to.map)
            {
                my_scale.matchWidthOrHeight = 0.7f;
            }
            else
            {
                my_scale.matchWidthOrHeight = 0.75f;
            }
        }

        //stage pages
        stages_screen_manual = new Transform[manual_stage_screens_list.childCount];
        for (int i = 0; i < stages_screen_manual.Length; i++)
        {
            stages_screen_manual[i] = manual_stage_screens_list.GetChild(i);
        }

        Setup_stage_page();


        if (my_game_master.press_start_and_go_to_selected ==
            game_master.press_start_and_go_to.nested_world_stage_select_screen)
        {
            if (my_game_master.total_stages_in_world_n.Length == 1)
            {
                if (my_game_master.stage_screen_generation_selected == game_master.stage_screen_generation.automatic)
                {
                    Generate_stage_screen(my_game_master.current_world[my_game_master.current_profile_selected]);
                }
            }
            else
            {
                if (my_game_master.world_screen_generation_selected == game_master.world_screen_generation.automatic)
                {
                    Generate_world_screen();
                }
                else if (my_game_master.world_screen_generation_selected == game_master.world_screen_generation.manual)
                {
                    my_manual_world_screen.My_start();
                }
            }
        }

        info_bar.Show_info_bar(false);

        if (my_game_master.go_to_this_screen == game_master.this_screen.home_screen)
        //is this scene not is load from a game stage
        {
            //show logo at the start
            if (logo_screen != null && show_logo_for_n_seconds > 0 && !game_master.logo_already_show)
            {
                Mark_current_screen(logo_screen);
                home_screen.gameObject.SetActive(false);
                game_master.logo_already_show = true;

                if (!my_game_master.show_new_profile_window)
                {
                    Update_profile_name(true);
                }
                Invoke("Close_logo", show_logo_for_n_seconds);
            }
            else //don't show logo at the start
            {
                if (!game_master.logo_already_show)
                {
                    game_master.logo_already_show = true;
                    if (!my_game_master.show_new_profile_window)
                    {
                        Update_profile_name(true);
                        if (my_game_master.my_ads_master.Check_app_start_ad_countdown())
                        {
                            my_game_master.my_ads_master.Call_ad(
                                my_game_master.my_ads_master.ads_just_after_logo_when_game_start_as_daily_reward);
                        }
                    }
                }
                //start music when the game start
                my_game_master.Start_music(my_game_master.music_menu, true);
                Show_home_screen();
            }
        }
        else if (my_game_master.go_to_this_screen == game_master.this_screen.stage_screen)
        //return to home stage from a game stage
        {
            if (my_game_master.show_debug_messages)
            {
                Debug.Log("return to home stage from a game stage");
            }

            home_screen.gameObject.SetActive(false);
            //Update_profile_name(true);
            if (my_game_master.press_start_and_go_to_selected ==
                game_master.press_start_and_go_to.nested_world_stage_select_screen)
            {
                if (my_game_master.stage_screen_generation_selected == game_master.stage_screen_generation.automatic)
                {
                    //Mark_current_screen(stages_screen_automatic);
                    Go_to_this_world_stage_menu(
                        my_game_master.current_world[my_game_master.current_profile_selected]);
                    //Generate_stage_screen(my_game_master.current_world[my_game_master.current_profile_selected]);

                    Mark_this_button(stage_screen_target_button);
                }
                else if (my_game_master.stage_screen_generation_selected ==
                         game_master.stage_screen_generation.manual)
                {
                    Mark_current_screen(
                        stages_screen_manual[
                            my_game_master.current_world[my_game_master.current_profile_selected]]);
                }
            }
            else if (my_game_master.press_start_and_go_to_selected == game_master.press_start_and_go_to.map)
            {
                Mark_current_screen(map_screen);
            }
            else if (my_game_master.press_start_and_go_to_selected ==
                     game_master.press_start_and_go_to.single_screen_with_a_page_for_every_world)
            {
                Mark_current_screen(multi_page_screen);
            }
            else if (my_game_master.press_start_and_go_to_selected ==
                     game_master.press_start_and_go_to.straight_to_the_next_game_stage)
            {
                Mark_current_screen(home_screen);
            }
            else if (my_game_master.press_start_and_go_to_selected == game_master.press_start_and_go_to.level_select_screen)
            {
                if (my_game_master.show_debug_messages)
                {
                    Debug.Log("return to home stage from a game stage");
                }

                Mark_current_screen(level_sclect_screen);
            }

            Update_profile_name(true);

            my_game_master.my_ads_master.Call_ad(
                my_game_master.my_ads_master.ads_when_return_to_home_scene_from_a_stage);

            //start music when retur to home from a game stage
            my_game_master.Start_music(my_game_master.music_menu, true);
        }
    }
Exemplo n.º 11
0
	void Start () {
		int max_stages_in_a_world = 15;
		//save game
		GooglePlaySavedGamesManager.ActionNewGameSaveRequest += ActionNewGameSaveRequest;
		GooglePlaySavedGamesManager.ActionGameSaveLoaded += ActionGameSaveLoaded;
		GooglePlaySavedGamesManager.ActionConflict += ActionConflict;

		if(GooglePlayConnection.State == GPConnectionState.STATE_CONNECTED) {
			//GooglePlayConnection.Instance.Disconnect ();
			
		} else {
			GooglePlayConnection.Instance.Connect ();
		}


		if (functioncalled != "ShareFB" || functioncalled != "LikePage" || functioncalled != "RateDialogPopUp"  || functioncalled !="showAchievementsUI") {
			if (callfunction) {
				Invoke (functioncalled, 0);
			}
		}
		my_game_master = (game_master)game_master.game_master_obj.GetComponent("game_master");
		if (Application.loadedLevelName == "Home") {
			my_manage_menu_uGUI = GameObject.Find ("Home_Canvas").GetComponent<manage_menu_uGUI> ();
		}


		world_playable = new bool[1][];
		world_purchased = new bool[1][];
		stage_playable = new bool[1][,];
		stage_solved = new bool[1][,];
		all_stages_solved = new bool[1];
		dot_tail_turn_on = new bool[1][,];
		stage_stars_score = new int[1][,];
		star_score_in_this_world = new int[1][];
		stars_total_score = new int[1];
		best_int_score_in_this_stage = new int[1][,];
		best_int_score_for_current_player = new int[1];
		
		incremental_item_current_level= new int[1][];
		
		consumable_item_current_quantity = new int[1][];
		
		for (int i = 0; i < 1; i++)
		{
			incremental_item_current_level[i] = new int[my_game_master.my_store_item_manager.incremental_item_list.Length];
			
			consumable_item_current_quantity[i] = new int[my_game_master.my_store_item_manager.consumable_item_list.Length];
			
			world_playable[i] = new bool[my_game_master.total_stages_in_world_n.Length];
			world_purchased[i] = new bool[my_game_master.total_stages_in_world_n.Length];
			stage_playable[i] = new bool[my_game_master.total_stages_in_world_n.Length,max_stages_in_a_world];
			stage_solved[i] = new bool[my_game_master.total_stages_in_world_n.Length,max_stages_in_a_world];
			stage_stars_score[i] = new int[my_game_master.total_stages_in_world_n.Length,max_stages_in_a_world];
			star_score_in_this_world[i] = new int[my_game_master.total_stages_in_world_n.Length];
			best_int_score_in_this_stage[i] = new int[my_game_master.total_stages_in_world_n.Length,max_stages_in_a_world]; 
			dot_tail_turn_on[i] = new bool[my_game_master.total_stages_in_world_n.Length,max_stages_in_a_world];
			
			//this_profile_have_a_save_state_in_it[i] = Convert.ToBoolean(PlayerPrefs.GetInt("profile_"+i.ToString()+"_have_a_save_state_in_it")) ;
			/*if (my_store_item_manager)
			{
				incremental_item_current_level[i] = new int[my_store_item_manager.incremental_item_list.Length]; 
				consumable_item_current_quantity[i] = new int[my_store_item_manager.consumable_item_list.Length];
			}*/
		}
	//	SPFacebook.Instance.OnInitCompleteAction += OnInit;
	//	SPFacebook.Instance.OnFocusChangedAction += OnFocusChanged;
		
		
	//	SPFacebook.Instance.OnAuthCompleteAction += OnAuth;
		
		
		
	//	SPFacebook.Instance.OnPostingCompleteAction += OnPost;

		
	//	SPFacebook.Instance.Init();


	
	}