void Start() { m_DeckPoaition = transform.position; m_State = STATE_TYPE.FLICKER; animator = GetComponent(typeof(Animator)) as Animator; animator.speed = 4; animator.Play("Flicker1"); }
public void StateTransition(STATE_TYPE enemyState, float speed, bool isChase, bool isAttack, string strPlayAnim) { if (_stateMachine.GetCurStateType() == enemyState) { return; } nav.speed = speed; SetAnimation(isChase, isAttack, strPlayAnim); }
public void ResetPosition() { const float CARD_WIDTH = 2.1f; Vector3 firstPosition = new Vector3(CARD_WIDTH, 0.0f, -1.4f); m_TargetPoaition = m_DeckPoaition - firstPosition; m_DeckPoaition = transform.position; m_MoveStartTime = Time.realtimeSinceStartup; m_State = STATE_TYPE.MOVE; }
public State() { Name = null; x = 0; y = 0; Selected = false; InputSignal = false; Signaled = false; AlSignaled = false; Type = STATE_TYPE.NONE; }
public void ChangeState(STATE_TYPE type) { if (current != null) { current.Exit(this, brain); } SetCurrentState(type); if (current != null) { current.Enter(this, brain); } }
private void Move() { float diffTime = (Time.realtimeSinceStartup - m_MoveStartTime) / m_Speed; transform.position = Vector3.Lerp(m_DeckPoaition, m_TargetPoaition, diffTime); float dis = Vector3.Distance(transform.position, m_TargetPoaition); if (dis <= 0.01f) { m_State = STATE_TYPE.NONE; Debug.Log("cardPos = " + transform.position); } }
public void OutOfScreen() { // どんな感じで画面外に出すのかわからないけど // とりあえずで・・・ Vector3 outPosition = new Vector3(5.0f, -15.0f, 0.0f); m_TargetPoaition = m_DeckPoaition + outPosition; m_DeckPoaition = transform.position; m_MoveStartTime = Time.realtimeSinceStartup; m_Speed = Vector3.Distance(m_TargetPoaition, m_DeckPoaition) / 30; Invoke("CardDestroy", 1.0f); m_State = STATE_TYPE.MOVE; }
private void Flicker() { if (animator.GetCurrentAnimatorStateInfo(0).IsName("Flicker1End")) { ChangeSprite(); animator.Play("Flicker2"); } if (animator.GetCurrentAnimatorStateInfo(0).IsName("Flicker2End")) { m_MoveStartTime = Time.realtimeSinceStartup; m_Speed = 0.3f; m_State = STATE_TYPE.MOVE; } }
public QueryVinceMotorMessage(uint ID, CMD_TYPE FuncCode, STATE_TYPE StateCode, uint StateCodeLength) { byteList.Clear(); byteList.Add((byte)ID); byteList.Add((byte)FuncCode); byteList.Add((byte)0x00); byteList.Add((byte)StateCode); byteList.Add((Byte)((StateCodeLength >> 8) & 0xFF)); byteList.Add((Byte)(StateCodeLength & 0xFF)); //CRC uint result = crc_checksum(byteList.ToArray(), byteList.Count()); byteList.Add((Byte)((result >> 8) & 0xFF)); byteList.Add((Byte)(result & 0xFF)); }
private Texture2D GetTexture() { string texturePath = ""; STATE_TYPE type = StateManager.instance.m_curStateType; if (type.Equals(STATE_TYPE.STATE_ROOM)) { texturePath = "[Textures]/[ScreenOut]/Tex_LoadingScene_04"; } else if (type.Equals(STATE_TYPE.STATE_VILLAGE)) { texturePath = "[Textures]/[ScreenOut]/Tex_LoadingScene_03"; } else { return(null); } return(AssetBundleEx.Load <Texture2D>(texturePath)); }
public State <EnumyState> GetEnemyState(STATE_TYPE stateType) { return(_arrEnemyState[(int)stateType]); }
public void SetCurrentState(STATE_TYPE type) { current = StateType.GetState(type); currentType = type; }
public StateConfigurator(STATE_TYPE st) { this.stateType = st; exit = new Dictionary <string, Action>(); internalTransition = new Dictionary <string, Action>(); }
public static State GetState(STATE_TYPE type) { return(s_states[(int)type]); }