// Update is called once per frame void Update() { UpdateCableLength(); //グーしたらワイヤー出す if (grab.HasGrab() || grabAction.stateDown) { StartCoroutine("Shot"); } if (attachTarget != null) { //距離長すぎるとワイヤーを切る float dis = Vector3.Distance(wireEnd.position, transform.position); if (dis >= breakDistance) { StartCoroutine("Release"); } //パーしたらギミック発動+ワイヤーポイント消す if (grab.HasRelease() || grabAction.stateUp) { attachTarget.parent.GetComponentInChildren <GimmickBase>().Excute(); StartCoroutine("Release"); //Destroy(attachTarget.gameObject); } } }
// Update is called once per frame void Update() { if (grab.HasGrab() && !map.activeSelf) { map.SetActive(true); } if (grab.HasRelease() && map.activeSelf) { map.SetActive(false); } }
// Update is called once per frame void Update() { if (grab.HasGrab() && grababbleObject != null && grababbleObject.GetComponent <GrabbableObject>() != null && grababbleObject.transform.parent != parent && !grababbleObject.GetComponent <GrabbableObject>().IsGrabbed()) { GrabObj(); } if ((grab.HasRelease() && grabbedObject != null)) { ReleaseObj(); } }