// Start is called before the first frame update void Awake() { maxHP = baseClass.health; power = baseClass.power; speed = baseClass.speed; primary = baseClass.primary; secondary = baseClass.secondary; evade = baseClass.evade; }
private void Trigger(EmitAbility ability) { Vector2 offset = vc.facingDirection * ability.offset; AbilityObject ao = Instantiate( ability.prefab.gameObject, transform.position + new Vector3(offset.x, offset.y, 0.0f), Quaternion.identity ).GetComponent <AbilityObject>(); ao.speed = ability.speed; ao.lifespan = ability.lifespan; ao.direction = new Vector2( ao.transform.position.x - transform.position.x, ao.transform.position.y - transform.position.y ).normalized; //if (ao.isMeleee) ao.transform.SetParent(gameObject.transform); }
// Start is called before the first frame update void Start() { primaryAbility = lo.primary; secondaryAbility = lo.secondary; }