public TakebleObject TakeObject() { var obj = _takenObject; _takenObject = null; return(obj); }
public override void Return(TakebleObject obj) { _cupTaken = false; _cup.transform.SetParent(transform); _cup.gameObject.SetActive(false); Renderer.sprite = _withTea.Highlight; }
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; }
public bool TryTakeObject(TakebleObject obj) { if (obj.IsCanBeTaken && IsCanTakeObject) { TakeObject(obj); return(true); } return(false); }
public override void Return(TakebleObject tomato) { tomato.transform.SetParent(transform); tomato.gameObject.SetActive(false); _tomatoes[_tomatoesCount] = tomato; _tomatoesCount++; Renderer.sprite = _sprites[_tomatoesCount].Highlight; }
public bool TryGetObject(string objId, out TakebleObject obj) { obj = null; if (_takenObject?.Id == objId) { obj = _takenObject; return(true); } return(false); }
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; }
public override TakebleObject Take() { _tomato.gameObject.SetActive(true); var tomato = _tomato; _tomato = null; _currentState++; return(tomato); }
public override void Return(TakebleObject obj) { throw new System.Exception("Tomato plant can't receive tomato back."); }