상속: MonoBehaviour
예제 #1
0
        private async void Drop(Item item, string slot, drop mode)
        {
            UserDialogs.Instance.ShowLoading("Я же говорил что хуйня");
            switch (slot)
            {
            case "weapon1":
                Player.active_weapon1 = "";
                if (mode == drop.toBackpack)
                {
                    Player.weapon_ids = Player.weapon_ids.Insert(Player.weapon_ids.Length, ";" + item.id);
                }
                weapon1_frame.Content = null;

                break;

            case "weapon2":
                Player.active_weapon2 = "";
                if (mode == drop.toBackpack)
                {
                    Player.weapon_ids = Player.weapon_ids.Insert(Player.weapon_ids.Length, ";" + item.id);
                }
                weapon2_frame.Content = null;

                break;

            case "helmet":
                Player.active_helmet = "";
                //if (mode == drop.toBackpack)
                //Player.weapon_ids = Player.weapon_ids.Insert(Player.weapon_ids.Length, ";" + item.id);

                break;

            case "armor":
                Player.active_armor = "";
                //if (mode == drop.toBackpack)
                //Player.weapon_ids = Player.weapon_ids.Insert(Player.weapon_ids.Length, ";" + item.id);

                break;

            case "boots":
                Player.active_boots = "";
                //if (mode == drop.toBackpack)
                //Player.weapon_ids = Player.weapon_ids.Insert(Player.weapon_ids.Length, ";" + item.id);

                break;

            default:
                await DisplayAlert("", slot, "OK");

                break;
            }
            await RefreshPlayer();

            UserDialogs.Instance.HideLoading();
        }
예제 #2
0
    private void OnCollisionEnter2D(Collision2D collision)
    {
        drop drop = collision.gameObject.GetComponent <drop>();

        if (drop != null)
        {
            Debug.Log("pop it?");

            if (drop.type == 1 && metal)
            {
                Score(drop);
            }
            else

            if (drop.type == 2 && glass)
            {
                Score(drop);
            }
            else
            {
                drop.Respawn();
            }
        }
    }
예제 #3
0
 void Score(drop drop)
 {
     GameObject.Destroy(drop.gameObject);
 }