Пример #1
0
    // Start is called before the first frame update
    void Start()
    {
        _itemManager          = FindObjectOfType <CornItemManager>();
        _monologueManager     = FindObjectOfType <CornMonologueManager>();
        _memoryDisplayControl = FindObjectOfType <MemoryDisplayControl>();

        _myMemory = itemMemoryProfile.GetMemoryWithName(NameOfMemory);



        if (_myMemory == null || _myMemory.MemoriesToDisplay.Count == 0)
        {
            Debug.LogError(gameObject.name + "with the memory name of " + NameOfMemory + " has script attached but has no memory to display");
            gameObject.tag = "Untagged";
            Destroy(this);
            return;
        }

        gameObject.tag = "Look";
        //gameObject.layer = 13; // ignore collision
        foreach (var sprite in itemMemoryProfile.GetMemoryWithName(NameOfMemory).MemoriesToDisplay)
        {
            MemoriesToPlay.Enqueue(sprite);
        }
    }
Пример #2
0
    private void Start()
    {
        playerAS      = GetComponent <AudioSource>();
        _audioManager = FindObjectOfType <AudioManager>();
        _itemManager  = FindObjectOfType <CornItemManager>();


        _monologueManager = FindObjectOfType <CornMonologueManager>();
        myCam             = Camera.main;
        objectHolder      = myCam.transform.Find("ObjectHolder");
        memoryDisplay     = FindObjectOfType <MemoryDisplayControl>();

        foodPickUpSounds.AddRange(_audioManager.SearchLibraryWithClipsOfSameType("pickUpFood"));
    }
Пример #3
0
    private void Awake()
    {
        gameFSM = new FSM <GameManager>(this);

        if (!GetComponent <CornItemManager>())
        {
            gameObject.AddComponent <CornItemManager>();
        }

        _cornItemManager       = GetComponent <CornItemManager>();
        _FoodInteractionScript = FindObjectOfType <CornItemInteractions>();
        _monologueManager      = GetComponent <CornMonologueManager>();
        _audioManager          = FindObjectOfType <AudioManager>();
        _mouseLook             = FindObjectOfType <CornMouseLook>();
        TitleMenu.SetActive(false);
        OrderMenu = GameObject.Find("OrderMenu");
        OrderMenu.SetActive(false);

        FindObjectOfType <CornBuoyancy>().waterBoilTimeInseconds = waterBoilSeconds;
        textAnimFSM     = GetComponent <PlayMakerFSM>();
        cleanupBowl     = GameObject.Find("BowlForTmr");
        backgroundMusic = GameObject.Find("BackgroundMusic").GetComponent <AudioSource>();



//        if (Debug_StartWithState == 1 || Debug_StartWithState == 2)
//        {
//            foreach (var child in FindObjectsOfType<FoodSpawner>())
//            {
//                child.StartCoroutine(child.Initiate());
//            }
//
//            gameFSM.TransitionTo<CookingState>();
//        }
//        else if(Debug_StartWithState == 0)
//        {
//            gameFSM.TransitionTo<OrderState>(); //default state
//        }
    }