protected override void Awake() { base.Awake(); eventPlayer.AddParameter(new CustomParameter("Aiming", () => isAiming)); // change animation states when aiming changes controller.AddChangeLoopStateValueCheck(() => isAiming, "Aiming"); gunChangeTracker = new ValueTracker(() => currentGun, null, "CurrentGun"); }
public void Awake() { if (tracker != null) { return; } tracker = CreateTracker(); if (useInitialValue) { tracker.Init(initialValue); } }
public async Task Should_not_die() { var tracker = new ValueTracker <Item, CacheValue <Item> >(new UsageCachePolicy <Item>(), 1000); void Remove() { } for (var i = 0; i < 10000; i++) { await tracker.Add(new CacheValue <Item>(Remove)); } }
// Use this for initialization void Start() { valueTracker = FindObjectOfType <ValueTracker> ().GetComponent <ValueTracker> (); anim = FindObjectOfType <BuildUI>().GetComponent <Animator> (); GameObject TempObject = Instantiate(roomPrefab); previewImage = GetComponentInChildren <Image> (); roomScript = TempObject.GetComponent <Room> (); roomStats = GetComponentInChildren <Text> (); roomSpriteRenderer = TempObject.GetComponentInChildren <SpriteRenderer> (); roomSprite = roomSpriteRenderer.sprite; previewImage.sprite = roomSprite; SetRoomStats(); Destroy(TempObject); }
public ValueTask <ImmutableArray <SerializableValueTrackedItem> > TrackValueSourceAsync(PinnedSolutionInfo solutionInfo, TextSpan selection, DocumentId documentId, CancellationToken cancellationToken) { return(RunServiceAsync(solutionInfo, async solution => { if (solution is null) { throw new InvalidOperationException(); } var document = solution.GetRequiredDocument(documentId); var progress = new ValueTrackingProgressCollector(); await ValueTracker.TrackValueSourceAsync(selection, document, progress, cancellationToken).ConfigureAwait(false); var items = progress.GetItems(); return items.SelectAsArray(item => SerializableValueTrackedItem.Dehydrate(solution, item, cancellationToken)); }, cancellationToken)); }
public ValueTask <ImmutableArray <SerializableValueTrackedItem> > TrackValueSourceAsync(PinnedSolutionInfo solutionInfo, SerializableValueTrackedItem previousTrackedItem, CancellationToken cancellationToken) { return(RunServiceAsync(solutionInfo, async solution => { if (solution is null) { throw new InvalidOperationException(); } var previousItem = await previousTrackedItem.RehydrateAsync(solution, cancellationToken).ConfigureAwait(false); if (previousItem is null) { return ImmutableArray <SerializableValueTrackedItem> .Empty; } var progress = new ValueTrackingProgressCollector(); await ValueTracker.TrackValueSourceAsync(solution, previousItem, progress, cancellationToken).ConfigureAwait(false); var items = progress.GetItems(); return items.SelectAsArray(item => SerializableValueTrackedItem.Dehydrate(solution, item, cancellationToken)); }, cancellationToken)); }
// Use this for initialization void Start() { displayText = GetComponent <Text>(); valueTracker = GameObject.FindObjectOfType <ValueTracker>(); powersystem = FindObjectOfType <PowerSystem>(); }
void Start() { tracker = CreateTracker(); }
// Use this for initialization void Start() { vacationDuration = Random.Range(10, 48); findAttraction(); valuetracker = FindObjectOfType <ValueTracker> ().GetComponent <ValueTracker>(); }