Пример #1
0
        private void OnTriggerEnter(Collider collider)
        {
            BottleController bottleController = collider.GetComponent <BottleController>();

            if (bottleController != null && color == bottleController.Color)
            {
                int   index     = Random.Range(0, _xPositions.Count);
                float xPosition = _xPositions[index];
                _xPositions.RemoveAt(index);

                bottleController.GetComponent <BottleMouseDrag>().CanMove();

                bottleController.transform.parent        = this.transform;
                bottleController.transform.localPosition = new Vector3(xPosition, yPosition, 0f);

                OnShelfChanged?.Invoke();

                bottleController.enabled = false;

                GameManager.Instance.IncreaseScore();
            }
        }
 public void DoAction(BottleController bottleController)
 {
     bottleController.PillInsert.SetRightPill(this, bottleController.Color);
 }
 public void DoAction(BottleController bottleController)
 {
     bottleController.SelectMaterial.ChangeBottomMaterial(bottleController.Color, this);
 }