void Start() { heroXP = GameObject.Find("Hero").GetComponent<ExperienceReceiver>(); if (!heroXP) Debug.Log("HeroXP not found"); XPBarImage = GetComponent<Image>(); }
// Use this for initialization void Start() { text = GetComponent<Text>(); heroXP = GameObject.Find("Hero").GetComponent<ExperienceReceiver>(); if (!heroXP) Debug.Log("HeroXP not found"); }
// Use this for initialization void Start() { text = GetComponent <Text>(); heroXP = GameObject.Find("Hero").GetComponent <ExperienceReceiver>(); if (!heroXP) { Debug.Log("HeroXP not found"); } }
void Start() { heroXP = GameObject.Find("Hero").GetComponent <ExperienceReceiver>(); if (!heroXP) { Debug.Log("HeroXP not found"); } XPBarImage = GetComponent <Image>(); }
public void die(GameObject killer) { if (!killer) // If the killer is dead, no need to give xp { return; } ExperienceReceiver xpReceiver = killer.GetComponent <ExperienceReceiver>(); if (xpReceiver) // if the killer receives experience, give it { xpReceiver.addXP(experience); FloatingText xpText = (Instantiate(floatingText) as GameObject).GetComponent <FloatingText>(); xpText.initialize(gameObject, "+" + experience + "xp"); xpText.setColor(Color.yellow); } }