Пример #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;
        }
    }
Пример #2
0
    void Start()
    {
        m_linerendrer = GetComponent <LineRenderer>();
        m_hogeState   = HogeState.def;

        m_audioSource      = gameObject.GetComponent <AudioSource>();
        m_audioSource.clip = m_extendSE;
    }
Пример #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;
        }
    }
Пример #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();
            }
        }
    }
Пример #5
0
 void Start()
 {
     m_linerendrer = GetComponent <LineRenderer>();
     m_hogeState   = HogeState.def;
 }