private void StartBurning() { if (!burningStatusDisposable.Any() && !GetComponent <IsBurning>()) { Debug.Log("start burning (because of friction)"); gameObject.AddComponent <IsBurning>() .OnDestroyAsObservable() .Subscribe(x => burningStatusDisposable.Clear()) .AddTo(burningStatusDisposable); } }
private void StartBurning() { if (!burningStatusDisposable.Any() && !fuel.gameObject.GetComponent <IsBurning>()) { fuel.gameObject.AddComponent <IsBurning>() .OnDestroyAsObservable() .Subscribe(x => burningStatusDisposable.Clear()) .AddTo(burningStatusDisposable); } }