コード例 #1
0
ファイル: Player.cs プロジェクト: xiashj96/Ahhhhh
    public void ThrowStuff(float force, Stuffs stuff)
    {
        // 扔东西
        Debug.LogFormat("Player {0} throws stuff with force {1}", (who == Players.Left) ? 1 : 2, force);
        GameObject stuffPrefab;

        switch (stuff)
        {
        case Stuffs.Ball: stuffPrefab = ballPrefab; break;

        case Stuffs.Fish: stuffPrefab = fishPrefab; break;

        case Stuffs.Sword: stuffPrefab = swordPrefab; break;

        case Stuffs.Shit: stuffPrefab = shitPrefab; break;

        default: stuffPrefab = null; break;
        }

        Instantiate <GameObject>(stuffPrefab, thrower.transform.position, Quaternion.identity)
        .GetComponent <Rigidbody2D>().AddForce(direction * ((force + 0.1f) / 1.1f * forceMultiplier));

        // 动画
        anim.SetTrigger("Attack");
    }
コード例 #2
0
 public override bool Equals(object obj)
 {
     return(obj is TestInstance instance &&
            Q == instance.Q &&
            Paging == instance.Paging &&
            Stuff == instance.Stuff &&
            instance.Stuffs.All(item => Stuffs.Contains(item)) &&
            instance.SupposedlyEmpty == null &&
            instance.ConcreteList.All(item => ConcreteList.Contains(item)) &&
            Q2 == instance.Q2);
 }
コード例 #3
0
        private async void BindProperties(Vouchers voucher)
        {
            if (voucher != null)
            {
                Voucher = voucher;
            }

            Clients = await GetClients();

            Hotels = await GetHotels();

            RestTypes = await GetRestTypes();

            AdditionalServices = await GetAdditionalServices();

            Stuffs = await GetStuffs();

            PaymentStatuses = new List <string> {
                "Оплачено", "Не оплачено"
            };
            BookingStatuses = new List <string> {
                "Забронирован", "Не забронирован"
            };

            if (_handleType == HandleType.Add)
            {
                return;
            }
            Client        = Clients.FirstOrDefault(p => Voucher.ClientId == p.Id);
            Hotel         = Hotels.FirstOrDefault(p => Voucher.HotelId == p.Id);
            RestType      = RestTypes.FirstOrDefault(p => Voucher.RestTypeId == p.Id);
            Stuff         = Stuffs.FirstOrDefault(p => Voucher.StuffId == p.Id);
            PaymentStatus = Voucher.PaymentStatus;
            BookingStatus = Voucher.BookingStatus;
            StartDate     = Voucher.StartDate;
            EndDate       = Voucher.EndDate;

            AdditionalService1 = AdditionalServices.FirstOrDefault(p => Voucher.AdditService1Id == p.Id);
            AdditionalService2 = AdditionalServices.FirstOrDefault(p => Voucher.AdditService2Id == p.Id);
            AdditionalService3 = AdditionalServices.FirstOrDefault(p => Voucher.AdditService3Id == p.Id);
        }
コード例 #4
0
ファイル: stfmanager.cs プロジェクト: mayifighting/.net
        public static string login_(Stuff stf)
        {
            string str = Stuffs.login(stf);

            return(str);
        }