当前位置: 首页>>代码示例>>C#>>正文


C# Static类代码示例

本文整理汇总了C#中Static的典型用法代码示例。如果您正苦于以下问题:C# Static类的具体用法?C# Static怎么用?C# Static使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Static类属于命名空间,在下文中一共展示了Static类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PreviewHouse

		public PreviewHouse( int multiID ) : base( multiID | 0x8000 )
		{
			m_Components = new List<Item>();

			MultiComponentList mcl = this.Components;

			for ( int i = 1; i < mcl.List.Length; ++i )
			{
				MultiTileEntry entry = mcl.List[i];

				if ( entry.m_Flags == 0 )
				{
					#region SA
					Item item = new Static( entry.m_ItemID & 0x7FFF );
					#endregion

					item.MoveToWorld( new Point3D( X + entry.m_OffsetX, Y + entry.m_OffsetY, Z + entry.m_OffsetZ ), Map );

					m_Components.Add( item );
				}
			}

			m_Timer = new DecayTimer( this );
			m_Timer.Start();
		}
开发者ID:PepeBiondi,项目名称:runsa,代码行数:25,代码来源:PreviewHouse.cs

示例2: OphidianArchmage

		public OphidianArchmage() : base( AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4 )
		{
			LastTimeSpoken = DateTime.Now;
			Name = m_Names[Utility.Random( m_Names.Length )];
			Body = 85;
			SpeechHue = 2129;
			BaseSoundID = 639;

			SetStr( 281, 305 );
			SetDex( 191, 215 );
			SetInt( 226, 250 );

			SetHits( 169, 183 );
			SetStam( 36, 45 );

			SetDamage( 5, 10 );

			SetSkill( SkillName.EvalInt, 95.1, 120.0 );
			SetSkill( SkillName.Magery, 95.1, 100.0 );
			SetSkill( SkillName.MagicResist, 75.0, 97.5 );
			SetSkill( SkillName.Tactics, 65.0, 87.5 );
			SetSkill( SkillName.Wrestling, 20.2, 60.0 );

			Fame = 11500;
			Karma = -11500;

			VirtualArmor = 44;

			Item item = null;
			switch( Utility.Random(1000) )
		{
			case 0: PackItem( item = new Static(0x1E92) ); break;
			case 1: PackItem( item = new Static(0x1E93) ); break;
		}
			if (item != null)
			item.Movable = true;

			PackGold( 450, 500 );
			PackScroll( 0, 8 );
			PackScroll( 0, 8 );
			PackScroll( 0, 8 );

					switch ( Utility.Random( 2 ) )
			{
				case 0: PackWeapon( 0, 5 ); break;
				case 1: PackArmor( 0, 5 ); break;
			}

			switch ( Utility.Random( 5 ) )
			{
				case 0: PackWeapon( 1, 5 ); break;
				case 1: PackArmor( 1, 5 ); break;
			}

				if ( 0.10 > Utility.RandomDouble() )
					PackItem( new Arrow( Utility.RandomMinMax( 150, 250 ) ) );

				if ( 0.01 > Utility.RandomDouble() )
					PackItem( new InvisCloak() );
		}
开发者ID:kamronbatman,项目名称:DefianceUO-Pre1.10,代码行数:60,代码来源:OphidianArchmage.cs

示例3: Start

    private Static save; //日数、起動回数、HP、MP、名声、ボーナスポイント

    #endregion Fields

    #region Methods

    // Use this for initialization
    void Start()
    {
        save = GetComponent<Static>();
        Canvas = GameObject.Find ("Canvas");
        //if (save.GetDay () == 1) {

            Canvas.GetComponent<uGUI_Msg>().dispMessage(EventText[0]);

        //}
    }
开发者ID:hutu-nohito,项目名称:Lilith2,代码行数:17,代码来源:UI.cs

示例4: Start

    // Use this for initialization
    void Start()
    {
        _static = GameObject.FindGameObjectWithTag("Manager").GetComponent<Static>();
        pcZ = GameObject.FindGameObjectWithTag("Player").GetComponent<Player_ControllerZ>();

        for(int i = 0; i < 3; i++)
        {
            istyuto[i] = false;
        }
    }
开发者ID:hutu-nohito,项目名称:Lilith2,代码行数:11,代码来源:Tyutorial.cs

