コード例 #1
0
    private void Start()
    {
        //magiczny float ze skalowania range dla food pile
        var range = Consumable.GetRange() * 2.3046f;

        rangeIndicator.transform.localScale = Vector3.one * Consumable.GetRange();// * 2.3046f;

        //retard singleton
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            GameObject.Destroy(instance.gameObject);
            instance = this;
        }
    }
コード例 #2
0
ファイル: ShopUI.cs プロジェクト: defacto2k15/PandaConnection
 public void ShowDetailsFor(IConsumable consumable)
 {
     currentConsumable = consumable;
     if (consumable as BaseEroConsumable)
     {
         consumableRange.SetText($"Range: { consumable.GetRange()} \n Ero value: {(consumable as BaseEroConsumable).MEroNutritionalValue } \n Time working: {(consumable as BaseEroConsumable).TimeGivingNutrition }");
     }
     else
     if (consumable as BaseFoodConsumable)
     {
         consumableRange.SetText($"Range: { consumable.GetRange()} \n Food value: {(consumable as BaseFoodConsumable).m_foodNutritionalValue } \n Time working: {(consumable as BaseFoodConsumable).timeGivingNutrition }");
     }
     else
     {
         consumableRange.SetText($"Type: {(consumable as BaseDrugConsumable).drugType} \n Potency: { (consumable as BaseDrugConsumable).m_drugValue}");
     }
     consumablePrice.SetText($"Price: {consumable.GetPrice()}");
     consumableName.SetText(consumable.GetName());
     buyButon.interactable = true;
 }