// Use this for initialization private void Start() { animator = GetComponent <Animator>(); _healthScript = ScriptableObject.CreateInstance <HealthScriptable>(); _healthScript.Health = this.Health; MaxHealth = _healthScript.Health; animator.SetInteger("Health", _healthScript.Health); _target = FindObjectOfType <PayloadBehaviour>().gameObject; _navAgent = GetComponent <NavMeshAgent>(); }
protected void StartUp() { Health = ScriptableObject.CreateInstance <HealthScriptable>(); Health.MaxValue = HealthAmount; Health.Value = HealthAmount; Meter = ScriptableObject.CreateInstance <MeterScriptable>(); Meter.MaxValue = 100; Meter.Value = 0; CurrentHealth = HealthAmount; rb2d = GetComponent <Rigidbody2D>(); _animator = GetComponent <Animator>(); fighterCollider = GetComponent <BoxCollider2D>(); }