private void Start() { m_dragRigidbody = FindObjectOfType <DragRigidbody>(); m_foodManager = FindObjectOfType <FoodManager>(); audioSource = GetComponent <AudioSource>(); StartCoroutine(LoseFoodOverTime()); }
/// <summary> /// Set the current moveable object and start input /// </summary> /// <param name="moveable"></param> public void SetCurrentMoveable(GameObject moveable) { currentMoveable = moveable.GetComponent <DragRigidbody>(); currentMoveable.GetComponent <Rigidbody>().isKinematic = false; StartCoroutine(EnableMoveableCollider()); start.enabled = false; ToggleMoveableSelectable(false); currentMoveable.HandleInputBegin(Input.mousePosition); }
/// <summary> /// Finished moving once object's velocity is 0 /// </summary> public void FinishedMoving() { currentMoveable.HandleInputEnd(Input.mousePosition); currentMoveable.GetComponent <Rigidbody>().isKinematic = true; currentMoveable.GetComponent <Collider>().enabled = false; currentMoveable = null; ToggleMoveableSelectable(true); start.enabled = true; }
public DragObject$1(float distance, DragRigidbody self_) { this.$distance10 = distance; this.$self_11 = self_; }