public void OverrideColorZonesColor(ChromieDefenition chromieDefenition) { foreach (ColorZoneController colorZone in _colorZones) { colorZone.SetOverrideColor(chromieDefenition); } }
private ChromieSelectionItemCellController CreateInventoryItemCell(ChromieDefenition chromieDefenition) { GameObject newCell = Instantiate(_inventoryItemCellPrefab); newCell.transform.SetParent(_inventoryListContent); newCell.transform.localScale = Vector3.one; newCell.SetActive(true); return newCell.GetComponent<ChromieSelectionItemCellController>(); }
private bool AddSelection(ChromieDefenition chromieDefenition) { bool result = GameSetupManager.Instance.TryAddSelection(chromieDefenition); if (result) { UpdateSelectionList(); } return result; }
private ColorZoneController CreateColorZone(ChromieDefenition chromieDefenition, int index) { ColorZoneController colorZoneController = Instantiate(_colorZoneControllerPrefab); colorZoneController.transform.SetParent(this.transform); colorZoneController.transform.position = PositionForColorzoneAtIndex(index); colorZoneController.transform.localScale = Vector3.one; colorZoneController.SetColorZone(chromieDefenition); return colorZoneController; }
public void SetOverrideColor(ChromieDefenition chromieDefention) { _overrideChromieDefenition = chromieDefention; if (_overrideChromieDefenition == null) { SetColorZoneCharacter(_chromieDefenition); } else { SetColorZoneCharacter(_overrideChromieDefenition); } }
public void SetSelection(ChromieDefenition chromieDefenition) { _chromieDefenition = chromieDefenition; if (_chromieDefenition != null && _chromieDefenition.ChromieSprite != null) { _selectedItemImage.gameObject.SetActive(true); _selectedItemImage.sprite = _chromieDefenition.ChromieSprite; } else { _selectedItemImage.gameObject.SetActive(false); } }
private void DisplayInfo(ChromieDefenition chromieDefenition) { _currenctSelection = chromieDefenition; string infoString = ""; infoString = chromieDefenition.ChromieName + "\n\n"; if (chromieDefenition.PassivePowerup != null) { infoString += chromieDefenition.PassivePowerup.Description + "\n\n"; } if (chromieDefenition.ActivePowerup != null) { infoString += chromieDefenition.ActivePowerup.Description + "\n\n"; } if (chromieDefenition.DroppedPowerup != null) { infoString += chromieDefenition.DroppedPowerup.Description + "\n\n"; } _chromieInfoLabel.text = infoString; if (InventoryManager.Instance.HasItem(chromieDefenition.ChromieColor.ToString())) { if (_unlockButton != null) { _unlockButton.SetActive(false); } } else { ShopItem shopitem = ShopManager.Instance.GetShopItemForChromie(chromieDefenition.ChromieColor); if (shopitem != null) { if (_unlockButton != null) { _unlockButton.SetActive(true); } if (_unlockPriceLabel != null) { _unlockPriceLabel.text = shopitem.Price.Amount.ToString(); } } } }
public void SwitchChromie(ChromieDefenition newChromie) { SetChromie(newChromie); }
public void SetChromie(ChromieDefenition chromieDefenition) { _chromieDefenition = chromieDefenition; if (_characterController != null) { Lean.LeanPool.Despawn(_characterController.gameObject); _characterController = null; } GameObject characterGameobject = Lean.LeanPool.Spawn(chromieDefenition.CharacterPrefab); characterGameobject.transform.SetParent(this.transform); characterGameobject.transform.localPosition = Vector3.zero; characterGameobject.transform.localScale = Vector3.one; _characterController = characterGameobject.GetComponent<ChromieCharacterController>(); IsPowerup = false; if (_trail != null) { _trail.sortingOrder = -10; _trail.material.color = Color.red; Timing.RunCoroutine(ResetTrail()); } if (_trailParticles != null) { _trailParticles.startColor = chromieDefenition.ColorValue; } }
private void SetColorZoneCharacter(ChromieDefenition chromieDefention) { if (_colorZoneCharacter != null && _colorZoneCharacter.gameObject != null) { Destroy(_colorZoneCharacter.gameObject); } GameObject colorZoneCharacter = Instantiate(chromieDefention.ColorZonePrefab) as GameObject; colorZoneCharacter.transform.SetParent(this.transform); colorZoneCharacter.transform.localPosition = Vector3.zero; _colorZoneCharacter = colorZoneCharacter.GetComponent<ColorZoneCharacterController>(); }
public void SetColorZone(ChromieDefenition chromieDefention) { _chromieDefenition = chromieDefention; SetColorZoneCharacter(_chromieDefenition); }
void Start() { _overrideChromieDefenition = null; GameplayEventsDispatcher.Instance.OnChromieCollected += OnChromieCollectedHandler; }