示例5: AddTrunk

		public virtual void AddTrunk()
		{
			if( m_Trunk != null )
				m_Trunk.Delete();

			if( TrunkID > 0 )
			{
				m_TrunkID = TrunkID;
				m_Trunk = new Static( TrunkID );
				m_Trunk.Name = "a tree trunk";
				m_Trunk.MoveToWorld( this.Location, this.Map );
			}
		}
开发者ID:greeduomacro,项目名称:hubroot,代码行数:13,代码来源:HarvestableTree.cs

示例6: Execute

		public override void Execute( CommandEventArgs args, object o )
		{
			if( o is AddonComponent )
			{
				BaseAddon addon = ((AddonComponent)o).Addon;

				if( addon.Components.Count > 0 )
				{
					for( int i = 0; i < addon.Components.Count; i++ )
					{
						AddonComponent component = addon.Components[i];
						Static newStatic = new Static( component.ItemID );

						newStatic.Hue = component.Hue;
						newStatic.Name = component.Name;
						newStatic.MoveToWorld( new Point3D( component.Location ), component.Map );
					}
				}

				addon.Delete();

				AddResponse( "The add-on has been converted to static objects." );
			}
			else if( o is Item && !(o is Static) )
			{
				Item i = (Item)o;
				Static newItem = new Static( i.ItemID );

				newItem.Hue = i.Hue;
				newItem.Layer = i.Layer;
				newItem.Light = i.Light;
				newItem.Name = i.Name;
				newItem.MoveToWorld( new Point3D( i.Location ), i.Map );

				if( i.Parent == args.Mobile )
					newItem.Bounce( args.Mobile );

				if( i is Container )
					((Container)i).Destroy();
				else
					i.Delete();

				AddResponse( "The item has been converted to a static." );
			}
			else
			{
				LogFailure( "This command only works with non-static items or add-ons." );
			}
		}
开发者ID:greeduomacro,项目名称:hubroot,代码行数:49,代码来源:ToStatic.cs

示例7: Build

		/// <summary>
		/// Builds a structure received from PB
		/// </summary>
		/// <param name="account">The account name for the user requesting the builder</param>
		/// <param name="items">An ArrayList of BuiltItem objects</param>
		/// <param name="map">The map on which the generation occurs</param>
		public static void Build( string account, ArrayList items, Map map )
		{
			ArrayList worldItems = new ArrayList();

			m_UserData[ account ] = worldItems;

			foreach( BuildItem bItem in items )
			{
				Static item = new Static( bItem.ID );
				item.Hue = bItem.Hue;

				item.MoveToWorld( new Point3D( bItem.X, bItem.Y, bItem.Z ), map );

				worldItems.Add( item );
			}
		}
开发者ID:greeduomacro,项目名称:annox,代码行数:22,代码来源:BuilderCore.cs

示例8: Start

    void Start()
    {
        playerController = GetComponent<CharacterController>();//rigidbodyを使う場合は外す
        animator = GetComponentInChildren<Animator>();//アニメータを使うとき
        save = GameObject.FindGameObjectWithTag("Manager").GetComponent<Static>();

        //HPとMPの引継ぎ
        H_point = save.H_Point;
        M_point = save.M_Point;

        //初期パラメタを保存
        max_HP = H_point;
        max_MP = M_point;
        base_Pow = power;
        base_Def = def;
        base_Sp = speed;
        base_Ju = jump;
    }
开发者ID:hutu-nohito,项目名称:Lilith2,代码行数:18,代码来源:Debug_pcZ.cs

示例9: Start

    // Use this for initialization
    void Start()
    {
        guiText = this.GetComponent<Text>();

        switch(type){
            case Text_Type.Day:
                _static = GameObject.FindGameObjectWithTag("Manager").GetComponent<Static>();

                if (_static.day - (int)_static.day == 0.5f) {
                    guiText.text = (int)_static.day + "日目 夜";
                }
                else
                {
                    guiText.text = (int)_static.day + "日目 昼";
                }
                break;
            case Text_Type.LP:
                _static = GameObject.FindGameObjectWithTag("Manager").GetComponent<Static>();
                guiText.text = "名声 " + _static.lank_P;
                break;
            case Text_Type.BP:
                _static = GameObject.FindGameObjectWithTag("Manager").GetComponent<Static>();
                guiText.text = "BP " + _static.bonus_P;
                break;
            case Text_Type.HP:

                pcZ = GameObject.FindGameObjectWithTag ("Player").GetComponent<Player_ControllerZ>();
                break;
            case Text_Type.MP:

                pcZ = GameObject.FindGameObjectWithTag ("Player").GetComponent<Player_ControllerZ>();
                break;
            case Text_Type.Magic:

                mc = GameObject.FindGameObjectWithTag("Player").GetComponent<Magic_Controller>();
                break;
            case Text_Type.Enemy:

                ecZ = GameObject.Find("Boss_DarkLilith").GetComponent<Enemy_ControllerZ>();
                break;
            default:
                break;
        }
    }
