void Awake() { objectPlacePoint = GetComponent <ObjectPlacePoint>(); objectPlacePoint.onObjectPlaced.AddListener(OnObjectPlaced); animator = GetComponent <Animator>(); }
void OnTriggerEnter(Collider other) { if (other.CompareTag("ObjectPlacePoint") && objectPlacePointInRadius == null) { objectPlacePointInRadius = other.GetComponent <ObjectPlacePoint>(); } }
public void OnPlaced(ObjectPlacePoint objectPlacePoint) { rigidbody.isKinematic = true; transform.parent = objectPlacePoint.holder; transform.DOKill(); transform.DOLocalMove(Vector3.zero, PlayerModel.Instance.playerInteractionController.pickUpMoveDuration).Play(); objectPlacePoint.OnPlaced(this); }
void OnTriggerExit(Collider other) { if (other.CompareTag("ObjectPlacePoint")) { var objectPlacePoint = other.GetComponent <ObjectPlacePoint>(); if (objectPlacePoint == objectPlacePointInRadius) { objectPlacePointInRadius = null; } } }
public void AddPointWithMissingObject(ObjectPlacePoint objectPlacePoint) { pointsWithMissingObjects.Add(objectPlacePoint); }