void SetActiveModel(CashData cashData) { _activeModelKey = cashData.name; if (!_cashModels.ContainsKey(_activeModelKey)) { _cashModels.Add(cashData.name, Instantiate(cashData.model, transform.position, Quaternion.identity, this.transform) as GameObject); } _cashModels[_activeModelKey].SetActive(true); }
public void Initilise(CashData cashData, int amount, Vector3 whereToDrop, CashSource source) { _source = source; _amount = amount; _timeUntilExpiry = cashData.expiryTimer; transform.position = whereToDrop + _DropOffset; _initialPosition = whereToDrop; SetActiveModel(cashData); StartListeningForUserClick(); }