//フック収縮 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; } }
void Start() { m_linerendrer = GetComponent <LineRenderer>(); m_hogeState = HogeState.def; m_audioSource = gameObject.GetComponent <AudioSource>(); m_audioSource.clip = m_extendSE; }
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; } }
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(); } } }
void Start() { m_linerendrer = GetComponent <LineRenderer>(); m_hogeState = HogeState.def; }