public void Start() { character = GetComponent <RebirthPlayerController>(); UIBagPanel = GameManager.singleton.Hud.UIBagPanel; for (int i = 0; i < UIBagPanel.transform.childCount; i++) { GameObject slot = UIBagPanel.transform.GetChild(i).gameObject; BagSlot bagSlot = slot.AddComponent <BagSlot>(); bagSlot.InitSlot(i); mSlots.Add(bagSlot); } ItemUsed += UIBag_ItemUsed; ItemAdded += UIBag_ItemAdded; ItemRemoved += UIBag_ItemRemoved; }
void Start() { character = GetComponent <RebirthPlayerController>(); #region Health cHealth.AddAttribute(cToughness); Health = cHealth.FinalValue; cHealth.AddAttribute(new CAttribute("Health_RegenerationRate", HealthRegenerationRate)); cHealth.AddAttribute(new CAttribute("Health_FallRate", HealthFallRate)); #endregion #region Hunger / Thirst / Fatigue Hunger = cHunger.FinalValue; cHunger.AddAttribute(new CAttribute("Hunger_FallRate", HungerFallRate)); Thirst = cThirst.FinalValue; cThirst.AddAttribute(new CAttribute("Thirst_FallRate", ThirstFallRate)); cFatigue.AddAttribute(cAgility); Fatigue = cFatigue.FinalValue; cFatigue.AddAttribute(new CAttribute("Fatigue_FallRate", FatigueFallRate)); #endregion #region Endurance cEndurance.AddAttribute(cAgility); endurance = cEndurance.FinalValue; cEndurance.AddAttribute(new CAttribute("Endurance_RegenerationRate", EnduranceRegenerationRate)); cEndurance.AddAttribute(new CAttribute("Endurancea_FallRate", EnduranceFallRate)); #endregion #region Weight / Endurance //weight.AddAttribute(endurance); //Vitals_Weight = 0; // Calculate Weight from Inventory Items #endregion InvokeRepeating("UpdateUI", 0.1f, 0.1f); }
void Start() { GM = GameManager.singleton; character = GetComponent <RebirthPlayerController>(); anim = GetComponent <Animator>(); }