Ejemplo n.º 1
0
    //フック収縮
    void Shrink()
    {
        switch (colGameObject.tag)
        {
        //壁にあたったらそのまま移動
        case "Wall":
            target.transform.position = Vector3.MoveTowards(target.transform.position, hitPosition, 0.5f);
            break;

        //地形は移動しない
        case "Ground":
            transform.position = Vector3.MoveTowards(transform.position, target.transform.position, 0.5f);
            break;

        default:
            break;
        }

        //射出先に到達したら初期化
        if (transform.position == target.transform.position)
        {
            Init();
            m_hogeState = HogeState.def;
        }
    }
Ejemplo n.º 2
0
    void Start()
    {
        m_linerendrer = GetComponent <LineRenderer>();
        m_hogeState   = HogeState.def;

        m_audioSource      = gameObject.GetComponent <AudioSource>();
        m_audioSource.clip = m_extendSE;
    }
Ejemplo n.º 3
0
    void OnTriggerEnter2D(Collider2D col)
    {
        hitPosition = transform.position;

        if (col.gameObject.tag == "Wall")
        {
            colGameObject = col.gameObject;
            m_hogeState   = HogeState.shrink;
        }

        if (col.gameObject.tag == "Ground")
        {
            colGameObject = col.gameObject;
            m_hogeState   = HogeState.shrink;
        }
    }
Ejemplo n.º 4
0
    void Def()
    {
        transform.position = target.transform.position;

        touchStartPos = Camera.main.ScreenToWorldPoint(m_touchTest.m_touchStartPositon);


        //長押しとフリック検知で射出
        if (m_touchTest.releasing)
        {
            if (m_touchTest.longPressing && m_touchTest.flicking)
            {
                m_hogeState = HogeState.extend;
            }
            else
            {
                Init();
            }
        }
    }
Ejemplo n.º 5
0
 void Start()
 {
     m_linerendrer = GetComponent <LineRenderer>();
     m_hogeState   = HogeState.def;
 }