예제 #1
0
 private void Start()
 {
     PopulateDictionary();
     _IngredientAddedToCookingPotEvent.AddListener(OnIngredientAddedToCookingPot);
     AudioManager.SetState(_MusicStateGroup, _MusicValueEvents[1]);
     StartCoroutine(CollectCookingPot());
 }
예제 #2
0
    override protected void SingletonAwake()
    {
        // TODO: Get the match time
        _MatchState.Initialize(0, _LobbyDetails.ChosenDishes);
        _AllDishesCookedEvent.Initialize();
        _IngredientSpawnData.Initialize();

        foreach (var dish in _LobbyDetails.ChosenDishes)
        {
            // Adding the ingredient twice because both the players are cooking the same ingredient
            _IngredientSpawnData.AddRecipeIngredientsForSpawning(dish.DishRecipe);
            _IngredientSpawnData.AddRecipeIngredientsForSpawning(dish.DishRecipe);
        }

        _UIManager  = UIManager.Instance;
        _PhotonView = GetComponent <PhotonView>();

        // Can start game only if the client is the master client
        if (PhotonNetwork.IsMasterClient)
        {
            StartCoroutine(CheckIfCanStartGame());
        }

        // Subscribing to player cooked all dishes event
        _AllDishesCookedEvent.AddListener(OnPlayerCompletedAllDishes);

        _CombatData = Resources.Load <SO_CombatData>("CombatData");

        // Subscribing to combat events
        _CombatData.HeroesCollidedEvent.AddListener(OnHeroesCollided);
        _CombatData.CombatSequenceCompletedEvent.AddListener(OnCombatSequenceEnded);
    }
예제 #3
0
 protected override void Awake()
 {
     base.Awake();
     // Subscribing to dish cooked events of all players
     _DishCookedEvent.AddListener(OnDishCooked);
     _MatchStartedEvent.AddListener(OnMatchStarted);
     Initialize();
 }
예제 #4
0
 private void OnEnable()
 {
     if (CookingStations == null)
     {
         CookingStations = new List <CookingStation>();
     }
     CookingStations.Add(this);
     _IngredientCollectedEvent.AddListener(OnCollectedIngredient);
     _IngredientModifiedEvent.AddListener(OnIngredientModified);
 }
예제 #5
0
    private void Start()
    {
        _MinionButton    = GetComponent <Button>();
        _IngredientImage = GetComponent <Image>();

        _NormalColor   = _MinionButton.colors.normalColor;
        _DisabledColor = _MinionButton.colors.disabledColor;
        _DefaultSprite = _IngredientImage.sprite;

        _HeroNearCookingStationEvent.AddListener(OnHeroNearCookingStation);
        _HeroMovedAwayFromStationEvent.AddListener(OnHeroMovedAwayFromCookingStation);
        _IngredientModifiedEvent.AddListener(OnIgredientModified);
        _IngredientPickedUpEvent.AddListener(OnIngredientPickedUp);
        _HeroDiedEvent.AddListener(OnHeroDiedEvent);

        Initialize();
    }
예제 #6
0
    private void Start()
    {
        // Initializing variables
        _Image         = GetComponent <Image>();
        _DefaultSprite = _Image.sprite;

        // Subscribing to combat events
        _CombatData.CombatSequenceStartedEvent.AddListener(OnCombatOptionStartedOrRestarted);
        _CombatData.CombatSequenceRestartedEvent.AddListener(OnCombatOptionStartedOrRestarted);
        _MatchStartedEvent.AddListener(OnCombatOptionStartedOrRestarted);

        if (!_ShowLocalPlayerOption)
        {
            _CombatData.ShowCombatResultsEvent.AddListener(OnShowCombatResults);
            return;
        }
        _CombatData.CombatOptionChosenEvent.AddListener(OnShowLocalCombatOption);
    }
예제 #7
0
 public void Initialize()
 {
     IngredientsToSpawn = new Dictionary <SO_Tag, int>();
     _IngredientWastedEvent.AddListener(OnIngredientWasted);
 }
예제 #8
0
 private void Start()
 {
     _IngredientAddedToCookingPotEvent.AddListener(OnIngredientAddedToCookingPot);
 }
예제 #9
0
 private void Awake()
 {
     _MatchStartedEvent.AddListener(OnMatchStarted);
     _IngredientData = Resources.Load <SO_IngredientData>("IngredientsData");
     _UpdateUI       = null;
 }
예제 #10
0
 private void OnEnable()
 {
     _EventToListenTo.AddListener(OnEvent);
 }
예제 #11
0
 private void OnEnable()
 {
     _EventToTriggerOn.AddListener(OnEvent);
 }