public bool SetSlotImg( string path) { m_State = eState.From_Path; GameObject faceObj = ResourceLoad.LoadGameObject( path); return _SetSlotImg( faceObj); }
public virtual void OpenView(FlowViewData viewData, FlowActionData actionData) { m_State = eState.OPENING; m_ViewData = viewData; OnViewOpened(); }
public GridData(eState[,] tileStates) { _tileStates = (eState[,])tileStates.Clone(); _winningLine = null; _width = tileStates.GetLength(0); _height = tileStates.GetLength(1); }
void OnCollisionEnter2D(Collision2D coll) { if (coll.gameObject.tag == "Player") { mushroomState = eState.Contact; } }
public void startAnim() { _elaspedTime = 0.0f; _state = eState.ShowAnim; //GameObject _ps = _getChildGameObject("ParticleEmitter1"); //_ps.GetComponent<ParticleSystem>().Play(); }
public void UpdateDisplay(eState state) { if(state == eState.empty) { return; } _stateText.text = state == eState.nought ? "O" : "X" ; }
void OnTriggerExit2D(Collider2D coll) { if (coll.tag == "Player") { paperState = eState.None; Target.SetActive(false); } }
void OnTriggerEnter2D(Collider2D coll) { if (coll.tag == "Player") { paperState = eState.Contact; active = false; } }
private void OnDestroy() { state = eState.Inactive; if(instance == this) { instance = null; } }
public void DeleteSlotImg() { m_State = eState.NONE; if( null == m_Object) return; DestroyImmediate( m_Object ); }
public void PlaySound(Move move, eState moveState) { GameManager gameManager = GameManager.Instance(); if(gameManager.IsSoundOn()) { AudioSource audio = GetComponent<AudioSource>(); audio.clip = _writingSound; audio.Play(); } }
public virtual void Hide(bool immidiate) { this.gameObject.SetActive(false); m_CurrentState = eState.HIDDEN; if (m_OnHideComplete != null) { m_OnHideComplete(); } }
void OnGUI() { switch (State) { case eState.READY_TO_START: { GUI.Label( new Rect(Screen.width * 0.2f, Screen.height * 0.3f, Screen.width * 0.6f, Screen.height * 0.3f), "SHARK SPRINT\n\nclick to begin", TextStyle); if (Input.GetMouseButtonUp(0)) { State = eState.RUNNING; Player.SetActive(true); Pickups.GetComponent<PickupSpawner>().Reset(); StartTime = Time.time; } } break; case eState.RUNNING: { if (Player.transform.position.z > FinishLine) { Player.SetActive(false); FinishTime = Time.time; State = eState.LEVEL_COMPLETE; } } break; case eState.LEVEL_COMPLETE: { string caption = string.Format("Your Time: {0:n2}\n\nclick to try again", FinishTime - StartTime); GUI.Label( new Rect(Screen.width * 0.2f, Screen.height * 0.3f, Screen.width * 0.6f, Screen.height * 0.3f), caption, TextStyle); if (Input.GetMouseButtonUp(0)) { Player.transform.position = StartingPosition; Player.SetActive(true); Player.GetComponent<PlayerLogic>().Reset(); Pickups.GetComponent<PickupSpawner>().Reset(); StartTime = Time.time; State = eState.RUNNING; } } break; } }
void OnGUI() { switch (State) { case eState.TITLE: { GUI.Label( new Rect(Screen.width * 0.2f, Screen.height * 0.3f, Screen.width * 0.6f, Screen.height * 0.3f), "BURGER STRIKE\nclick to begin", TextStyle); if (Input.GetMouseButtonUp(0)) { State = eState.TUTORIAL; } } break; case eState.TUTORIAL: { GUI.Label( new Rect(Screen.width * 0.2f, Screen.height * 0.3f, Screen.width * 0.6f, Screen.height * 0.3f), "Shoot targets for\nORBITAL STRIKE", TextStyle); if (Input.GetMouseButtonDown(0)) { State = eState.RUNNING; Player.SetActive(true); } } break; case eState.RUNNING: { if (AreAllEnemiesDestroyed()) { Player.SetActive(false); State = eState.LEVEL_COMPLETE; } } break; case eState.LEVEL_COMPLETE: { string caption = string.Format("MISSION\nACCOMPLISHED"); GUI.Label( new Rect(Screen.width * 0.2f, Screen.height * 0.3f, Screen.width * 0.6f, Screen.height * 0.3f), caption, TextStyle); } break; } // switch }
public AutoRestarter(AppDef appDef, AppState appState, int processId, XElement xml) { this.appState = appState; parseXml( xml ); state = eState.WaitingForCrash; this.processId = processId; this.appDef = appDef; }
public override void Initialize() { base.Initialize(); ActionButton = new RPGActionButton(); ActionButton.Initialize(GraphicsDevice); CooldownElapsed = new TimeSpan(); CooldownLength = new TimeSpan(); State = eState.READY; }
private void IdleUpdateCycle() { if (_charCtrl.velocity.sqrMagnitude > 20f) _state = eState.RUN; else if (_charCtrl.velocity.sqrMagnitude > 0.1f) { if (_state != eState.BACK) _state = eState.WALK; } else _animation.CrossFade("fight idle"); }
/// <summary> /// Constructor /// </summary> public AutoPanelG() { InitializeComponent(); mControlBoxPosition = eControlBoxPositions.Top; nHeight = this.Height; nHeight_Static = nHeight; _eState = eState.Maximized; bMoveEnabled = true; AnimationTimer = new Timer(); AnimationTimer.Interval = 16; AnimationTimer.Tick += new EventHandler(AnimationTimer_Tick); }
public bool SetSlotImg_Item( sITEMVIEW _view) { m_State = eState.From_Item; Item item = ItemMgr.ItemManagement.GetItem( _view.nItemTableIdx); if(item != null) return _SetSlotImg_Item(item.ItemID); else { DeleteSlotImg(); return false; } }
private void Awake() { if(instance != null) { Debug.LogWarning("Only one AppEngine may be active at once!"); Destroy(gameObject); return; } Debug.Log("AppEngine ready!"); instance = this; state = start; }
// public delegate void Dlt_Expire(); // Dlt_Expire m_Expire; // public void Dlt_SetExpire(Dlt_Expire _dlt) // { // m_Expire = _dlt; // } public void BeginTimeCount(float _remain) { m_State = eState.On; personalStore.Text = AsTableManager.Instance.GetTbl_String(1319); m_RemainTime = _remain; // long endTime = _remain; // System.DateTime dt = new System.DateTime(1970, 1, 1, 9, 0, 0); // dt = dt.AddSeconds(endTime); // System.TimeSpan timeSpan = new System.TimeSpan(dt.Ticks - System.DateTime.Now.Ticks); // m_RemainTime = (float)timeSpan.TotalSeconds; // Debug.Log("AsCharacterSlotShopInfo::BeginTimeCount: _remain + _total = " + endTime); // Debug.Log("AsCharacterSlotShopInfo::BeginTimeCount: timeSpan.Ticks = " + timeSpan.Ticks); // Debug.Log("AsCharacterSlotShopInfo::BeginTimeCount: " + m_RemainTime); }
public void end(bool win = true) { Debug.Log("End"); if (win) { source.Stop(); source.SetSourceEvent(mEtap6[7]); source.Play(); } else { mEnd = true; mObjects[9].activeActionMutex(); mObjects[10].activeActionMutex(); source.Stop(); source.SetSourceEvent(mEtap6[3]); source.Play(); } mState = eState._FINISH_; }
bool _SetSlotImg_Skill( int _idx) { m_State = eState.From_Skill; GameObject skillObj = null; bool ret = true; if( _idx > 0) { Tbl_Skill_Record skillRec = AsTableManager.Instance.GetTbl_Skill_Record( _idx); if( skillRec != null) skillObj = ResourceLoad.LoadGameObject( skillRec.Skill_Icon); else ret = false; } else ret = false; if( ret == false) return false; else return _SetSlotImg( skillObj); }
private async Task CheckForStateChange(eState newState) { // Checks for state changes and does something when one is detected. if (newState != CurrentState) { String whatToSay; switch (newState) { case eState.JustRight: { whatToSay = JustRightLightString; } break; case eState.TooBright: { whatToSay = HighLightString; } break; case eState.TooDark: { whatToSay = LowLightString; } break; default: { whatToSay = "unexpected value"; } break; } // Use another method to wrap the speech synthesis functionality. // Update the current state for next time. CurrentState = newState; } }
public void SetPet(PetListElement _element, dltManageSlotClicked _dlt) { img_SlotEmpty.SetActive(false); m_Element = _element; img_SlotBase.SetActive(true); m_State = eState.Base; img_Selected.SetActive(false); if(AsPetManager.Instance.PetInfoDlg != null) { PetListElement curElement = AsPetManager.Instance.CurPetListElement; if(curElement != null && curElement.PetSlot == m_Element.PetSlot) { m_State = eState.Selected; img_Selected.SetActive(true); } } if(AsPetManager.Instance.CheckPetSummoning(m_Element) == true) { img_SlotBase.SetActive(false); img_SlotSummon.SetActive(true); } trnIcon.SetSlotImg(_element.PetRecord.Icon); txt_Name.Text = _element.PetName; int maxLv = (int)AsTableManager.Instance.GetTbl_GlobalWeight_Record("PetMaxLevel").Value; strBuilder.Remove(0, strBuilder.Length); strBuilder.Append("LV. "); strBuilder.Append(_element.Level); strBuilder.Append(" / "); strBuilder.Append(maxLv); txt_Level.Text = strBuilder.ToString(); // if(_element.Level == maxLv) strBuilder.Append(" "); m_DltClick = _dlt; }
// プレイヤのゲーム状態をチェックする void CheckPlayerGameState() { if (_player == null) { // プレイヤへの参照を取得する GameObject obj = GameObject.Find("Player") as GameObject; _player = obj.GetComponent<Player>(); } switch ( _player.GetGameState() ) { case Player.eGameState.StageClear: // ステージクリア _state = eState.StageClear; break; case Player.eGameState.GameOver: // ゲームオーバー _state = eState.GameOver; break; } }
public bool OpenProject(string strProject, string strUser, string strPassword, out string strErrDiag) { strErrDiag = ""; bool bRet = false; try { if (state != eState.stDisc) { CloseProject(); } cb.ShowProgressOpenProject("Opening " + strProject); rpxProject = (ReqPro40.Project___v7)rpxApplication.OpenProject(strProject, ReqPro40.enumOpenProjectOptions.eOpenProjOpt_RQSFile, strUser, strPassword, ReqPro40.enumProjectFlags.eProjFlag_Normal, ReqPro40.enumRelatedProjectOptions.eRelatedProjOption_ConnectAll); state = eState.stConn; bRet = true; ReqProRequirementPrx.HomePrjPrefix = rpxProject.Prefix; int nCountRelPrj = rpxProject.RelatedProjectContexts.Count; bool bLoadRelPrj; string strRelPrjPassword; string strRelPrjUser; cb.ShowProgressOpenProject("Related Projects to be opened: " + nCountRelPrj); ReqPro40.RelatedProjectContext rpxRelPrjCtx; ReqPro40.Project___v7 rpxRelPrj; for (int i = 0; i < nCountRelPrj; i++) { rpxRelPrjCtx = rpxProject.RelatedProjectContexts[i + 1, ReqPro40.enumRelatedProjectLookups.eRelProjLookup_Index]; bLoadRelPrj = true; strRelPrjPassword = strPassword; strRelPrjUser = strUser; rpxRelPrj = null; if (!rpxRelPrjCtx.IsOpen) { while (bLoadRelPrj) { try { cb.ShowProgressOpenProject("Opening: " + rpxRelPrjCtx.get_Name()); rpxRelPrj = (ReqPro40.Project___v7)rpxRelPrjCtx.OpenProject(strRelPrjUser, strRelPrjPassword); cb.ShowProgressOpenProject("Opened: " + rpxRelPrj.Name); } catch (System.Runtime.InteropServices.COMException e) { bool bPasswordError; unchecked { bPasswordError = (e.ErrorCode == (int)0x8004088b); } if (bPasswordError) { bLoadRelPrj = cb.RequestCredentials(rpxRelPrjCtx.get_Name(), ref strRelPrjUser, out strRelPrjPassword); } else { bLoadRelPrj = false; } } } } else { rpxRelPrj = (ReqPro40.Project___v7)rpxRelPrjCtx.ThisProject; cb.ShowProgressOpenProject("Already opened: " + rpxRelPrj.Name); } if (rpxRelPrj != null) { arpxRelProjects.Add(rpxRelPrj); } } } catch (System.Runtime.InteropServices.COMException e) { strErrDiag = e.Message; } return(bRet); }
public StateChangedEventArgs(eState state) { this.state = state; }
public void Stop() { m_eState = eState.None; }
public void SetState(NaverKeyData.eState state, string apiType) { this.eNMTstate = state; }
public void SetState(eState next) { state = next; }
static StateMachine() { currentState = eState.Initialisation; States[ currentState ].OnEnter(); }
public override void ChangeState(eState _state) { base.ChangeState(_state); }
void Start() { m_eState = eState.E_STATE_NONE; m_stMainTitleVec = m_pMainTitleGam.transform.localPosition; m_pBtnAni.Play(); }
public void ChangeState(eState state) { _state = _stateDic[state]; _state.Start(); }
/// <summary> /// 取得连续的数字字符串 /// </summary> /// <param name="str"></param> /// <returns></returns> static public StringCollection GetSequentialNums(string str, int nMax) { eState State = eState.Normal; int nPos = 0; StringCollection sc = new StringCollection(); int nCounter = 0; int i; for (i = 0; i < str.Length; ++i) { switch (State) { case eState.Normal: { // 普通状态 if (str[i] >= '0' && str[i] <= '9') { nPos = i; State = eState.Integer; } else if (str[i] == '-') { nPos = i; State = eState.Negative; } } break; case eState.Integer: { // 进入整数部分状态 if (!(str[i] >= '0' && str[i] <= '9' || str[i] == '.')) { sc.Add(str.Substring(nPos, i - nPos)); nPos = i; State = eState.Normal; ++nCounter; if (nCounter >= nMax) { break; } } else if (str[i] == '.') { State = eState.Decimal; } } break; case eState.Decimal: { // 进入小数部分 if (!(str[i] >= '0' && str[i] <= '9')) { // 遇到在 0 - 9 闭区间外的字母 sc.Add(str.Substring(nPos, i - nPos)); nPos = i; State = eState.Normal; ++nCounter; if (nCounter >= nMax) { break; } } } break; case eState.Negative: { // 负数 if (!(str[i] >= '0' && str[i] <= '9')) { State = eState.Normal; } else { State = eState.Integer; } } break; } } // end for // 终结时 if (State == eState.Integer || State == eState.Decimal) { sc.Add(str.Substring(nPos, i - nPos)); } return(sc); }
public NodeEnumerator(Node xiRootNode) { mNode = xiRootNode; mState = eState.BeforeLeft; mChildEnumerator = null; }
IEnumerator Start() { // 地形データのロード. var tmx = new TMXLoader(); tmx.Load("Levels/001"); var layer = tmx.GetLayer(0); //layer.Dump(); // タイルの配置. for(int j = 0; j < layer.Height; j++) { for(int i = 0; i < layer.Width; i++) { var v = layer.Get(i, j); var x = GetChipX(i); var y = GetChipY(j); Tile.Add(v, x, y); } } yield return new WaitForSeconds(0.1f); var pList = new List<Point2>(); Token player = null; // A-star実行. { // スタート地点. Point2 pStart = GetRandomPosition(layer); player = Util.CreateToken(GetChipX(pStart.x), GetChipY(pStart.y), "", "miku2", "Player"); player.SortingLayer = "Chara"; // ゴール. Point2 pGoal = GetRandomPosition(layer); var goal = Util.CreateToken(GetChipX(pGoal.x), GetChipY (pGoal.y), "", "gate1", "Goal"); goal.SortingLayer = "Chara"; // 斜め移動を許可 var allowdiag = true; var mgr = new ANodeMgr(layer, pGoal.x, pGoal.y, allowdiag); // スタート地点のノード取得 // スタート地点なのでコストは「0」 ANode node = mgr.OpenNode(pStart.x, pStart.y, 0, null); mgr.AddOpenList(node); // 試行回数。1000回超えたら強制中断 int cnt = 0; while(cnt < 1000) { mgr.RemoveOpenList(node); // 周囲を開く mgr.OpenAround(node); // 最小スコアのノードを探す. node = mgr.SearchMinScoreNodeFromOpenList(); if(node == null) { // 袋小路なのでおしまい. Debug.Log ("Not found path."); break; } if(node.X == pGoal.x && node.Y == pGoal.y) { // ゴールにたどり着いた. Debug.Log ("Success."); mgr.RemoveOpenList(node); node.DumpRecursive(); // パスを取得する node.GetPath(pList); // 反転する pList.Reverse(); break; } yield return new WaitForSeconds(0.01f); } } _state = eState.Walk; // プレイヤーを移動させる. foreach(var p in pList) { var x = GetChipX (p.x); var y = GetChipY (p.y); player.X = x; player.Y = y; yield return new WaitForSeconds(0.2f); } // おしまい _state = eState.End; }
private void XMPP_Success(XmlElement node) { if (!Authenticated) { Authenticated = true; state = eState.Session; OpenStream (); } }
public void SetState(eState setState) { this._timeDelta = 0f; _state_prev = _state_current; _state_current = setState; }
static public void SetState( eState nextState ) { States[ currentState ].OnExit(); currentState = nextState; States[ currentState ].OnEnter(); }
public static void OnMoveMadeEvent(Move move, eState moveState) { OnMoveMade(move, moveState); }
public void ChangeVisualState(eState state, bool log = true) { if (ChangeStateCoroutine != null) { StopCoroutine(ChangeStateCoroutine); ChangeStateCoroutine = null; } if (TiredStateCoroutine != null) { StopCoroutine(TiredStateCoroutine); TiredStateCoroutine = null; } foreach (var v in robotStates) { if (v.state == state) { image.sprite = v.sprite; image.color = v.color; } } image.transform.DOKill(); image.DOKill(); image.GetComponent <RectTransform>().anchoredPosition = Vector3.zero; switch (state) { case eState.Awake: FmodSoundEvent("AWAKE_ON"); production = GameManager.instance.levelValues.GetFloatValue("normalProduction"); DOChangeStateCoco(GameManager.instance.levelValues.GetFloatValue("opportunityRoll"), GameManager.instance.levelValues.GetFloatValue("opportunityProbability"), eState.Productivity); TiredStateCoroutine = COTiredState(GameManager.instance.levelValues.GetFloatValue("tiredTimerMin"), GameManager.instance.levelValues.GetFloatValue("tiredTimerMax")); StartCoroutine(TiredStateCoroutine); if (GameManager.instance.portFound) { switch (robotIndex) { case 0: GameManager.instance.serialPort2.Write("0"); break; case 1: GameManager.instance.serialPort1.Write("a"); break; case 2: GameManager.instance.serialPort1.Write("A"); break; case 3: GameManager.instance.serialPort1.Write("b"); break; case 4: GameManager.instance.serialPort1.Write("B"); break; } } break; case eState.Productivity: PlayVoiceFmodSoundEvent(productivityPathVoices); FmodSoundEvent("PRODUCTIVITY"); production = GameManager.instance.levelValues.GetFloatValue("normalProduction"); DOChangeStateCoco(GameManager.instance.levelValues.GetFloatValue("opportunityDuration"), 1, eState.Awake); if (GameManager.instance.portFound) { switch (robotIndex) { case 0: GameManager.instance.serialPort2.Write("1"); break; case 1: GameManager.instance.serialPort1.Write("c"); break; case 2: GameManager.instance.serialPort1.Write("C"); break; case 3: GameManager.instance.serialPort1.Write("d"); break; case 4: GameManager.instance.serialPort1.Write("D"); break; } } break; case eState.Boost: PlayVoiceFmodSoundEvent(boostPathVoices); FmodSoundEvent("BOOST_START"); production = GameManager.instance.levelValues.GetFloatValue("superBoostProduction"); DOChangeStateCoco(GameManager.instance.levelValues.GetFloatValue("superBoostDuration"), 1, eState.Awake); image.transform.DOMoveY(5, 0.2f).SetRelative().SetEase(Ease.Linear).SetLoops(-1, LoopType.Yoyo); if (GameManager.instance.portFound) { switch (robotIndex) { case 0: GameManager.instance.serialPort2.Write("2"); break; case 1: GameManager.instance.serialPort1.Write("e"); break; case 2: GameManager.instance.serialPort1.Write("E"); break; case 3: GameManager.instance.serialPort1.Write("f"); break; case 4: GameManager.instance.serialPort1.Write("F"); break; } } break; case eState.Tired: PlayVoiceFmodSoundEvent(tiredPathVoices); production = GameManager.instance.levelValues.GetFloatValue("tiredProduction"); DOChangeStateCoco(GameManager.instance.levelValues.GetFloatValue("tiredDuration"), 1, eState.Broken); if (GameManager.instance.portFound) { switch (robotIndex) { case 0: GameManager.instance.serialPort2.Write("3"); break; case 1: GameManager.instance.serialPort1.Write("g"); break; case 2: GameManager.instance.serialPort1.Write("G"); break; case 3: GameManager.instance.serialPort1.Write("h"); break; case 4: GameManager.instance.serialPort1.Write("H"); break; } } break; case eState.Broken: if (lastState == eState.Tired) { PlayVoiceFmodSoundEvent(tiredToBorkenPathVoices); } FmodSoundEvent("BROKEN_START"); production = 0; DOChangeStateCoco(GameManager.instance.levelValues.GetFloatValue("brokenDuration"), 1, eState.Asleep); image.DOColor(Color.black, 0.5f).SetEase(Ease.Linear).SetLoops(-1, LoopType.Yoyo); if (GameManager.instance.portFound) { switch (robotIndex) { case 0: GameManager.instance.serialPort2.Write("4"); break; case 1: GameManager.instance.serialPort1.Write("i"); break; case 2: GameManager.instance.serialPort1.Write("I"); break; case 3: GameManager.instance.serialPort1.Write("j"); break; case 4: GameManager.instance.serialPort1.Write("J"); break; } } break; case eState.Asleep: production = 0; if (GameManager.instance.portFound) { switch (robotIndex) { case 0: GameManager.instance.serialPort2.Write("5"); break; case 1: GameManager.instance.serialPort1.Write("k"); break; case 2: GameManager.instance.serialPort1.Write("K"); break; case 3: GameManager.instance.serialPort1.Write("l"); break; case 4: GameManager.instance.serialPort1.Write("L"); break; } } break; } lastState = currentState; if (log) { LLLog.Log("Robot", string.Format("Robot <color=green>#{0}</color> was changed state : <color=blue>{1}</color>.", robotIndex, state)); } }
public void NextState(eState nextState) { _state_next = nextState; }