protected override void qAwake() { shield = GetComponentInChildren <Shield>(); shield.renderer.enabled = false; light = GetComponentInChildren <Light>(); trail = TrailEnum.none; maxSpeed = maxNoTrailSpeed; light.enabled = false; Reset(); }
public override void HandleInput(string type, float val) { if (type == "AxisHorizontal") { if (val != 0) { velocityHorizontal += val * acceleration * Time.deltaTime; } else { velocityHorizontal *= friction; } } else if (type == "AxisVertical") { if (val != 0) { velocityVertical += val * acceleration * Time.deltaTime; } else { velocityVertical *= friction; } } else if (type == "TrailDown") { if (val == 0) { return; } trail = TrailEnum.normal; light.enabled = true; maxSpeed = maxTrailSpeed; } else if (type == "TrailUp") { if (val == 0) { return; } trail = TrailEnum.none; light.enabled = false; maxSpeed = maxNoTrailSpeed; } else if (type == "SlowDown") { if (val == 0) { return; } slowMultiplier = 0.5f; } else if (type == "SlowUp") { if (val == 0) { return; } slowMultiplier = 1.0f; } }