开发者ID:hutu-nohito,项目名称:Lilith2,代码行数:45,代码来源:TextImput.cs

示例10: OnTarget

 protected override void OnTarget( Mobile from, object targeted )
 {
     if ( targeted is AddonComponent )
     {
         BaseAddon design = ((AddonComponent)targeted).Addon;
         if ( design.Components.Count > 0 )
         {
             for ( int i = 0; i < design.Components.Count; ++i )
             {
                 AddonComponent component = (AddonComponent)((design.Components)[i]);
                 Static equivalent = new Static( component.HuedItemID  );  //( component.ItemID );
                 equivalent.Location = component.Location;  //component.Location;
                 equivalent.Map = component.Map; //component.Map;
                 equivalent.Hue = component.Hue; //component.Map;
             }
         }
         design.Delete();
         from.SendMessage("Addon structure statified. You can now freeze it.");
     }
 }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:20,代码来源:Addon2Static.cs

示例11: OnTarget

			protected override void OnTarget(Mobile from, object targeted)
			{
				IPoint3D p = targeted as IPoint3D;

				if ( p != null )
				{
					foreach( BuildItem bItem in m_Items )
					{
						Static item = new Static( bItem.ID );
						item.Hue = bItem.Hue;
						
						int x = p.X + bItem.X;
						int y = p.Y + bItem.Y;
						
						Map map = from.Map;
						int z = map.Tiles.GetLandTile( x, y ).Z;
						
						item.MoveToWorld( new Point3D( x, y, z ), map );
					}

					from.SendMessage( BoxConfig.MessageHue, "{0} items created.", m_Items.Count );
				}
			}
开发者ID:greeduomacro,项目名称:annox,代码行数:23,代码来源:RandomBrushMessage.cs

示例12: SetClienttype

 public Builder SetClienttype(Static.ClientType value)
 {
     PrepareBuilder();
     result.hasClienttype = true;
     result.clienttype_ = value;
     return this;
 }
开发者ID:scriptord3,项目名称:Mjolnir,代码行数:7,代码来源:Login.cs

示例13: PropertyHelper_DoesNotFindStaticProperties

        public void PropertyHelper_DoesNotFindStaticProperties()
        {
            // Arrange
            var anonymous = new Static();

            // Act + Assert
            var helper = Assert.Single(PropertyHelper.GetProperties(anonymous));
            Assert.Equal("Prop5", helper.Name);
        }
开发者ID:sparraguerra,项目名称:Common,代码行数:9,代码来源:PropertyHelperTest.cs

示例14: IncreaseTier

		public override void IncreaseTier()
		{			
			base.IncreaseTier();
			
			List<object> list = new List<object>();
			Item c;			
			
			switch ( Tier )
			{				
				case 1:					
					// easel with canvas
					c = new Static( 0xF66 );
					c.MoveToWorld( new Point3D( 1417, 1602, 30 ), Map );
					list.Add( c );
					
					// table
					c = new Static( 0xB6B );
					c.MoveToWorld( new Point3D( 1417, 1606, 30 ), Map );
					list.Add( c );
					
					c = new Static( 0xB6D );
					c.MoveToWorld( new Point3D( 1417, 1605, 30 ), Map );
					list.Add( c );
					
					c = new Static( 0xB6C );
					c.MoveToWorld( new Point3D( 1417, 1604, 30 ), Map );
					list.Add( c );
					
					// bonsai tree					
					c = new Static( 0x28DC );
					c.MoveToWorld( new Point3D( 1417, 1604, 36 ), Map );
					list.Add( c );
					
					// bottles		
					c = new Static( 0xE29 );
					c.MoveToWorld( new Point3D( 1417, 1605, 37 ), Map );
					list.Add( c );		
					
					c = new Static( 0xE28 );
					c.MoveToWorld( new Point3D( 1417, 1605, 36 ), Map );
					list.Add( c );		
					
					c = new Static( 0xE2C );
					c.MoveToWorld( new Point3D( 1417, 1606, 37 ), Map );
					list.Add( c );
					
					// pen and ink					
					c = new Static( 0xFBF );
					c.MoveToWorld( new Point3D( 1417, 1606, 36 ), Map );
					list.Add( c );
					
					// cooking book			
					c = new Static( 0xFBE );
					c.MoveToWorld( new Point3D( 1418, 1606, 42 ), Map );
					c.Name = "A Cookbook";
					list.Add( c );
					break;				
			}			
			
			if ( list.Count > 0 )
				Tiers.Add( list );
		}
