Esempio n. 1
0
        public TakebleObject TakeObject()
        {
            var obj = _takenObject;

            _takenObject = null;
            return(obj);
        }
Esempio n. 2
0
 public override void Return(TakebleObject obj)
 {
     _cupTaken = false;
     _cup.transform.SetParent(transform);
     _cup.gameObject.SetActive(false);
     Renderer.sprite = _withTea.Highlight;
 }
Esempio n. 3
0
 public void TakeObject(TakebleObject obj)
 {
     obj.transform.position = _objectTakePosition + transform.position;
     obj.transform.SetParent(transform);
     obj.Renderer.sortingLayerID = SortingLayersData.CharactersLayer;
     obj.Renderer.sortingOrder   = 10;
     _takenObject = obj;
 }
Esempio n. 4
0
 public bool TryTakeObject(TakebleObject obj)
 {
     if (obj.IsCanBeTaken && IsCanTakeObject)
     {
         TakeObject(obj);
         return(true);
     }
     return(false);
 }
Esempio n. 5
0
        public override void Return(TakebleObject tomato)
        {
            tomato.transform.SetParent(transform);
            tomato.gameObject.SetActive(false);

            _tomatoes[_tomatoesCount] = tomato;
            _tomatoesCount++;

            Renderer.sprite = _sprites[_tomatoesCount].Highlight;
        }
Esempio n. 6
0
 public bool TryGetObject(string objId, out TakebleObject obj)
 {
     obj = null;
     if (_takenObject?.Id == objId)
     {
         obj = _takenObject;
         return(true);
     }
     return(false);
 }
Esempio n. 7
0
 private void PutToGround()
 {
     _takenObject.Put();
     _takenObject.transform.position = _objectPutPosition + transform.position;
     _takenObject.transform.rotation = _takenObject.DefoultRotation;
     _takenObject.transform.SetParent(null);
     _takenObject.Renderer.sortingLayerID = SortingLayersData.ObjectsLayer;
     _takenObject.Renderer.sortingOrder   = _takenObject.DefoultSortOrder;
     _takenObject = null;
 }
Esempio n. 8
0
        public override TakebleObject Take()
        {
            _tomato.gameObject.SetActive(true);
            var tomato = _tomato;

            _tomato = null;
            _currentState++;

            return(tomato);
        }
Esempio n. 9
0
 public override void Return(TakebleObject obj)
 {
     throw new System.Exception("Tomato plant can't receive tomato back.");
 }