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");
        }
示例#2
0
 public void Awake()
 {
     if (tracker != null)
     {
         return;
     }
     tracker = CreateTracker();
     if (useInitialValue)
     {
         tracker.Init(initialValue);
     }
 }
示例#3
0
        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));
            }
        }
示例#4
0
    // 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>();
 }
示例#8
0
 void Start()
 {
     tracker = CreateTracker();
 }
示例#9
0
 // Use this for initialization
 void Start()
 {
     vacationDuration = Random.Range(10, 48);
     findAttraction();
     valuetracker = FindObjectOfType <ValueTracker> ().GetComponent <ValueTracker>();
 }