// Use this for initialization private void Start() { _particleScript = SingleParticle.GetComponent <PhysicsSingleParticle>(); if (_particleScript == null) { Debug.Log("gameObject attachs is a nonParticle"); } if (_hpScript == null) { Debug.Log("Attempting to getComponentFor hpScript"); _hpScript = GetComponent <HPScript>(); if (_hpScript == null) { Debug.LogError("hpScript not found"); } } _hpScript.HpImpactReceived += HpScriptOnHpImpactReceived; }
// Use this for initialization private void Start() { _particleScript = SingleParticle.GetComponent<PhysicsSingleParticle>(); if(_particleScript == null)Debug.Log("gameObject attachs is a nonParticle"); if (_hpScript == null) { Debug.Log("Attempting to getComponentFor hpScript"); _hpScript = GetComponent<HPScript>(); if (_hpScript == null) { Debug.LogError("hpScript not found"); } } _hpScript.HpImpactReceived += HpScriptOnHpImpactReceived; }