开发者ID:brodock,项目名称:genova-project,代码行数:62,代码来源:ArtsSection.cs

示例15: GenGauntlet_OnCommand

		public static void GenGauntlet_OnCommand( CommandEventArgs e )
		{
			/* Begin healer room */
			CreatePricedHealer( 5000, 387, 400 );
			CreateTeleporter( 390, 407, 394, 405 );

			BaseDoor healerDoor = CreateDoorSet( 393, 404, true, 0x44E );

			healerDoor.Locked = true;
			healerDoor.KeyValue = Key.RandomValue();

			if ( healerDoor.Link != null )
			{
				healerDoor.Link.Locked = true;
				healerDoor.Link.KeyValue = Key.RandomValue();
			}
			/* End healer room */

			/* Begin supply room */
			CreateMorphItem( 433, 371, 0x29F, 0x116, 3, 0x44E );
			CreateMorphItem( 433, 372, 0x29F, 0x115, 3, 0x44E );

			CreateVarietyDealer( 492, 369 );

			for ( int x = 434; x <= 478; ++x )
			{
				for ( int y = 371; y <= 372; ++y )
				{
					Static item = new Static( 0x524 );

					item.Hue = 1;
					item.MoveToWorld( new Point3D( x, y, -1 ), Map.Malas );
				}
			}
			/* End supply room */

			/* Begin gauntlet cycle */
			CreateTeleporter( 471, 428, 474, 428 );
			CreateTeleporter( 462, 494, 462, 498 );
			CreateTeleporter( 403, 502, 399, 506 );
			CreateTeleporter( 357, 476, 356, 480 );
			CreateTeleporter( 361, 433, 357, 434 );

			GauntletSpawner sp1 = CreateSpawner( "DarknightCreeper",		491, 456,	473, 432,	417, 426,	true,	473, 412, 39, 60 );
			GauntletSpawner sp2 = CreateSpawner( "FleshRenderer",			482, 520,	468, 496,	426, 422,	false,	448, 496, 56, 48 );
			GauntletSpawner sp3 = CreateSpawner( "Impaler",					406, 538,	408, 504,	432, 430,	false,	376, 504, 64, 48 );
			GauntletSpawner sp4 = CreateSpawner( "ShadowKnight",			335, 512,	360, 478,	424, 439,	false,	300, 478, 72, 64 );
			GauntletSpawner sp5 = CreateSpawner( "AbysmalHorror",			326, 433,	360, 429,	416, 435,	true,	300, 408, 60, 56 );
			GauntletSpawner sp6 = CreateSpawner( "DemonKnight",				423, 430,	0,   0,		423, 430,	true,	392, 392, 72, 96 );

			sp1.Sequence = sp2;
			sp2.Sequence = sp3;
			sp3.Sequence = sp4;
			sp4.Sequence = sp5;
			sp5.Sequence = sp6;
			sp6.Sequence = sp1;

			sp1.State = GauntletSpawnerState.InProgress;
			/* End gauntlet cycle */

			/* Begin exit gate */
			ConfirmationMoongate gate = new ConfirmationMoongate();

			gate.Dispellable = false;

			gate.Target = new Point3D( 2350, 1270, -85 );
			gate.TargetMap = Map.Malas;

			gate.GumpWidth = 420;
			gate.GumpHeight = 280;

			gate.MessageColor = 0x7F00;
			gate.MessageNumber = 1062109; // You are about to exit Dungeon Doom.  Do you wish to continue?

			gate.TitleColor = 0x7800;
			gate.TitleNumber = 1062108; // Please verify...

			gate.Hue = 0x44E;

			gate.MoveToWorld( new Point3D( 433, 326, 4 ), Map.Malas );
			/* End exit gate */
		}
开发者ID:Godkong,项目名称:Origins,代码行数:82,代码来源:GauntletSpawner.cs


注:本文中的Static类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。