public void DestroyHook() { Destroy(hook); gameObject.GetComponent <SpringJoint2D>().enabled = false; hook = null; hookScript = null; }
void SpawnHook() { hook = Instantiate(Resources.Load("RopeHook"), crosshair.position + crosshair.up * 1.5f, crosshair.rotation) as GameObject; hookScript = hook.GetComponent <RopeLogic>(); hookScript.owner = gameObject; }
void Start() { m_rope = GetComponent <RopeLogic>(); m_pos = transform.position; }