コード例 #1
0
    public void AssignNewItemTask(PickupScriptableObject newItemPickup)
    {
        CurrentTask = newItemPickup.Type;
        cloudRendererImageLocation.sprite = newItemPickup.mySprite;
        ShowSpeechCloud();

        if (hideCloudRoutine != null)
        {
            StopCoroutine(hideCloudRoutine);
        }

        hideCloudRoutine = StartCoroutine(HideSpeechBubbleAfterX(2));
    }
コード例 #2
0
    public void Init(PickupScriptableObject pickupObject)
    {
        this.pickupObject     = pickupObject;
        spriteRenderer.sprite = pickupObject.mySprite;
        switch (pickupObject.weightCategory)
        {
        case WeightCategory.SuperHeavy:
            timeAdd       = 10;
            speedModifier = 0.5f;
            pointValue    = 40;
            break;

        case WeightCategory.Heavy:
            timeAdd       = 8;
            speedModifier = 0.6f;
            pointValue    = 30;
            break;

        case WeightCategory.Medium:
            timeAdd       = 6;
            speedModifier = 0.75f;
            pointValue    = 20;
            break;

        case WeightCategory.Light:
            timeAdd       = 4;
            speedModifier = 0.9f;
            pointValue    = 10;
            break;

        case WeightCategory.VeryLight:
            timeAdd       = 2;
            speedModifier = 1f;
            pointValue    = 5;
            break;
        }

        type = pickupObject.Type;

        if (pickupObject.animationOverrideController != null)
        {
            animator.runtimeAnimatorController = pickupObject.animationOverrideController;
        }
        highlight.enabled = false;
    }
コード例 #3
0
    private void HandleInput()
    {
        if (Input.GetKeyDown(KeyCode.Space))
        {
            if (currentPickedupCollectable != null)
            {
                currentPickedupCollectable.Drop();
                if (inHell)
                {
                    GameMaster.instance.satanTaskManager.HideSpeechCloud();
                    currentPickedupCollectable.PlaceInHell();
                    GameMaster.instance.SetNewTarget();
                }
                currentPickedupCollectable.gameObject.transform.localScale = new Vector3(1, 1, 1);
                currentPickedupCollectable = null;
                speed = 100;
                SoundManager.instance.PlayDropSoundsingle();
            }
            else if (currentTouchedCollectable != null)
            {
                currentTouchedCollectable.Pickup(anchor);
                currentPickedupCollectable = currentTouchedCollectable;
                PickupScriptableObject CurrObject = currentPickedupCollectable.pickupObject;
                speed *= currentPickedupCollectable.speedModifier;
            }
        }
        if (Input.GetKeyDown(KeyCode.R))
        {
            GameMaster.instance.satanTaskManager.RemindWantedItem();
        }

        if (Input.GetKeyDown(KeyCode.F))
        {
            if (scareCrowPrefab != null && haveAScareCrowToDrop)
            {
                Instantiate(scareCrowPrefab, transform.position, Quaternion.identity);
                haveAScareCrowToDrop = false;
                Invoke("ResetScareCrow", 5);
            }
        }
    }
コード例 #4
0
    public void AssignRandomItemTask(PickupScriptableObject[] pickupOptions)
    {
        PickupScriptableObject itemToAssign = pickupOptions[Random.Range(0, pickupOptions.Length - 1)];

        AssignNewItemTask(itemToAssign);
    }