Ejemplo n.º 1
0
    void Start()
    {
        m_DeckPoaition = transform.position;
        m_State        = STATE_TYPE.FLICKER;

        animator       = GetComponent(typeof(Animator)) as Animator;
        animator.speed = 4;
        animator.Play("Flicker1");
    }
Ejemplo n.º 2
0
    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);
    }
Ejemplo n.º 3
0
    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;
    }
Ejemplo n.º 4
0
 public State()
 {
     Name        = null;
     x           = 0;
     y           = 0;
     Selected    = false;
     InputSignal = false;
     Signaled    = false;
     AlSignaled  = false;
     Type        = STATE_TYPE.NONE;
 }
Ejemplo n.º 5
0
 public void ChangeState(STATE_TYPE type)
 {
     if (current != null)
     {
         current.Exit(this, brain);
     }
     SetCurrentState(type);
     if (current != null)
     {
         current.Enter(this, brain);
     }
 }
Ejemplo n.º 6
0
    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);
        }
    }
Ejemplo n.º 7
0
    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;
    }
Ejemplo n.º 8
0
 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));
        }
Ejemplo n.º 10
0
    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));
    }
Ejemplo n.º 11
0
 public State <EnumyState> GetEnemyState(STATE_TYPE stateType)
 {
     return(_arrEnemyState[(int)stateType]);
 }
Ejemplo n.º 12
0
 public void SetCurrentState(STATE_TYPE type)
 {
     current     = StateType.GetState(type);
     currentType = type;
 }
Ejemplo n.º 13
0
 public StateConfigurator(STATE_TYPE st)
 {
     this.stateType     = st;
     exit               = new Dictionary <string, Action>();
     internalTransition = new Dictionary <string, Action>();
 }
Ejemplo n.º 14
0
 public static State GetState(STATE_TYPE type)
 {
     return(s_states[(int)type]);
 }