示例#1
0
    // Update is called once per frame
    private void OnMouseDown()
    {
        if (_monologueManager.MonologueIsComplete &&
            !_memoryDisplayControl.MemoryPlaying &&
            GameManager.gameState >= 1 &&
            GameManager.gameState < 3 &&
            MemoriesToPlay.Count > 0)
        {
            _memoryDisplayControl.MemoryTrigger(MemoriesToPlay.Dequeue());

            _itemManager.memoriesCollected++;

            if (MemoriesToPlay.Count == 0)
            {
                gameObject.tag = "Untagged";
            }
        }
    }
示例#2
0
    private IEnumerator DisplayFoodMemory(GameObject FoodEaten, Sprite spriteToDisplay)
    {
        var randomNumber = Random.Range(0, 1);

        if (memoryDisplay.MemoryPlaying || randomNumber == 1) //chances to play food memory is 1/2
        {
            FoodEaten.SetActive(false);
            yield return(null);
        }
        else
        {
            memoryDisplay.MemoryTrigger(spriteToDisplay);
            while (memoryDisplay.MemoryPlaying)
            {
                yield return(null);
            }

            FoodEaten.SetActive(false);
        }
    }