本文整理汇总了C#中STATE类的典型用法代码示例。如果您正苦于以下问题:C# STATE类的具体用法?C# STATE怎么用?C# STATE使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
STATE类属于命名空间,在下文中一共展示了STATE类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: OnConnectionFailure
public void OnConnectionFailure( NetworkConnectionError _info )
{
this.connectingPanelObj.SetActive( false );
this.mainPanelObj.SetActive( true );
this.currentState = STATE.MAIN;
}
开发者ID:marshl,项目名称:Leviathan2,代码行数:7,代码来源:MainMenuButtons.cs
示例2: ReturnMenu
// 回到主界面
public void ReturnMenu()
{
state = STATE.Start;
uiScript.ShowGameOverPanel(false);
uiScript.ShowRankPanel(false);
uiScript.ShowStartPanel(true);
}
开发者ID:dougen,项目名称:Classic-Snake,代码行数:8,代码来源:GameManagerScript.cs
示例3: initialize
private void initialize()
{
business = new BusinessPage();
demographics = new DemographicsPage();
tp = new Windows.TimePicker();
tp.Hide();
business.businessGrid.SelectionChanged += BusinessGrid_SelectionChanged;
state = STATE.Error;
users = get_users();
cb_User.ItemsSource = users;
cb_User.MinimumPopulateDelay = 3;
string command = "SELECT DISTINCT state_code FROM censusdata ORDER BY state_code";
using (MySqlConnection db_connection = new MySqlConnection(connectionString))
{
db_connection.Open();
using (MySqlCommand c = new MySqlCommand(command, db_connection))
{
using (MySqlDataReader r = c.ExecuteReader())
{
while (r.Read())
{
cb_state.Items.Add(r.GetString("state_code"));
}
}
}
}
}
开发者ID:Xirdie,项目名称:Cpts_451,代码行数:27,代码来源:ContainerWindow.xaml.cs
示例4: Update
// Update is called once per frame
void Update()
{
if (m_State != m_OldState)
{
m_State = m_OldState;
m_EnterPls = true;
}
else
{
m_EnterPls = false;
}
switch (m_State)
{
case ( STATE.INIT ):
break;
case (STATE.COUNT_3):
break;
case (STATE.COUNT_2):
break;
case (STATE.COUNT_1):
break;
case (STATE.IN_GAME):
break;
case (STATE.GAME_ORVER):
break;
case (STATE.CLEAR):
break;
}
}
开发者ID:TakuKobayashi,项目名称:CatalogIPOpen,代码行数:31,代码来源:SceneCtrlMainGame.cs
示例5: Update
// Update is called once per frame
void Update()
{
if (m_StateOld != m_State)
{
m_StateOld = m_State;
m_EnterPls = true;
m_StateTime = 0.0f;
}
else
{
m_StateTime += Time.deltaTime;
m_EnterPls = false;
}
switch (m_State)
{
case (STATE.BLANK):
stBlank();
break;
case ( STATE.WAIT ):
stWait();
break;
case (STATE.INTRO):
stIntro();
break;
case (STATE.MAIN):
stMain();
break;
}
StartFlg = false;
}
开发者ID:TakuKobayashi,项目名称:CatalogIPOpen,代码行数:32,代码来源:SoundManager.cs
示例6: GameStart
// 游戏开始函数
public void GameStart()
{
state = STATE.Gaming;
uiScript.ShowStartPanel(false);
// 重置所有数据
score = 0;
snakeNodes.Clear();
for (int i = 0; i < w; ++i)
{
for (int j = 0; j < h; ++j)
{
if (grid[i, j] != null)
{
Destroy(grid[i, j]);
}
}
}
direction = -Vector2.right;
for (int i = 0; i < initLength; ++i)
{
EatFood();
}
}
开发者ID:dougen,项目名称:Classic-Snake,代码行数:27,代码来源:GameManagerScript.cs
示例7: stWait
void stWait()
{
if (true)
{
m_State = STATE.MAIN;
}
}
开发者ID:TakuKobayashi,项目名称:CatalogIPOpen,代码行数:7,代码来源:SoundManager.cs
示例8: toggle
public void toggle()
{
if(state == STATE.ON) {
// toggle to off
state = STATE.OFF;
background.color = new Color(0.745f, 0.745f, 0.745f, 1.0f);
description.text = "OFF";
description.color = Color.black;
description.transform.localPosition = new Vector3(description.transform.localPosition.x + textOffset, description.transform.localPosition.y, description.transform.localPosition.z);
thumb.transform.localPosition = new Vector3(thumb.transform.localPosition.x - spriteOffset, thumb.transform.localPosition.y, thumb.transform.localPosition.z);
} else {
// toggle to on
state = STATE.ON;
background.color = new Color(0.9921f, 0.745f, 0f, 1.0f);
description.text = "ON";
description.color = Color.white;
description.transform.localPosition = new Vector3(description.transform.localPosition.x - textOffset, description.transform.localPosition.y, description.transform.localPosition.z);
thumb.transform.localPosition = new Vector3(thumb.transform.localPosition.x + spriteOffset, thumb.transform.localPosition.y, thumb.transform.localPosition.z);
}
if (eventReceiver != null && !string.IsNullOrEmpty(functionName))
{
eventReceiver.SendMessage(functionName, (state == STATE.ON ? true : false), SendMessageOptions.DontRequireReceiver);
}
}
开发者ID:dany1532,项目名称:Social_Clues,代码行数:25,代码来源:Toggle.cs
示例9: en_queue
public void en_queue(STATE.states state)
{
lock (mf.states_queue)
{
mf.states_queue.Enqueue(state);
}
}
开发者ID:countrymarmot,项目名称:Cypress,代码行数:7,代码来源:StatesThread.cs
示例10: Update
// Update is called once per frame
void Update()
{
switch (m_State) {
case STATE.STATE_IN: {
this.transform.Translate(new Vector3(-moveSpeed * Time.deltaTime, 0, 0));
if (this.transform.position.x < m_TargetPos) {
m_State = STATE.STATE_ATTACK;
}
}break;
case STATE.STATE_ATTACK:{
attackStateTime -= Time.deltaTime;
if (attackStateTime < 0.0f) {
m_State = STATE.STATE_LEAVE;
} else {
m_AttackLeftTime -= Time.deltaTime;
if (m_AttackLeftTime < 0.0f) {
m_AttackLeftTime = attackDeltaTime;
Transform blt = Instantiate(attackBullet) as Transform;
if (blt) {
blt.position = this.transform.position;
}
}
}
}break;
case STATE.STATE_LEAVE:{
this.transform.Translate(new Vector3(-moveSpeed * Time.deltaTime, 0, 0));
if (this.transform.position.x < -20.0f) {
GameObject.DestroyObject(this.gameObject);
}
}break;
}
}
开发者ID:johnxthe9,项目名称:FlightFight,代码行数:34,代码来源:MonsterAI3.cs
示例11: FixedUpdate
// Update is called once per frame
void FixedUpdate ()
{
if (Input.GetKey(scanKey))
{
currentState = STATE.SCANNING;
}
}
开发者ID:NickHiga,项目名称:Lurk,代码行数:8,代码来源:Teleport.cs
示例12: MainWindow
public MainWindow()
{
InitializeComponent();
this.DataContext = this;
state = STATE.MENU;
#region SongFix
string b = Resource.get_File_Path("The Walking Dead Original Soundtrack - Theme Song HD.wav");
pathSaveData = System.IO.Path.GetFullPath(Resource.Resource_Path + "..\\" + "Properties.txt");
#endregion
#region Windowsize
CustomHeight = 350;
CustomWidth = 525;
#endregion
#region Playing_Window_Sound
player.URL = Resource.get_File_Path("The Walking Dead Original Soundtrack - Theme Song HD.wav");
player.settings.setMode("loop", true);
player.settings.volume = 5;
#endregion
#region Setting_Background
ImageBrush imgBrush = new ImageBrush();
imgBrush.ImageSource = new BitmapImage(new Uri(Resource.get_File_Path("Th353Y7.jpg"), UriKind.Relative));
Grid1.Background = imgBrush;
#endregion
}
开发者ID:ManuelWallner1,项目名称:Story_of_my_life,代码行数:29,代码来源:MainWindow.xaml.cs
示例13: RunAI
public override void RunAI()
{
base.RunAI();
// Moving x.
if (bestDirection.x > 0)
{
if (state != STATE.WALKINGLEFT)
{
transform.Rotate(new Vector3(0, 180, 0));
}
state = STATE.WALKINGLEFT;
}
else
{
if (state != STATE.WALKINGRIGHT)
{
transform.Rotate(new Vector3(0, 180, 0));
}
state = STATE.WALKINGRIGHT;
}
Vector3 unnormalizedDirection = bestDirection;
bestDirection = Vector3.Normalize(new Vector3(bestDirection.x, bestDirection.y, 0.0f));
RotateArm();
if (unnormalizedDirection.magnitude < shootRange)
{
Shoot();
}
}
开发者ID:kevinortegren,项目名称:zombiejam,代码行数:35,代码来源:BadGuyAI.cs
示例14: Player
public Player(MainGame game, Tile spawnPoint)
{
//Salvando os tiles ocupados:
mCurrentTiles = new List<Tile>();
mCurrentTiles.Add(spawnPoint);
//Definindo o estado inicial:
mCurrentState = STATE.STANDING;
//Inicializando o Sprite:
_sprite = new Sprite(game.Content.Load<Texture2D>("Images/Tileset"), mCurrentTiles[0].Sprite.DrawPosition);
//Corrigindo o Y:
_sprite.DrawPosition_Y -= 128;
//Salvando o spriteRect:
_sprite.SpriteRect = new Rectangle(0, 64, 128, 192);
//Atualizando a origem do sprite (Sempre Centralizada):
_sprite.Origin = new Vector2(_sprite.SpriteRect.Width / 2, _sprite.SpriteRect.Height / 2);
_sprite.Color = new Color(Color.White, 0.5f);
_sprite.Rotation = 0f;
//Zerando:
_qtdMoves = 0;
_playTime = TimeSpan.Zero;
}
开发者ID:AdoriaStudios,项目名称:BlockyGame,代码行数:27,代码来源:Player.cs
示例15: Initialize
public void Initialize(Enemy enemy, Player player, Texture2D barrierTexture, Texture2D collectableTexture, Level level)
{
this.enemy = enemy;
this.player = player;
this.barrierTexture = barrierTexture;
this.collectableTexture = collectableTexture;
this.level = level;
enemyChar = 5;
playerChar = 5;
GameState = STATE.Connecting;
connection = new HubConnection("http://localhost:9685");
//connection = new HubConnection("http://2dgameserver.azurewebsites.net/");
proxy = connection.CreateHubProxy("GameHub");
ServicePointManager.DefaultConnectionLimit = 10;
//connection.Received += Connection_Received;
Action<float, float> EnemyPosReceived = received_enemy_position;
proxy.On("sendPosition", EnemyPosReceived);
Action EnemyActiveReceived = received_enemy_active;
proxy.On("sendActive", EnemyActiveReceived);
Action<int> enemyShoot = received_enemy_shoot;
proxy.On("sendShoot", enemyShoot);
Action<List<Vector2>, List<int>> getCollectables = received_collectables;
proxy.On("sendCollectables", getCollectables);
Action<List<Vector2>, List<int>> getBarriers = received_barriers;
proxy.On("sendBarriers", getBarriers);
Action<float, int, int, float, int> enemyVariables = received_enemy_variables;
proxy.On("sendVariables", enemyVariables);
Action<int> playerConnecteds = conected_players;
proxy.On("playerConnecteds", playerConnecteds);
Action<int> otherPlayerChar = received_enemy_char;
proxy.On("otherPlayerChar", otherPlayerChar);
Console.WriteLine("SERVER: Waiting for connection");
try
{
connection.Start().Wait();
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
if (connection.State == ConnectionState.Connected)
{
Console.WriteLine("--SERVER: CONNECTED--");
}
}
开发者ID:AlexRex,项目名称:2DGame,代码行数:59,代码来源:ConnectionTest.cs
示例16: Item
public Item()
{
_life = _maxLife = 20f;
state = STATE.ON_GROUND;
_owner = null;
state = STATE.ON_GROUND;
}
开发者ID:398607,项目名称:MovingAround,代码行数:8,代码来源:Item.cs
示例17: CheckStuckInput
void CheckStuckInput()
{
if (Input.GetButton("Jump"))
{
state = STATE.FALLING;
moveDirection.y = jumpSpeed;
}
}
开发者ID:ordonak,项目名称:grappleGame,代码行数:8,代码来源:CharMoter.cs
示例18: activate
public void activate()
{
if (mCurrentState == STATE.IDLE)
{
mIsActive = true;
mCurrentState = STATE.APPEAR;
}
}
开发者ID:aburkhalter512,项目名称:EpochEscape,代码行数:8,代码来源:ActivatablePhrase.cs
示例19: Start
// Use this for initialization
void Start()
{
mText = GetComponent<Text> ();
state = STATE.START;
//StartCountDownを呼び出す
StartCoroutine("StartCountDown");
}
开发者ID:takashi-miyahara,项目名称:Unity,代码行数:9,代码来源:Game.cs
示例20: deactivate
public void deactivate()
{
if (mCurrentState == STATE.IDLE)
{
mIsActive = false;
mCurrentState = STATE.FADE;
}
}
开发者ID:aburkhalter512,项目名称:EpochEscape,代码行数:8,代码来源:ActivatablePhrase.cs
注:本文中的STATE类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论